Flutter Engine
The Flutter Engine
SkSVGDevice.h
Go to the documentation of this file.
1/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkSVGDevice_DEFINED
9#define SkSVGDevice_DEFINED
10
18
19#include <cstddef>
20#include <cstdint>
21#include <memory>
22#include <type_traits>
23
24namespace sktext {
25class GlyphRunList;
26}
27
28class SkDevice;
29class SkBitmap;
30class SkBlender;
31class SkClipStack;
32class SkData;
33class SkImage;
34class SkMesh;
35class SkPaint;
36class SkPath;
37class SkRRect;
38class SkVertices;
39class SkXMLWriter;
40struct SkISize;
41struct SkPoint;
42struct SkRect;
44
45class SkSVGDevice final : public SkClipStackDevice {
46public:
47 static sk_sp<SkDevice> Make(const SkISize& size, std::unique_ptr<SkXMLWriter>, uint32_t flags);
48
49 void drawPaint(const SkPaint& paint) override;
50 void drawAnnotation(const SkRect& rect, const char key[], SkData* value) override;
52 const SkPoint[], const SkPaint& paint) override;
53 void drawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
54 const SkSamplingOptions&, const SkPaint& paint,
55 SkCanvas::SrcRectConstraint constraint) override;
56 void drawRect(const SkRect& r, const SkPaint& paint) override;
57 void drawOval(const SkRect& oval, const SkPaint& paint) override;
58 void drawRRect(const SkRRect& rr, const SkPaint& paint) override;
59 void drawPath(const SkPath& path,
60 const SkPaint& paint,
61 bool pathIsMutable = false) override;
62
63 void drawVertices(const SkVertices*, sk_sp<SkBlender>, const SkPaint&, bool) override;
64 void drawMesh(const SkMesh&, sk_sp<SkBlender>, const SkPaint&) override;
65
66private:
67 SkSVGDevice(const SkISize& size, std::unique_ptr<SkXMLWriter>, uint32_t);
68 ~SkSVGDevice() override;
69
70 void onDrawGlyphRunList(SkCanvas*, const sktext::GlyphRunList&, const SkPaint& paint) override;
71
72 struct MxCp;
73 void drawBitmapCommon(const MxCp&, const SkBitmap& bm, const SkPaint& paint);
74
75 void syncClipStack(const SkClipStack&);
76
77 SkParsePath::PathEncoding pathEncoding() const;
78
79 class AutoElement;
80 class ResourceBucket;
81
82 const std::unique_ptr<SkXMLWriter> fWriter;
83 const std::unique_ptr<ResourceBucket> fResourceBucket;
84 const uint32_t fFlags;
85
86 struct ClipRec {
87 std::unique_ptr<AutoElement> fClipPathElem;
88 uint32_t fGenID;
89
90 static_assert(::sk_is_trivially_relocatable<decltype(fClipPathElem)>::value);
91
92 using sk_is_trivially_relocatable = std::true_type;
93 };
94
95 std::unique_ptr<AutoElement> fRootElement;
97};
98
99#endif // SkSVGDevice_DEFINED
int count
Definition: FontMgrTest.cpp:50
uint16_t fFlags
Definition: ShapeLayer.cpp:106
SrcRectConstraint
Definition: SkCanvas.h:1541
Definition: SkData.h:25
SkISize size() const
Definition: SkDevice.h:126
Definition: SkMesh.h:263
Definition: SkPath.h:59
void drawOval(const SkRect &oval, const SkPaint &paint) override
void drawPath(const SkPath &path, const SkPaint &paint, bool pathIsMutable=false) override
void drawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint[], const SkPaint &paint) override
void drawPaint(const SkPaint &paint) override
static sk_sp< SkDevice > Make(const SkISize &size, std::unique_ptr< SkXMLWriter >, uint32_t flags)
void drawVertices(const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool) override
void drawAnnotation(const SkRect &rect, const char key[], SkData *value) override
void drawRRect(const SkRRect &rr, const SkPaint &paint) override
void drawImageRect(const SkImage *image, const SkRect *src, const SkRect &dst, const SkSamplingOptions &, const SkPaint &paint, SkCanvas::SrcRectConstraint constraint) override
void drawMesh(const SkMesh &, sk_sp< SkBlender >, const SkPaint &) override
void drawRect(const SkRect &r, const SkPaint &paint) override
const Paint & paint
Definition: color_source.cc:38
FlutterSemanticsFlag flags
uint8_t value
sk_sp< const SkImage > image
Definition: SkRecords.h:269
SkRect oval
Definition: SkRecords.h:249
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
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
Definition: switches.h:57
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
Definition: switches.h:228
dst
Definition: cp.py:12
Definition: SkSize.h:16