8#ifndef SkXPSDevice_DEFINED
9#define SkXPSDevice_DEFINED
13#ifdef SK_BUILD_FOR_WIN
16#include <XpsObjectModel.h>
45 SK_SPI ~SkXPSDevice()
override;
47 bool beginPortfolio(
SkWStream* outputStream, IXpsOMObjectFactory*);
71 const SkRect* mediaBox =
nullptr,
72 const SkRect* bleedBox =
nullptr,
73 const SkRect* artBox =
nullptr,
74 const SkRect* cropBox =
nullptr);
90 bool pathIsMutable =
false)
override;
107 SkTScopedComPtr<IXpsOMFontResource> xps,
size_t numGlyphs)
108 : typefaceId(
id), ttcIndex(index), fontData(
std::move(
data))
109 , xpsFont(
std::move(xps)), glyphsUsed(numGlyphs) {}
112 const std::unique_ptr<SkStream> fontData;
113 const SkTScopedComPtr<IXpsOMFontResource> xpsFont;
116 friend HRESULT subset_typeface(
const TypefaceUse& current);
120 bool createCanvasForLayer();
122 SkTScopedComPtr<IXpsOMObjectFactory> fXpsFactory;
123 SkTScopedComPtr<IStream> fOutputStream;
124 SkTScopedComPtr<IXpsOMPackageWriter> fPackageWriter;
126 unsigned int fCurrentPage;
127 SkTScopedComPtr<IXpsOMCanvas> fCurrentXpsCanvas;
128 SkSize fCurrentCanvasSize;
142 HRESULT createId(
wchar_t*
buffer,
size_t bufferSize,
wchar_t sep =
'-');
143#ifdef SK_XPS_USE_DETERMINISTIC_IDS
144 decltype(GUID::Data1) fNextId = 0;
147 HRESULT initXpsDocumentWriter(IXpsOMImageResource*
image);
149 HRESULT createXpsPage(
150 const XPS_SIZE& pageSize,
153 HRESULT createXpsThumbnail(
154 IXpsOMPage*
page,
const unsigned int pageNumber,
155 IXpsOMImageResource**
image);
157 void internalDrawRect(
162 HRESULT createXpsBrush(
164 IXpsOMBrush** xpsBrush,
165 const SkMatrix* parentTransform =
nullptr);
167 HRESULT createXpsSolidColorBrush(
169 IXpsOMBrush** xpsBrush);
171 HRESULT createXpsImageBrush(
176 IXpsOMTileBrush** xpsBrush);
178 HRESULT createXpsLinearGradient(
182 IXpsOMMatrixTransform* xpsMatrixToUse,
183 IXpsOMBrush** xpsBrush);
185 HRESULT createXpsRadialGradient(
189 IXpsOMMatrixTransform* xpsMatrixToUse,
190 IXpsOMBrush** xpsBrush);
192 HRESULT createXpsGradientStop(
195 IXpsOMGradientStop** xpsGradStop);
197 HRESULT createXpsTransform(
199 IXpsOMMatrixTransform ** xpsTransform);
201 HRESULT createXpsRect(
204 IXpsOMGeometryFigure** xpsRect);
206 HRESULT createXpsQuad(
209 IXpsOMGeometryFigure** xpsQuad);
211 HRESULT CreateTypefaceUse(
213 TypefaceUse** fontResource);
216 IXpsOMObjectFactory* xpsFactory,
217 IXpsOMCanvas* canvas,
218 const TypefaceUse*
font,
220 XPS_GLYPH_INDEX* xpsGlyphs,
224 XPS_STYLE_SIMULATION sims,
228 HRESULT addXpsPathGeometry(
229 IXpsOMGeometryFigureCollection* figures,
233 IXpsOMGeometryFigure* figure,
234 IXpsOMVisualCollection* visuals,
238 const SkRect& leftPoints,
const XPS_RECT&
left,
239 IXpsOMImageResource* imageResource,
240 IXpsOMVisualCollection* visuals);
242 HRESULT cornerOfClamp(
245 IXpsOMVisualCollection* visuals);
247 HRESULT
clip(IXpsOMVisual* xpsVisual);
250 IXpsOMVisual* xpsVisual,
252 XPS_FILL_RULE fillRule);
254 HRESULT drawInverseWindingPath(
256 IXpsOMPath* xpsPath);
259 IXpsOMPath* shadedPath,
273 IXpsOMPath* shadedPath);
276 SkXPSDevice(
const SkXPSDevice&);
277 void operator=(
const SkXPSDevice&);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static const int points[]
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
static bool left(const SkPoint &p0, const SkPoint &p1)
virtual sk_sp< SkDevice > createDevice(const CreateInfo &, const SkPaint *)
virtual void drawVertices(const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool skipColorXform=false)=0
virtual void drawRRect(const SkRRect &rr, const SkPaint &paint)=0
virtual void drawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint[], const SkPaint &paint)=0
virtual void drawDevice(SkDevice *, const SkSamplingOptions &, const SkPaint &)
virtual void onDrawGlyphRunList(SkCanvas *, const sktext::GlyphRunList &, const SkPaint &paint)=0
virtual void drawPaint(const SkPaint &paint)=0
virtual void drawMesh(const SkMesh &mesh, sk_sp< SkBlender >, const SkPaint &)=0
virtual void drawRect(const SkRect &r, const SkPaint &paint)=0
virtual void drawImageRect(const SkImage *, const SkRect *src, const SkRect &dst, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint)=0
virtual void drawPath(const SkPath &path, const SkPaint &paint, bool pathIsMutable=false)=0
virtual void drawOval(const SkRect &oval, const SkPaint &paint)=0
unsigned useCenter Optional< SkMatrix > matrix
sk_sp< const SkImage > image
clipPath(r.path, r.opAA.op(), r.opAA.aa())) DRAW(ClipRRect
sk_sp< SkBlender > blender SkRect rect
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.
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
std::shared_ptr< const fml::Mapping > data