Flutter Engine
The Flutter Engine
SkDWriteGeometrySink.h
Go to the documentation of this file.
1/*
2 * Copyright 2012 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 SkDWriteToPath_DEFINED
9#define SkDWriteToPath_DEFINED
10
13
14class SkPath;
15
16#include <dwrite.h>
17#include <d2d1.h>
18
19class SkDWriteGeometrySink : public IDWriteGeometrySink {
20private:
21 LONG fRefCount;
22 SkPath* fPath;
23 bool fStarted;
24 D2D1_POINT_2F fCurrent;
25
26 void goingTo(const D2D1_POINT_2F pt) {
27 if (!fStarted) {
28 fStarted = true;
29 fPath->moveTo(fCurrent.x, fCurrent.y);
30 }
31 fCurrent = pt;
32 }
33
34 bool currentIsNot(const D2D1_POINT_2F pt) {
35 return fCurrent.x != pt.x || fCurrent.y != pt.y;
36 }
37
38protected:
41
42public:
43 SK_STDMETHODIMP QueryInterface(REFIID iid, void **object) override;
44 SK_STDMETHODIMP_(ULONG) AddRef() override;
45 SK_STDMETHODIMP_(ULONG) Release() override;
46
47 SK_STDMETHODIMP_(void) SetFillMode(D2D1_FILL_MODE fillMode) override;
48 SK_STDMETHODIMP_(void) SetSegmentFlags(D2D1_PATH_SEGMENT vertexFlags) override;
49 SK_STDMETHODIMP_(void) BeginFigure(D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN figureBegin) override;
50 SK_STDMETHODIMP_(void) AddLines(const D2D1_POINT_2F *points, UINT pointsCount) override;
51 SK_STDMETHODIMP_(void) AddBeziers(const D2D1_BEZIER_SEGMENT *beziers, UINT beziersCount) override;
52 SK_STDMETHODIMP_(void) EndFigure(D2D1_FIGURE_END figureEnd) override;
54
55 static HRESULT Create(SkPath* path, IDWriteGeometrySink** geometryToPath);
56};
57
58#endif
SkPath fPath
static const int points[]
#define SK_STDMETHODIMP
Definition: SkObjBase.h:22
SK_STDMETHODIMP_(ULONG) AddRef() override
SK_STDMETHODIMP_(void) EndFigure(D2D1_FIGURE_END figureEnd) override
SkDWriteGeometrySink(SkPath *path)
SK_STDMETHODIMP_(void) SetSegmentFlags(D2D1_PATH_SEGMENT vertexFlags) override
SK_STDMETHODIMP_(void) SetFillMode(D2D1_FILL_MODE fillMode) override
static HRESULT Create(SkPath *path, IDWriteGeometrySink **geometryToPath)
SK_STDMETHODIMP_(ULONG) Release() override
SK_STDMETHODIMP Close() override
SK_STDMETHODIMP QueryInterface(REFIID iid, void **object) override
virtual ~SkDWriteGeometrySink()
Definition: SkPath.h:59
SkPath & moveTo(SkScalar x, SkScalar y)
Definition: SkPath.cpp:688
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
long LONG
Definition: windows_types.h:23
unsigned int UINT
Definition: windows_types.h:32
DWORD ULONG
Definition: windows_types.h:40