blob: 30b337f8eb2ad4a86f4d31d186aa464c6a080820 [file] [log] [blame]
bungeman@google.come8f05922012-08-16 16:13:40 +00001/*
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 Kleinc0bd9f92019-04-23 12:05:21 -050011#include "include/core/SkTypes.h"
bungeman@google.come8f05922012-08-16 16:13:40 +000012
13class SkPath;
14
15#include <dwrite.h>
16#include <d2d1.h>
17
18class SkDWriteGeometrySink : public IDWriteGeometrySink {
19private:
20 LONG fRefCount;
21 SkPath* fPath;
22
23 SkDWriteGeometrySink(const SkDWriteGeometrySink&);
24 SkDWriteGeometrySink& operator=(const SkDWriteGeometrySink&);
25
26protected:
27 explicit SkDWriteGeometrySink(SkPath* path);
28 virtual ~SkDWriteGeometrySink();
29
30public:
mtklein36352bf2015-03-25 18:17:31 -070031 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **object) override;
32 ULONG STDMETHODCALLTYPE AddRef(void) override;
33 ULONG STDMETHODCALLTYPE Release(void) override;
bungeman@google.come8f05922012-08-16 16:13:40 +000034
mtklein36352bf2015-03-25 18:17:31 -070035 void STDMETHODCALLTYPE SetFillMode(D2D1_FILL_MODE fillMode) override;
36 void STDMETHODCALLTYPE SetSegmentFlags(D2D1_PATH_SEGMENT vertexFlags) override;
37 void STDMETHODCALLTYPE BeginFigure(D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN figureBegin) override;
38 void STDMETHODCALLTYPE AddLines(const D2D1_POINT_2F *points, UINT pointsCount) override;
39 void STDMETHODCALLTYPE AddBeziers(const D2D1_BEZIER_SEGMENT *beziers, UINT beziersCount) override;
40 void STDMETHODCALLTYPE EndFigure(D2D1_FIGURE_END figureEnd) override;
41 HRESULT STDMETHODCALLTYPE Close() override;
bungeman@google.come8f05922012-08-16 16:13:40 +000042
43 static HRESULT Create(SkPath* path, IDWriteGeometrySink** geometryToPath);
44};
45
46#endif