aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/strokefill.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-06-10 14:23:15 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-10 14:23:15 -0700
commit026beb52a29a620290fcfb24f1e7e9e75547b80f (patch)
tree42e589685254a3026b21ec1e28f285e00f4cdbb4 /gm/strokefill.cpp
parentde50d9b94291589edf349e7a0f2aac6ac523de7b (diff)
SkPath::Direction serves two masters:
- input param to addFoo (e.g. addRect), where only CW or CCW are valid) - output param from computing functions, that sometimes return kUnknown This CL's intent is to split these into distinct enums/features: - Direction (public) loses kUnknown, and is only used for input - FirstDirection (private) is used for computing the first direction we see when analyzing a contour BUG=skia: Review URL: https://codereview.chromium.org/1176953002
Diffstat (limited to 'gm/strokefill.cpp')
-rw-r--r--gm/strokefill.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/gm/strokefill.cpp b/gm/strokefill.cpp
index b6e888b047..04985485d9 100644
--- a/gm/strokefill.cpp
+++ b/gm/strokefill.cpp
@@ -7,7 +7,7 @@
#include "gm.h"
#include "SkCanvas.h"
-#include "SkPath.h"
+#include "SkPathPriv.h"
#include "SkTypeface.h"
namespace skiagm {
@@ -69,12 +69,12 @@ protected:
path2.reset();
path2.addCircle(x + SkIntToScalar(240), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCCW_Direction);
canvas->drawPath(path2, paint);
- SkASSERT(path2.cheapIsDirection(SkPath::kCCW_Direction));
+ SkASSERT(SkPathPriv::CheapIsFirstDirection(path2, SkPathPriv::kCCW_FirstDirection));
path2.reset();
- SkASSERT(!path2.cheapComputeDirection(NULL));
+ SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path2, NULL));
path2.addCircle(x + SkIntToScalar(360), y + SkIntToScalar(200), SkIntToScalar(50), SkPath::kCW_Direction);
- SkASSERT(path2.cheapIsDirection(SkPath::kCW_Direction));
+ SkASSERT(SkPathPriv::CheapIsFirstDirection(path2, SkPathPriv::kCW_FirstDirection));
canvas->drawPath(path2, paint);
SkRect r = SkRect::MakeXYWH(x - SkIntToScalar(50), y + SkIntToScalar(280),
@@ -98,18 +98,18 @@ protected:
r = SkRect::MakeXYWH(x + SkIntToScalar(190), y + SkIntToScalar(280),
SkIntToScalar(100), SkIntToScalar(100));
path4.reset();
- SkASSERT(!path4.cheapComputeDirection(NULL));
+ SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path4, NULL));
path4.addRect(r, SkPath::kCCW_Direction);
- SkASSERT(path4.cheapIsDirection(SkPath::kCCW_Direction));
+ SkASSERT(SkPathPriv::CheapIsFirstDirection(path4, SkPathPriv::kCCW_FirstDirection));
path4.moveTo(0, 0); // test for crbug.com/247770
canvas->drawPath(path4, paint);
r = SkRect::MakeXYWH(x + SkIntToScalar(310), y + SkIntToScalar(280),
SkIntToScalar(100), SkIntToScalar(100));
path4.reset();
- SkASSERT(!path4.cheapComputeDirection(NULL));
+ SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path4, NULL));
path4.addRect(r, SkPath::kCW_Direction);
- SkASSERT(path4.cheapIsDirection(SkPath::kCW_Direction));
+ SkASSERT(SkPathPriv::CheapIsFirstDirection(path4, SkPathPriv::kCW_FirstDirection));
path4.moveTo(0, 0); // test for crbug.com/247770
canvas->drawPath(path4, paint);
}