92#ifndef SK_PDF_MASK_QUALITY
95 #define SK_PDF_MASK_QUALITY 50
108class ScopedOutputMarkedContentTags {
116 fOut->writeText(
"/P <</MCID ");
117 fOut->writeDecAsText(fMark.id());
118 fOut->writeText(
" >>BDC\n");
122 explicit operator bool()
const {
return bool(fMark); }
126 ~ScopedOutputMarkedContentTags() {
128 fOut->writeText(
"EMC\n");
148 if (imgQuality <= 100 && imgQuality >= 0) {
202#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
215 paint->setShader(
paint->getShader()->makeWithLocalMatrix(
m));
219 paint->setShader(
paint->getShader()->makeWithLocalMatrix(ctm));
227 if (!
paint->isSrcOver() &&
232 if (
paint->getColorFilter()) {
241 if (
paint->get()->getStyle() != style) {
242 paint->writable()->setStyle(style);
283 , fClipStack(clipStack)
285 if (
matrix.hasPerspective()) {
291 fDevice->setUpContentEntry(clipStack,
matrix,
paint, textScale, &fDstFormXObject);
297 if (fContentStream) {
302 fDevice->finishContentEntry(fClipStack, fBlendMode, fDstFormXObject, shape);
306 explicit operator bool()
const {
return fContentStream !=
nullptr; }
311 switch (fBlendMode) {
365void SkPDFDevice::reset() {
366 fGraphicStateResources.
reset();
367 fXObjectResources.
reset();
368 fShaderResources.
reset();
369 fFontResources.
reset();
382 if (
rect.isEmpty()) {
385 if (
value->size() !=
sizeof(nodeID)) {
return; }
386 memcpy(&nodeID,
value->data(),
sizeof(nodeID));
405 if (transformedRect.
isEmpty()) {
417 std::unique_ptr<SkPDFLink>
link = std::make_unique<SkPDFLink>(
418 linkType,
value, transformedRect, fNodeId);
431 if (this->hasEmptyClip()) {
443 if (this->hasEmptyClip()) {
460 if (
paint->getPathEffect() || this->localToDevice().hasPerspective()) {
467 if (
paint->getStrokeWidth()) {
473 for (
size_t i = 0;
i <
count;
i++) {
475 r.
inset(-halfStroke, -halfStroke);
494 for (
size_t i = 1;
i <
count;
i++) {
500 for (
size_t i = 0;
i <
count/2;
i++) {
508 for (
size_t i = 0;
i <
count;
i++) {
537void SkPDFDevice::internalDrawPathWithFilter(
const SkClipStack& clipStack,
570 canvas.drawImage(mask, dstMaskBounds.
x(), dstMaskBounds.
y());
580 maskDevice->makeFormXObjectFromDevice(dstMaskBounds,
true),
false,
584 this->clearMaskOnGraphicState(
content.stream());
596 tmp.insertName(
"SMask",
"None");
597 noSMaskGS = fDocument->
emit(tmp);
599 this->setGraphicState(noSMaskGS, contentStream);
602void SkPDFDevice::internalDrawPath(
const SkClipStack& clipStack,
606 bool pathIsMutable) {
607 if (clipStack.
isEmpty(this->bounds())) {
614 if (
paint->getMaskFilter()) {
615 this->internalDrawPathWithFilter(clipStack, ctm, origPath, *
paint);
621 if (
paint->getPathEffect()) {
622 if (clipStack.
isEmpty(this->bounds())) {
625 if (!pathIsMutable) {
626 modifiedPath = origPath;
627 pathPtr = &modifiedPath;
628 pathIsMutable =
true;
634 if (
paint->getStrokeWidth() != 0) {
635 paint.writable()->setStrokeWidth(0);
638 paint.writable()->setPathEffect(
nullptr);
641 if (this->handleInversePath(*pathPtr, *
paint, pathIsMutable)) {
645 if (!pathIsMutable) {
646 modifiedPath = origPath;
647 pathPtr = &modifiedPath;
648 pathIsMutable =
true;
651 if (
paint->getShader()) {
661 constexpr SkScalar kToleranceScale = 0.0625f;
663 SkScalar tolerance = matrixScale > 0.0f ? kToleranceScale / matrixScale : kToleranceScale;
664 bool consumeDegeratePathSegments =
696class GlyphPositioner {
702 , fCurrentMatrixOrigin(origin)
703 , fTextSkewX(textSkewX) {
705 ~GlyphPositioner() { this->flush(); }
708 fContent->writeText(
"> Tj\n");
717 bool thousandEM = fPDFFont->typeface()->getUnitsPerEm() == 1000;
718 fViewersAgreeOnAdvancesInFont = thousandEM || !convertedToType3;
725 fContent->writeText(
"1 0 ");
727 fContent->writeText(
" -1 ");
729 fContent->writeText(
" ");
731 fContent->writeText(
" Tm\n");
732 fCurrentMatrixOrigin.set(0.0f, 0.0f);
735 SkPoint position = xy - fCurrentMatrixOrigin;
736 if (!fViewersAgreeOnXAdvance || position !=
SkPoint{fXAdvance, 0}) {
739 fContent->writeText(
" ");
741 fContent->writeText(
" Td ");
742 fCurrentMatrixOrigin = xy;
744 fViewersAgreeOnXAdvance =
true;
746 fXAdvance += advanceWidth;
747 if (!fViewersAgreeOnAdvancesInFont) {
748 fViewersAgreeOnXAdvance =
false;
751 fContent->writeText(
"<");
754 if (fPDFFont->multiByteGlyphs()) {
767 bool fViewersAgreeOnAdvancesInFont =
true;
768 bool fViewersAgreeOnXAdvance =
true;
770 bool fInText =
false;
771 bool fInitialized =
false;
776 return glyph < glyphToUnicode.size() ? glyphToUnicode[
SkToInt(glyph)] : -1;
780struct PositionedGlyph {
800void SkPDFDevice::drawGlyphRunAsPath(
813 Rec* rec = reinterpret_cast<Rec*>(ctx);
816 total.postTranslate(rec->fPos->fX + rec->fOffset.fX,
817 rec->fPos->fY + rec->fOffset.fY);
818 rec->fPath->addPath(*path, total);
822 this->internalDrawPath(this->cs(), this->localToDevice(),
path, runPaint,
true);
831 if (this->localToDevice().hasPerspective()) {
833 this->internalDrawGlyphRun(tmpGlyphRun,
offset, transparent);
835 this->internalDrawGlyphRun(tmpGlyphRun,
offset, transparent);
851 bool bitmapOnly =
nullptr == glyph->
path();
853 return convertedToType3 != bitmapOnly;
856void SkPDFDevice::internalDrawGlyphRun(
863 if (!glyphCount || !glyphIDs || glyphRunFont.
getSize() <= 0 || this->hasEmptyClip()) {
869 || this->localToDevice().hasPerspective()
872 this->drawGlyphRunAsPath(glyphRun,
offset, runPaint);
877 SkDebugf(
"SkPDF: glyphRunFont has no typeface.\n");
898 SkScalar textScaleY = textSize / emSize;
910 out->writeText(
"BT\n");
925 if (clusterator.reversedChars()) {
926 out->writeText(
"/ReversedChars BMC\n");
928 SK_AT_SCOPE_EXIT(
if (clusterator.reversedChars()) { out->writeText(
"EMC\n"); } );
936 int index = c.fGlyphIndex;
937 int glyphLimit = index + c.fGlyphCount;
939 bool actualText =
false;
941 glyphPositioner.flush();
942 out->writeText(
"EMC\n");
946 const char* textPtr = c.fUtf8Text;
947 const char* textEnd = c.fUtf8Text + c.fTextByteLength;
952 if (textPtr < textEnd || // >1
code points in cluster
954 unichar !=
map_glyph(glyphToUnicode, glyphIDs[index]))
956 glyphPositioner.flush();
957 out->writeText(
"/Span<</ActualText ");
959 out->writeText(
" >> BDC\n");
964 for (; index < glyphLimit; ++index) {
966 if (numGlyphs <= gid) {
972 glyphs[index], textScaleX, textScaleY,
975 if (!
contains(clipStackBounds, {glyphBounds.
x(), glyphBounds.
y()})) {
979 if (!clipStackBounds.
intersects(glyphBounds)) {
987 glyphPositioner.setFont(
font);
992 out->writeText(
" Tf\n");
995 font->noteGlyphUsage(gid);
1008 glyphPositioner.writeGlyph(encodedGlyph, advance, xy);
1013void SkPDFDevice::onDrawGlyphRunList(
SkCanvas*,
1018 this->internalDrawGlyphRun(glyphRun, glyphRunList.origin(),
paint);
1023 if (this->hasEmptyClip()) {
1030 if (this->hasEmptyClip()) {
1046 pageXform.
mapRect(&shapeBounds);
1049 ScopedOutputMarkedContentTags
mark(fNodeId, point, fDocument,
content);
1062 std::vector<SkPDFIndirectReference>
dst;
1063 dst.reserve(
src.count());
1074 sort(fShaderResources),
1075 sort(fXObjectResources),
1076 sort(fFontResources));
1085 return std::make_unique<SkMemoryStream>();
1091 if (fNeedsExtraSave) {
1095 if (fNeedsExtraSave) {
1098 fNeedsExtraSave =
false;
1099 return std::unique_ptr<SkStreamAsset>(
buffer.detachAsStream());
1109bool SkPDFDevice::handleInversePath(
const SkPath& origPath,
1111 bool pathIsMutable) {
1116 if (this->hasEmptyClip()) {
1130 noInversePaint.setStrokeWidth(0);
1131 pathPtr = &modifiedPath;
1146 if (!totalMatrix.
invert(&transformInverse)) {
1161 this->internalDrawPath(this->
cs(), this->
localToDevice(), modifiedPath, noInversePaint,
true);
1168 if (!fInitialTransform.
invert(&inverseTransform)) {
1169 SkDEBUGFAIL(
"Layer initial transform should be invertible.");
1170 inverseTransform.
reset();
1173 const char* colorSpace = alpha ?
"DeviceGray" :
nullptr;
1179 this->makeResourceDict(), inverseTransform, colorSpace);
1188 return this->makeFormXObjectFromDevice(
SkIRect{0, 0, this->
width(), this->
height()}, alpha);
1204 fDocument),
content.stream());
1205 this->drawFormXObject(xObject,
content.stream(),
nullptr);
1206 this->clearMaskOnGraphicState(
content.stream());
1244 color = SkColor4f::FromColor(colorShader->color());
1254 SkRect clipStackBounds = clipStack ? clipStack->
bounds(deviceBounds)
1259 initialTransform.
mapRect(&clipStackBounds);
1263 auto c =
paint.getColor4f();
1265 {c.fR, c.fG, c.fB, 1.0f});
1302 if (!isContentEmpty()) {
1303 *
dst = this->makeFormXObjectFromDevice();
1319 fNeedsExtraSave =
true;
1341 &fGraphicStateResources);
1349void SkPDFDevice::finishContentEntry(
const SkClipStack* clipStack,
1369 fNeedsExtraSave =
true;
1379 fNeedsExtraSave =
true;
1400 if (this->isContentEmpty()) {
1409 this->drawFormXObject(
dst,
content.stream(),
nullptr);
1415 srcFormXObject = this->makeFormXObjectFromDevice();
1427 if (shape !=
nullptr) {
1434 shapeDev.internalDrawPath(clipStack ? *clipStack :
empty,
1436 this->drawFormXObjectWithMask(
dst, shapeDev.makeFormXObjectFromDevice(),
1449 this->drawFormXObject(srcFormXObject,
content.stream(),
nullptr);
1457 this->drawFormXObject(
dst,
content.stream(),
nullptr);
1486bool SkPDFDevice::isContentEmpty() {
1501 return surface->makeImageSnapshot();
1517void SkPDFDevice::internalDrawImageRect(
SkKeyedImage imageSubset,
1523 if (this->hasEmptyClip()) {
1552 if (!
paint->isSrcOver() &&
1571 canvas->
clear(0x00000000);
1573 if (
paint->getShader() !=
nullptr) {
1574 paint.writable()->setShader(
nullptr);
1597 if (
paint->getMaskFilter()) {
1619 maskDevice->makeFormXObjectFromDevice(maskDeviceBounds,
true),
false,
1623 this->clearMaskOnGraphicState(
content.stream());
1626 if (
paint->getMaskFilter()) {
1635 bool needToRestore =
false;
1640 needToRestore =
true;
1660 SkRect physicalBounds = fInitialTransform.
mapRect(outlineBounds);
1694 matrix.setScale(1 / scaleX, 1 / scaleY);
1695 matrix.postTranslate(deltaX, deltaY);
1745 this->drawFormXObject(pdfimage,
content.stream(), &shape);
1760 if (
device->peekPixels(&pmap)) {
1768 if (pdfDevice->isContentEmpty()) {
1785 this->drawFormXObject(pdfDevice->makeFormXObjectFromDevice(),
content.stream(), &shape);
1791 if (this->hasEmptyClip()) {
static const int strokeWidth
static constexpr SkColor kColor
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static const int points[]
@ kOpaque_SkAlphaType
pixel is opaque
#define SkDEBUGFAIL(message)
SkBlendFastPath CheckFastPath(const SkPaint &paint, bool dstIsOpaque)
@ kMultiply
r = s*(1-da) + d*(1-sa) + s*d
@ kSrcOver
r = s + (1-sa)*d
@ kSrcATop
r = s*da + d*(1-sa)
@ kDstATop
r = d*sa + s*(1-da)
@ kDstOver
r = d + (1-da)*s
void SkClipStack_AsPath(const SkClipStack &cs, SkPath *path)
SkColorSpace * sk_srgb_singleton()
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorBLACK
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
SkMaskFilterBase * as_MFB(SkMaskFilter *mf)
std::unique_ptr< uint8_t, SkFunctionObject< SkMaskBuilder::FreeImage > > SkAutoMaskFreeImage
SkPDFIndirectReference SkPDFSerializeImage(const SkImage *img, SkPDFDocument *doc, int encodingQuality)
sk_sp< SkImage > alpha_image_to_greyscale_image(const SkImage *mask)
static SkTCopyOnFirstWrite< SkPaint > clean_paint(const SkPaint &srcPaint)
static void set_style(SkTCopyOnFirstWrite< SkPaint > *paint, SkPaint::Style style)
static bool calculate_inverse_path(const SkRect &bounds, const SkPath &invPath, SkPath *outPath)
static bool is_integral(const SkRect &r)
static SkRect get_glyph_bounds_device_space(const SkGlyph *glyph, SkScalar xScale, SkScalar yScale, SkPoint xy, const SkMatrix &ctm)
static bool needs_new_font(SkPDFFont *font, const SkGlyph *glyph, SkAdvancedTypefaceMetrics::FontType fontType)
static int add_resource(THashSet< SkPDFIndirectReference > &resources, SkPDFIndirectReference ref)
static SkSize rect_to_size(const SkRect &r)
sk_sp< SkImage > mask_to_greyscale_image(SkMaskBuilder *mask)
static bool contains(const SkRect &r, SkPoint p)
static void populate_graphic_state_entry_from_paint(SkPDFDocument *doc, const SkMatrix &matrix, const SkClipStack *clipStack, SkIRect deviceBounds, const SkPaint &paint, const SkMatrix &initialTransform, SkScalar textScale, SkPDFGraphicStackState::Entry *entry, THashSet< SkPDFIndirectReference > *shaderResources, THashSet< SkPDFIndirectReference > *graphicStateResources)
static sk_sp< SkImage > color_filter(const SkImage *image, SkColorFilter *colorFilter)
static bool is_integer(SkScalar x)
static void transform_shader(SkPaint *paint, const SkMatrix &ctm)
static std::vector< SkPDFIndirectReference > sort(const THashSet< SkPDFIndirectReference > &src)
static void draw_points(SkCanvas::PointMode mode, size_t count, const SkPoint *points, const SkPaint &paint, const SkIRect &bounds, SkDevice *device)
static bool treat_as_regular_pdf_blend_mode(SkBlendMode blendMode)
static SkUnichar map_glyph(const std::vector< SkUnichar > &glyphToUnicode, SkGlyphID glyph)
#define SK_PDF_MASK_QUALITY
const char * SkPDFGetNodeIdKey()
void SkPDFWriteResourceName(SkWStream *dst, SkPDFResourceType type, int key)
std::unique_ptr< SkPDFDict > SkPDFMakeResourceDict(const std::vector< SkPDFIndirectReference > &graphicStateResources, const std::vector< SkPDFIndirectReference > &shaderResources, const std::vector< SkPDFIndirectReference > &xObjectResources, const std::vector< SkPDFIndirectReference > &fontResources)
SkPDFIndirectReference SkPDFMakeShader(SkPDFDocument *doc, SkShader *shader, const SkMatrix &canvasTransform, const SkIRect &surfaceBBox, SkColor4f paintColor)
void SkPDFWriteTextString(SkWStream *wStream, const char *cin, size_t len)
static std::unique_ptr< SkPDFArray > SkPDFMakeArray(Args... args)
#define NOT_IMPLEMENTED(condition, assertion)
@ kIntersect_SkPathOp
intersect the two paths
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
sk_sp< T > sk_ref_sp(T *obj)
#define SkScalarTruncToScalar(x)
#define SK_AT_SCOPE_EXIT(stmt)
SkShaderBase * as_SB(SkShader *shader)
constexpr int SkToInt(S x)
constexpr uint32_t SkToU32(S x)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void setShape(const SkPath &shape)
ScopedContentEntry(SkPDFDevice *device, const SkClipStack *clipStack, const SkMatrix &matrix, const SkPaint &paint, SkScalar textScale=0)
ScopedContentEntry(SkPDFDevice *dev, const SkPaint &paint, SkScalar textScale=0)
SkDynamicMemoryWStream * stream()
static const char * Define_Named_Dest_Key()
static const char * Link_Named_Dest_Key()
static const char * URL_Key()
static sk_sp< SkBitmapDevice > Create(const SkImageInfo &, const SkSurfaceProps &, SkRasterHandleAllocator *=nullptr)
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
bool drawsNothing() const
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void clear(SkColor color)
void setMatrix(const SkM44 &matrix)
void concat(const SkMatrix &matrix)
@ kLines_PointMode
draw each pair of points as a line segment
@ kPolygon_PointMode
draw the array of points as a open polygon
@ kPoints_PointMode
draw each point separately
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
SkIRect devClipBounds() const override
void clipRect(const SkRect &, const SkMatrix &matrix, SkClipOp, bool doAA)
bool isEmpty(const SkIRect &deviceBounds) const
uint32_t getTopmostGenID() const
static const uint32_t kWideOpenGenID
SkRect bounds(const SkIRect &deviceBounds) const
const SkMatrix & localToDevice() const
virtual void drawDevice(SkDevice *, const SkSamplingOptions &, const SkPaint &)
const SkM44 & deviceToGlobal() const
static bool DrawToMask(const SkPath &devPath, const SkIRect &clipBounds, const SkMaskFilter *, const SkMatrix *filterMatrix, SkMaskBuilder *dst, SkMaskBuilder::CreateMode mode, SkStrokeRec::InitStyle style)
size_t bytesWritten() const override
bool writeToAndReset(SkWStream *dst)
void prependToAndReset(SkDynamicMemoryWStream *dst)
SkTypeface * getTypeface() const
SkScalar getScaleX() const
SkScalar getSkewX() const
void setEmbolden(bool embolden)
SkGlyphID getGlyphID() const
const SkPath * path() const
SkISize dimensions() const
bool readPixels(GrDirectContext *context, const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY, CachingHint cachingHint=kAllow_CachingHint) const
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
sk_sp< SkImage > makeNonTextureImage(GrDirectContext *=nullptr) const
const sk_sp< SkImage > & image() const
SkKeyedImage subset(SkIRect subset) const
const SkBitmapKey & key() const
virtual bool filterMask(SkMaskBuilder *dst, const SkMask &src, const SkMatrix &, SkIPoint *margin) const =0
static SkMatrix Scale(SkScalar sx, SkScalar sy)
SkMatrix & postTranslate(SkScalar dx, SkScalar dy)
static SkMatrix RectToRect(const SkRect &src, const SkRect &dst, ScaleToFit mode=kFill_ScaleToFit)
SkMatrix & postConcat(const SkMatrix &other)
SkMatrix & postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
static SkMatrix Concat(const SkMatrix &a, const SkMatrix &b)
SkMatrix & setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
bool invert(SkMatrix *inverse) const
void mapXY(SkScalar x, SkScalar y, SkPoint *result) const
static const SkMatrix & I()
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
@ kPerspective_Mask
perspective SkMatrix
@ kIdentity_Mask
identity SkMatrix; all bits clear
SkPDFDevice(SkISize pageSize, SkPDFDocument *document, const SkMatrix &initialTransform=SkMatrix::I())
std::unique_ptr< SkStreamAsset > content()
void drawRect(const SkRect &r, const SkPaint &paint) override
sk_sp< SkDevice > createDevice(const CreateInfo &, const SkPaint *) override
void drawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint[], const SkPaint &paint) override
void drawMesh(const SkMesh &, sk_sp< SkBlender >, const SkPaint &) override
void drawVertices(const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool) override
void drawRRect(const SkRRect &rr, const SkPaint &paint) override
void drawPaint(const SkPaint &paint) override
sk_sp< SkSurface > makeSurface(const SkImageInfo &, const SkSurfaceProps &) override
void drawDevice(SkDevice *, const SkSamplingOptions &, const SkPaint &) override
void drawSpecial(SkSpecialImage *, const SkMatrix &, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint) override
void drawSprite(const SkBitmap &bitmap, int x, int y, const SkPaint &paint)
void drawImageRect(const SkImage *, const SkRect *src, const SkRect &dst, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint) override
void drawOval(const SkRect &oval, const SkPaint &paint) override
void drawPath(const SkPath &origpath, const SkPaint &paint, bool pathIsMutable) override
std::unique_ptr< SkPDFDict > makeResourceDict()
void drawAnnotation(const SkRect &, const char key[], SkData *value) override
sk_sp< SkPDFDevice > makeCongruentDevice()
sk_sp< SkSpecialImage > makeSpecial(const SkBitmap &) override
SkPDFIndirectReference currentPage() const
skia_private::THashMap< SkBitmapKey, SkPDFIndirectReference > fPDFBitmapMap
SkPDFIndirectReference emit(const SkPDFObject &, SkPDFIndirectReference)
void addNodeTitle(int nodeId, SkSpan< const char >)
const SkPDF::Metadata & metadata() const
const SkMatrix & currentPageTransform() const
std::vector< SkPDFNamedDestination > fNamedDestinations
SkPDFTagTree::Mark createMarkIdForNodeId(int nodeId, SkPoint)
std::vector< std::unique_ptr< SkPDFLink > > fCurrentPageLinks
SkPDFIndirectReference fNoSmaskGraphicState
bool hasCurrentPage() const
SkAdvancedTypefaceMetrics::FontType getType() const
static const SkAdvancedTypefaceMetrics * GetMetrics(const SkTypeface *typeface, SkPDFDocument *canon)
static SkPDFFont * GetFontResource(SkPDFDocument *doc, const SkGlyph *glyphs, SkTypeface *typeface)
static SkAdvancedTypefaceMetrics::FontType FontType(const SkTypeface &, const SkAdvancedTypefaceMetrics &)
static const std::vector< SkUnichar > & GetUnicodeMap(const SkTypeface *typeface, SkPDFDocument *canon)
static void RemoveColorFilter(SkPaint *, SkColorSpace *dstCS)
void setStyle(Style style)
void setColor(SkColor color)
SkPathEffect * getPathEffect() const
SkColorFilter * getColorFilter() const
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
@ kStrokeAndFill_Style
sets to stroke and fill geometry
void setColor4f(const SkColor4f &color, SkColorSpace *colorSpace=nullptr)
void setMaskFilter(sk_sp< SkMaskFilter > maskFilter)
SkMaskFilter * getMaskFilter() const
void setShader(sk_sp< SkShader > shader)
SkImageFilter * getImageFilter() const
bool isInverseFillType() const
static SkPath RRect(const SkRRect &, SkPathDirection dir=SkPathDirection::kCW)
static SkPath Rect(const SkRect &, SkPathDirection=SkPathDirection::kCW, unsigned startIndex=0)
SkPathFillType getFillType() const
void toggleInverseFillType()
const SkRect & getBounds() const
static SkPath Oval(const SkRect &, SkPathDirection=SkPathDirection::kCW)
void transform(const SkMatrix &matrix, SkPath *dst, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
SkPath makeTransform(const SkMatrix &m, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
constexpr bool empty() const
virtual bool isGaneshBacked() const
virtual bool isGraphiteBacked() const
static SkStrikeSpec MakePDFVector(const SkTypeface &typeface, int *size)
bool writeText(const char text[])
V * find(const K &key) const
SkSpan< const char > text() const
const SkFont & font() const
SkSpan< const SkGlyphID > glyphsIDs() const
SkSpan< const SkPoint > positions() const
EMSCRIPTEN_KEEPALIVE void empty()
static void mark(SkCanvas *canvas, SkScalar x, SkScalar y, Fn &&fn)
static float max(float r, float g, float b)
static float min(float r, float g, float b)
union flutter::testing::@2836::KeyboardChange::@76 content
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
SK_API sk_sp< SkImage > RasterFromPixmap(const SkPixmap &pixmap, RasterReleaseProc rasterReleaseProc, ReleaseContext releaseContext)
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
SkPDFIndirectReference GetGraphicStateForPaint(SkPDFDocument *, const SkPaint &)
SkPDFIndirectReference GetSMaskGraphicState(SkPDFIndirectReference sMask, bool invert, SkPDFSMaskMode sMaskMode, SkPDFDocument *doc)
void ApplyGraphicState(int objectIndex, SkWStream *content)
void WriteUInt8(SkWStream *wStream, uint8_t value)
const char * BlendModeName(SkBlendMode)
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 WriteUInt16BE(SkWStream *wStream, uint16_t value)
void AppendTransform(const SkMatrix &, SkWStream *)
SkMatrix GetShaderLocalMatrix(const SkShader *shader)
void ClosePath(SkWStream *content)
void StrokePath(SkWStream *content)
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
sk_sp< const SkImage > image
sk_sp< SkBlender > blender SkRect rect
SkSamplingOptions sampling
bool AsBitmap(const SkSpecialImage *img, SkBitmap *result)
sk_sp< SkSpecialImage > MakeFromRaster(const SkIRect &subset, const SkBitmap &bm, const SkSurfaceProps &props)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
SK_SPI SkUnichar NextUTF8(const char **ptr, const char *end)
def link(from_root, to_root)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
font
Font Metadata and Metrics.
SkSamplingOptions(SkFilterMode::kLinear))
SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst, const SkRect *cullRect, SkScalar resScale=1)
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
constexpr int32_t x() const
constexpr int32_t y() const
constexpr int32_t top() const
constexpr int32_t bottom() const
constexpr int32_t height() const
constexpr int32_t right() const
constexpr int32_t width() const
void outset(int32_t dx, int32_t dy)
constexpr int32_t left() const
static SkImageInfo MakeN32Premul(int width, int height)
SkColorSpace * colorSpace() const
SkISize dimensions() const
static SkImageInfo MakeUnknown()
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static SkImageInfo MakeA8(int width, int height)
static void FreeImage(void *image)
@ kComputeBoundsAndRenderImage_CreateMode
compute bounds, alloc image and render into it
uint8_t const *const fImage
void updateMatrix(const SkMatrix &matrix)
void updateDrawingState(const Entry &state)
SkDynamicMemoryWStream * fContentStream
void updateClip(const SkClipStack *clipStack, const SkIRect &bounds)
constexpr float y() const
constexpr float x() const
static SkRect Make(const SkISize &size)
SkScalar fBottom
larger y-axis bounds
constexpr float left() const
void inset(float dx, float dy)
constexpr float top() const
bool intersect(const SkRect &r)
SkScalar fLeft
smaller x-axis bounds
constexpr float x() const
constexpr float y() const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
bool intersects(const SkRect &r) const
void roundOut(SkIRect *dst) const
void offset(float dx, float dy)
constexpr float height() const
constexpr float right() const
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)
constexpr float bottom() const