Flutter Engine
The Flutter Engine
Functions
SkPDFUtils.cpp File Reference
#include "include/core/SkBitmap.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkImage.h"
#include "include/core/SkPath.h"
#include "include/core/SkPathTypes.h"
#include "include/core/SkRect.h"
#include "include/core/SkSize.h"
#include "include/core/SkStream.h"
#include "include/core/SkString.h"
#include "include/docs/SkPDFDocument.h"
#include "include/private/base/SkFixed.h"
#include "include/private/base/SkFloatingPoint.h"
#include "include/private/base/SkPoint_impl.h"
#include "include/private/base/SkTo.h"
#include "src/core/SkGeometry.h"
#include "src/core/SkPathPriv.h"
#include "src/image/SkImage_Base.h"
#include "src/pdf/SkPDFResourceDict.h"
#include "src/pdf/SkPDFTypes.h"
#include "src/pdf/SkPDFUtils.h"
#include <algorithm>
#include <ctime>
#include <utility>

Go to the source code of this file.

Functions

static void append_cubic (SkScalar ctl1X, SkScalar ctl1Y, SkScalar ctl2X, SkScalar ctl2Y, SkScalar dstX, SkScalar dstY, SkWStream *content)
 
static void append_quad (const SkPoint quad[], SkWStream *content)
 
static size_t print_permil_as_decimal (int x, char *result, unsigned places)
 
static constexpr int int_pow (int base, unsigned exp, int acc=1)
 

Function Documentation

◆ append_cubic()

static void append_cubic ( SkScalar  ctl1X,
SkScalar  ctl1Y,
SkScalar  ctl2X,
SkScalar  ctl2Y,
SkScalar  dstX,
SkScalar  dstY,
SkWStream content 
)
static

Definition at line 89 of file SkPDFUtils.cpp.

91 {
92 SkString cmd("y\n");
94 content->writeText(" ");
96 content->writeText(" ");
97 if (ctl2X != dstX || ctl2Y != dstY) {
98 cmd.set("c\n");
100 content->writeText(" ");
102 content->writeText(" ");
103 }
105 content->writeText(" ");
107 content->writeText(" ");
108 content->writeText(cmd.c_str());
109}
union flutter::testing::@2836::KeyboardChange::@76 content
void AppendScalar(SkScalar value, SkWStream *stream)
Definition: SkPDFUtils.h:98

◆ append_quad()

static void append_quad ( const SkPoint  quad[],
SkWStream content 
)
static

Definition at line 111 of file SkPDFUtils.cpp.

111 {
112 SkPoint cubic[4];
114 append_cubic(cubic[1].fX, cubic[1].fY, cubic[2].fX, cubic[2].fY,
115 cubic[3].fX, cubic[3].fY, content);
116}
void SkConvertQuadToCubic(const SkPoint src[3], SkPoint dst[4])
Definition: SkGeometry.cpp:378
static void append_cubic(SkScalar ctl1X, SkScalar ctl1Y, SkScalar ctl2X, SkScalar ctl2Y, SkScalar dstX, SkScalar dstY, SkWStream *content)
Definition: SkPDFUtils.cpp:89
AI float cubic(float precision, const SkPoint pts[], const VectorXform &vectorXform=VectorXform())
Definition: WangsFormula.h:195

◆ int_pow()

static constexpr int int_pow ( int  base,
unsigned  exp,
int  acc = 1 
)
staticconstexpr

Definition at line 288 of file SkPDFUtils.cpp.

288 {
289 return exp < 1 ? acc
290 : int_pow(base * base,
291 exp / 2,
292 (exp % 2) ? acc * base : acc);
293}
static constexpr int int_pow(int base, unsigned exp, int acc=1)
Definition: SkPDFUtils.cpp:288

◆ print_permil_as_decimal()

static size_t print_permil_as_decimal ( int  x,
char *  result,
unsigned  places 
)
static

Definition at line 271 of file SkPDFUtils.cpp.

271 {
272 result[0] = '.';
273 for (int i = places; i > 0; --i) {
274 result[i] = '0' + x % 10;
275 x /= 10;
276 }
277 int j;
278 for (j = places; j > 1; --j) {
279 if (result[j] != '0') {
280 break;
281 }
282 }
283 result[j + 1] = '\0';
284 return j + 1;
285}
GAsyncResult * result
double x