bungeman@google.com | e8f0592 | 2012-08-16 16:13:40 +0000 | [diff] [blame] | 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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/core/SkTypes.h" |
Ben Wagner | 6cb6a07 | 2019-08-12 18:30:27 -0400 | [diff] [blame] | 12 | #include "src/utils/win/SkObjBase.h" |
bungeman@google.com | e8f0592 | 2012-08-16 16:13:40 +0000 | [diff] [blame] | 13 | |
| 14 | class SkPath; |
| 15 | |
| 16 | #include <dwrite.h> |
| 17 | #include <d2d1.h> |
| 18 | |
| 19 | class SkDWriteGeometrySink : public IDWriteGeometrySink { |
| 20 | private: |
| 21 | LONG fRefCount; |
| 22 | SkPath* fPath; |
| 23 | |
bungeman@google.com | e8f0592 | 2012-08-16 16:13:40 +0000 | [diff] [blame] | 24 | protected: |
| 25 | explicit SkDWriteGeometrySink(SkPath* path); |
| 26 | virtual ~SkDWriteGeometrySink(); |
| 27 | |
| 28 | public: |
Ben Wagner | 6cb6a07 | 2019-08-12 18:30:27 -0400 | [diff] [blame] | 29 | SK_STDMETHODIMP QueryInterface(REFIID iid, void **object) override; |
| 30 | SK_STDMETHODIMP_(ULONG) AddRef() override; |
| 31 | SK_STDMETHODIMP_(ULONG) Release() override; |
bungeman@google.com | e8f0592 | 2012-08-16 16:13:40 +0000 | [diff] [blame] | 32 | |
Ben Wagner | 6cb6a07 | 2019-08-12 18:30:27 -0400 | [diff] [blame] | 33 | SK_STDMETHODIMP_(void) SetFillMode(D2D1_FILL_MODE fillMode) override; |
| 34 | SK_STDMETHODIMP_(void) SetSegmentFlags(D2D1_PATH_SEGMENT vertexFlags) override; |
| 35 | SK_STDMETHODIMP_(void) BeginFigure(D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN figureBegin) override; |
| 36 | SK_STDMETHODIMP_(void) AddLines(const D2D1_POINT_2F *points, UINT pointsCount) override; |
| 37 | SK_STDMETHODIMP_(void) AddBeziers(const D2D1_BEZIER_SEGMENT *beziers, UINT beziersCount) override; |
| 38 | SK_STDMETHODIMP_(void) EndFigure(D2D1_FIGURE_END figureEnd) override; |
| 39 | SK_STDMETHODIMP Close() override; |
bungeman@google.com | e8f0592 | 2012-08-16 16:13:40 +0000 | [diff] [blame] | 40 | |
| 41 | static HRESULT Create(SkPath* path, IDWriteGeometrySink** geometryToPath); |
| 42 | }; |
| 43 | |
| 44 | #endif |