aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PictureTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2016-12-08 16:06:37 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-08 21:45:27 +0000
commit8e7432b7f98dd592e529a0c8bb038d73ebfb0478 (patch)
treed3eb65dacc074a58eedfb0d430f969e2e3336774 /tests/PictureTest.cpp
parent6a4cdb6ba9ff5aa03186b7fa287f8e4d08be4578 (diff)
remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS
switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone BUG=skia: Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d Reviewed-on: https://skia-review.googlesource.com/5714 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@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());
}