2 * Copyright 2012 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkDWriteToPath_DEFINED
9 #define SkDWriteToPath_DEFINED
18 class SkDWriteGeometrySink : public IDWriteGeometrySink {
23 SkDWriteGeometrySink(const SkDWriteGeometrySink&);
24 SkDWriteGeometrySink& operator=(const SkDWriteGeometrySink&);
27 explicit SkDWriteGeometrySink(SkPath* path);
28 virtual ~SkDWriteGeometrySink();
31 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **object) override;
32 ULONG STDMETHODCALLTYPE AddRef(void) override;
33 ULONG STDMETHODCALLTYPE Release(void) override;
35 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;
43 static HRESULT Create(SkPath* path, IDWriteGeometrySink** geometryToPath);