aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PictureTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2016-12-09 09:00:50 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-09 14:33:41 +0000
commitc1f7774e8d327e3c98b4094c9c01d26e27013f71 (patch)
tree202eecd519054c880daa6995876abb5d42fdbc89 /tests/PictureTest.cpp
parent374e04acfa00da3c20a29d391b3e7305e37fbcfb (diff)
Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"
This reverts commit a129dfef2aaab0b5995cdf1ab7b2cdd41c29cf72. BUG=skia: Change-Id: I717de6e5fcd4516aa684b014b1414b0f82ac2b91 Reviewed-on: https://skia-review.googlesource.com/5722 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
Diffstat (limited to 'tests/PictureTest.cpp')
-rw-r--r--tests/PictureTest.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 8fdf92a8e8..d47165eaf2 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -287,7 +287,7 @@ static void test_gpu_veto(skiatest::Reporter* reporter) {
for (int i = 0; i < 50; ++i) {
canvas->clipPath(convexClip);
canvas->clipPath(concaveClip);
- canvas->clipPath(convexClip, SkCanvas::kIntersect_Op, true);
+ canvas->clipPath(convexClip, kIntersect_SkClipOp, true);
canvas->drawRect(SkRect::MakeWH(100, 100), SkPaint());
}
}
@@ -299,7 +299,7 @@ static void test_gpu_veto(skiatest::Reporter* reporter) {
{
const SkPath concaveClip = make_concave_path();
for (int i = 0; i < 50; ++i) {
- canvas->clipPath(concaveClip, SkCanvas::kIntersect_Op, true);
+ canvas->clipPath(concaveClip, kIntersect_SkClipOp, true);
canvas->drawRect(SkRect::MakeWH(100, 100), SkPaint());
}
}
@@ -398,7 +398,7 @@ static void create_imbalance(SkCanvas* canvas) {
SkRect clipRect = SkRect::MakeWH(2, 2);
SkRect drawRect = SkRect::MakeWH(10, 10);
canvas->save();
- canvas->clipRect(clipRect, SkCanvas::kReplace_Op);
+ canvas->clipRect(clipRect, kReplace_SkClipOp);
canvas->translate(1.0f, 1.0f);
SkPaint p;
p.setColor(SK_ColorGREEN);
@@ -664,7 +664,7 @@ static void test_clip_bound_opt(skiatest::Reporter* reporter) {
{
SkCanvas* canvas = recorder.beginRecording(10, 10);
canvas->clipPath(path);
- canvas->clipPath(invPath, SkCanvas::kUnion_Op);
+ canvas->clipPath(invPath, kUnion_SkClipOp);
bool nonEmpty = canvas->getClipDeviceBounds(&clipBounds);
REPORTER_ASSERT(reporter, true == nonEmpty);
REPORTER_ASSERT(reporter, 0 == clipBounds.fLeft);
@@ -674,7 +674,7 @@ static void test_clip_bound_opt(skiatest::Reporter* reporter) {
}
{
SkCanvas* canvas = recorder.beginRecording(10, 10);
- canvas->clipPath(path, SkCanvas::kDifference_Op);
+ canvas->clipPath(path, kDifference_SkClipOp);
bool nonEmpty = canvas->getClipDeviceBounds(&clipBounds);
REPORTER_ASSERT(reporter, true == nonEmpty);
REPORTER_ASSERT(reporter, 0 == clipBounds.fLeft);
@@ -684,7 +684,7 @@ static void test_clip_bound_opt(skiatest::Reporter* reporter) {
}
{
SkCanvas* canvas = recorder.beginRecording(10, 10);
- canvas->clipPath(path, SkCanvas::kReverseDifference_Op);
+ canvas->clipPath(path, kReverseDifference_SkClipOp);
bool nonEmpty = canvas->getClipDeviceBounds(&clipBounds);
// True clip is actually empty in this case, but the best
// determination we can make using only bounds as input is that the
@@ -697,8 +697,8 @@ static void test_clip_bound_opt(skiatest::Reporter* reporter) {
}
{
SkCanvas* canvas = recorder.beginRecording(10, 10);
- canvas->clipPath(path, SkCanvas::kIntersect_Op);
- canvas->clipPath(path2, SkCanvas::kXOR_Op);
+ canvas->clipPath(path, kIntersect_SkClipOp);
+ canvas->clipPath(path2, kXOR_SkClipOp);
bool nonEmpty = canvas->getClipDeviceBounds(&clipBounds);
REPORTER_ASSERT(reporter, true == nonEmpty);
REPORTER_ASSERT(reporter, 6 == clipBounds.fLeft);
@@ -746,22 +746,22 @@ public:
, fClipCount(0){
}
- void onClipRect(const SkRect& r, ClipOp op, ClipEdgeStyle edgeStyle) override {
+ void onClipRect(const SkRect& r, SkClipOp op, ClipEdgeStyle edgeStyle) override {
fClipCount += 1;
this->INHERITED::onClipRect(r, op, edgeStyle);
}
- void onClipRRect(const SkRRect& rrect, ClipOp op, ClipEdgeStyle edgeStyle)override {
+ void onClipRRect(const SkRRect& rrect, SkClipOp op, ClipEdgeStyle edgeStyle)override {
fClipCount += 1;
this->INHERITED::onClipRRect(rrect, op, edgeStyle);
}
- void onClipPath(const SkPath& path, ClipOp op, ClipEdgeStyle edgeStyle) override {
+ void onClipPath(const SkPath& path, SkClipOp op, ClipEdgeStyle edgeStyle) override {
fClipCount += 1;
this->INHERITED::onClipPath(path, op, edgeStyle);
}
- void onClipRegion(const SkRegion& deviceRgn, ClipOp op) override {
+ void onClipRegion(const SkRegion& deviceRgn, SkClipOp op) override {
fClipCount += 1;
this->INHERITED::onClipRegion(deviceRgn, op);
}
@@ -778,9 +778,9 @@ static void test_clip_expansion(skiatest::Reporter* reporter) {
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(10, 10);
- canvas->clipRect(SkRect::MakeEmpty(), SkCanvas::kReplace_Op);
+ canvas->clipRect(SkRect::MakeEmpty(), kReplace_SkClipOp);
// The following expanding clip should not be skipped.
- canvas->clipRect(SkRect::MakeXYWH(4, 4, 3, 3), SkCanvas::kUnion_Op);
+ canvas->clipRect(SkRect::MakeXYWH(4, 4, 3, 3), kUnion_SkClipOp);
// Draw something so the optimizer doesn't just fold the world.
SkPaint p;
p.setColor(SK_ColorBLUE);
@@ -1134,14 +1134,14 @@ DEF_TEST(PictureGpuAnalyzer, r) {
const SkPath convexClip = make_convex_path();
const SkPath concaveClip = make_concave_path();
for (int i = 0; i < 50; ++i) {
- analyzer.analyzeClipPath(convexClip, SkCanvas::kIntersect_Op, false);
- analyzer.analyzeClipPath(convexClip, SkCanvas::kIntersect_Op, true);
- analyzer.analyzeClipPath(concaveClip, SkCanvas::kIntersect_Op, false);
+ analyzer.analyzeClipPath(convexClip, kIntersect_SkClipOp, false);
+ analyzer.analyzeClipPath(convexClip, kIntersect_SkClipOp, true);
+ analyzer.analyzeClipPath(concaveClip, kIntersect_SkClipOp, false);
}
REPORTER_ASSERT(r, analyzer.suitableForGpuRasterization());
for (int i = 0; i < 50; ++i) {
- analyzer.analyzeClipPath(concaveClip, SkCanvas::kIntersect_Op, true);
+ analyzer.analyzeClipPath(concaveClip, kIntersect_SkClipOp, true);
}
REPORTER_ASSERT(r, !analyzer.suitableForGpuRasterization());
}