9#if defined(SK_BUILD_FOR_WIN)
25 if (
nullptr ==
object) {
28 if (iid == __uuidof(IUnknown) || iid == __uuidof(IDWriteGeometrySink)) {
29 *
object =
static_cast<IDWriteGeometrySink*
>(
this);
39 return static_cast<ULONG>(InterlockedIncrement(&fRefCount));
43 ULONG res =
static_cast<ULONG>(InterlockedDecrement(&fRefCount));
50SK_STDMETHODIMP_(
void) SkDWriteGeometrySink::SetFillMode(D2D1_FILL_MODE fillMode) {
52 case D2D1_FILL_MODE_ALTERNATE:
55 case D2D1_FILL_MODE_WINDING:
64SK_STDMETHODIMP_(
void) SkDWriteGeometrySink::SetSegmentFlags(D2D1_PATH_SEGMENT vertexFlags) {
65 if (vertexFlags == D2D1_PATH_SEGMENT_NONE || vertexFlags == D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN) {
70SK_STDMETHODIMP_(
void) SkDWriteGeometrySink::BeginFigure(D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN figureBegin) {
71 if (figureBegin == D2D1_FIGURE_BEGIN_HOLLOW) {
75 fCurrent = startPoint;
80 if (this->currentIsNot(*
points)) {
89 return lhs.AlmostEquals(rhs);
100 float midX =
cubic[0].x + dx10 * 3 / 2;
108 float midY =
cubic[0].y + dy10 * 3 / 2;
112 quadraticP1 = {midX, midY};
116SK_STDMETHODIMP_(
void) SkDWriteGeometrySink::AddBeziers(
const D2D1_BEZIER_SEGMENT *beziers,
UINT beziersCount) {
117 for (
const D2D1_BEZIER_SEGMENT *
end = &beziers[beziersCount]; beziers <
end; ++beziers) {
118 if (this->currentIsNot(beziers->point1) ||
119 this->currentIsNot(beziers->point2) ||
120 this->currentIsNot(beziers->point3))
122 Cubic
cubic = { { fCurrent.x, fCurrent.y },
123 { beziers->point1.x, beziers->point1.y },
124 { beziers->point2.x, beziers->point2.y },
125 { beziers->point3.x, beziers->point3.y }, };
126 this->goingTo(beziers->point3);
129 fPath->
quadTo( quadraticP1.x, quadraticP1.y,
130 beziers->point3.x, beziers->point3.y);
132 fPath->
cubicTo(beziers->point1.x, beziers->point1.y,
133 beziers->point2.x, beziers->point2.y,
134 beziers->point3.x, beziers->point3.y);
140SK_STDMETHODIMP_(
void) SkDWriteGeometrySink::EndFigure(D2D1_FIGURE_END figureEnd) {
static const int points[]
#define SkDEBUGFAIL(message)
#define SK_STDMETHODIMP_(type)
bool approximately_equal(double x, double y)
static int check_quadratic(const SkDCubic &cubic, SkDCubic &reduction)
SkDWriteGeometrySink(SkPath *path)
static HRESULT Create(SkPath *path, IDWriteGeometrySink **geometryToPath)
SK_STDMETHODIMP Close() override
SK_STDMETHODIMP QueryInterface(REFIID iid, void **object) override
virtual ~SkDWriteGeometrySink()
void setFillType(SkPathFillType ft)
SkPath & lineTo(SkScalar x, SkScalar y)
SkPath & quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
SkPath & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
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