23#if defined(SK_BUILD_FOR_WIN)
52 default:
return nullptr;
62 if (!matrix.asAffine(
a)) {
90 if (ctl2X != dstX || ctl2Y != dstY) {
101 content->writeText(cmd.c_str());
107 append_cubic(cubic[1].fX, cubic[1].fY, cubic[2].fX, cubic[2].fY,
108 cubic[3].fX, cubic[3].fY,
content);
113 SkScalar bottom = std::min(rect.fBottom, rect.fTop);
140 if (path.isRect(&rect, &isClosed, &direction) &&
150 kEmpty_SkipFillState,
151 kSingleLine_SkipFillState,
152 kNonSingleLine_SkipFillState,
154 SkipFillState fillState = kEmpty_SkipFillState;
168 MoveTo(
args[0].fX,
args[0].fY, ¤tSegment);
169 lastMovePt =
args[0];
170 fillState = kEmpty_SkipFillState;
175 if ((fillState == kEmpty_SkipFillState) && (
args[0] != lastMovePt)) {
176 fillState = kSingleLine_SkipFillState;
179 fillState = kNonSingleLine_SkipFillState;
185 fillState = kNonSingleLine_SkipFillState;
192 for (
int i = 0; i < converter.countQuads(); ++i) {
195 fillState = kNonSingleLine_SkipFillState;
201 args[3].fX,
args[3].fY, ¤tSegment);
202 fillState = kNonSingleLine_SkipFillState;
208 currentSegment.
reset();
255 content->writeText(
"/Pattern CS/Pattern cs");
266 for (
int i = places; i > 0; --i) {
271 for (j = places; j > 1; --j) {
281static constexpr int int_pow(
int base,
unsigned exp,
int acc = 1) {
285 (exp % 2) ? acc *
base : acc);
290 static constexpr int kFactor =
int_pow(10, kFloatColorDecimalCount);
292 if (
x >= kFactor ||
x <= 0) {
313 if (!matrix.invert(&inverse)) {
322 std::unique_ptr<SkPDFDict> resources,
324 const int kTiling_PatternType = 1;
325 const int kColoredTilingPattern_PaintType = 1;
326 const int kConstantSpacing_TilingType = 1;
329 pattern->
insertInt(
"PatternType", kTiling_PatternType);
330 pattern->
insertInt(
"PaintType", kColoredTilingPattern_PaintType);
331 pattern->
insertInt(
"TilingType", kConstantSpacing_TilingType);
335 pattern->
insertObject(
"Resources", std::move(resources));
336 if (!matrix.isIdentity()) {
355#ifdef SK_PDF_BASE85_BINARY
359 dst->writeText(
"\n");
362 uint8_t src[4] = {0, 0, 0, 0};
366 dst->writeText(
"~>\n");
369 uint32_t v = ((uint32_t)src[0] << 24) | ((uint32_t)src[1] << 16) |
370 ((uint32_t)src[2] << 8) |
src[3];
371 if (v == 0 &&
count == 4) {
376 for (
int n = 4; n > 0; --n) {
377 buffer[n] = (v % 85) +
'!';
385 dst->writeText(
"\n");
394 if (!matrix.asAffine(values)) {
405#if defined(SK_BUILD_FOR_WIN)
412 dt->
fYear = st.wYear;
429 gmtime_r(&m_time, &tstruct);
431 dt->
fYear = tstruct.tm_year + 1900;
@ kExclusion
rc = s + d - two(s*d), ra = kSrcOver
@ kSaturation
saturation of source with hue and luminosity of destination
@ kColorBurn
darken destination to reflect source
@ kLighten
rc = s + d - min(s*da, d*sa), ra = kSrcOver
@ kHue
hue of source with saturation and luminosity of destination
@ kMultiply
r = s*(1-da) + d*(1-sa) + s*d
@ kColorDodge
brighten destination to reflect source
@ kSrcOver
r = s + (1-sa)*d
@ kXor
r = s*(1-da) + d*(1-sa)
@ kLuminosity
luminosity of source with hue and saturation of destination
@ kSoftLight
lighten or darken, depending on source
@ kDifference
rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
@ kOverlay
multiply or screen, depending on destination
@ kColor
hue and saturation of source with luminosity of destination
@ kHardLight
multiply or screen, depending on source
@ kDarken
rc = s + d - max(s*da, d*sa), ra = kSrcOver
#define SkFixedRoundToInt(x)
#define sk_float_round2int(x)
void SkConvertQuadToCubic(const SkPoint src[3], SkPoint dst[4])
static SkImage_Base * as_IB(SkImage *image)
void SkPDFWriteResourceName(SkWStream *dst, SkPDFResourceType type, int key)
static std::unique_ptr< SkPDFArray > SkPDFMakeArray(Args... args)
static size_t print_permil_as_decimal(int x, char *result, unsigned places)
static void append_quad(const SkPoint quad[], SkWStream *content)
static void append_cubic(SkScalar ctl1X, SkScalar ctl1Y, SkScalar ctl2X, SkScalar ctl2Y, SkScalar dstX, SkScalar dstY, SkWStream *content)
static constexpr int int_pow(int base, unsigned exp, int acc=1)
#define NOT_IMPLEMENTED(condition, assert)
constexpr uint8_t SkToU8(S x)
size_t bytesWritten() const override
bool writeToStream(SkWStream *dst) const
SkISize dimensions() const
static void SetAffineIdentity(SkScalar affine[6])
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
void insertName(const char key[], const char nameValue[])
void insertObject(const char key[], std::unique_ptr< SkPDFObject > &&)
void insertInt(const char key[], int32_t value)
void insertScalar(const char key[], SkScalar value)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
@ kStrokeAndFill_Style
sets to stroke and fill geometry
static bool AllPointsEq(const SkPoint pts[], int count)
Verb next(SkPoint pts[4])
SkScalar conicWeight() const
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static const uint8_t buffer[]
union flutter::testing::@2838::KeyboardChange::@76 content
void GetDateTime(SkPDF::DateTime *)
void ApplyGraphicState(int objectIndex, SkWStream *content)
void PopulateTilingPatternDict(SkPDFDict *pattern, SkRect &bbox, std::unique_ptr< SkPDFDict > resources, const SkMatrix &matrix)
size_t ColorToDecimalF(float value, char result[kFloatColorDecimalCount+2])
size_t ColorToDecimal(uint8_t value, char result[5])
const char * BlendModeName(SkBlendMode)
std::unique_ptr< SkPDFArray > MatrixToArray(const SkMatrix &matrix)
void EmitPath(const SkPath &path, SkPaint::Style paintStyle, bool doConsumeDegerates, SkWStream *content, SkScalar tolerance=0.25f)
void AppendRectangle(const SkRect &rect, SkWStream *content)
void PaintPath(SkPaint::Style style, SkPathFillType fill, SkWStream *content)
void AppendScalar(SkScalar value, SkWStream *stream)
void MoveTo(SkScalar x, SkScalar y, SkWStream *content)
void AppendLine(SkScalar x, SkScalar y, SkWStream *content)
void AppendTransform(const SkMatrix &, SkWStream *)
void ApplyPattern(int objectIndex, SkWStream *content)
bool ToBitmap(const SkImage *img, SkBitmap *dst)
bool InverseTransformBBox(const SkMatrix &matrix, SkRect *bbox)
void ClosePath(SkWStream *content)
void StrokePath(SkWStream *content)
std::unique_ptr< SkPDFArray > RectToArray(const SkRect &rect)
uint8_t fDayOfWeek
0..6, 0==Sunday
static constexpr SkPoint Make(float x, float y)
constexpr float left() const
constexpr float top() const
constexpr float height() const
constexpr float right() const
constexpr float width() const
constexpr float bottom() const