aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PictureBBHTest.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-01-05 07:02:45 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-05 07:02:45 -0800
commit49aabde6ef80e39f00a2d00487cf5a881987dd81 (patch)
treea8ed88cafe2326029145188798d7a41a79105fc8 /tests/PictureBBHTest.cpp
parent5f2ee72f975d8172a65808af7fc4985b40b7ca28 (diff)
Clean up dead clear() code in SkRecord.
This removes the SkRecords::Clear struct and everything that refers to it. Notice there is nothing actually creating a Clear, which means this is all dead code. Now that all ops obey the clip, I don't think we need the weird inflate-empty-to-epsilon hack for BBH queries. BUG=skia: Review URL: https://codereview.chromium.org/835813002
Diffstat (limited to 'tests/PictureBBHTest.cpp')
-rw-r--r--tests/PictureBBHTest.cpp36
1 files changed, 2 insertions, 34 deletions
diff --git a/tests/PictureBBHTest.cpp b/tests/PictureBBHTest.cpp
index 562d9b5991..ac16dbbc71 100644
--- a/tests/PictureBBHTest.cpp
+++ b/tests/PictureBBHTest.cpp
@@ -63,7 +63,7 @@ private:
};
// Test to verify the playback of an empty picture
-//
+//
class DrawEmptyPictureBBHTest : public PictureBBHTestBase {
public:
DrawEmptyPictureBBHTest()
@@ -78,7 +78,7 @@ public:
//
class EmptyClipPictureBBHTest : public PictureBBHTestBase {
public:
- EmptyClipPictureBBHTest()
+ EmptyClipPictureBBHTest()
: PictureBBHTestBase(2, 2, 3, 3) { }
virtual void doTest(SkCanvas& playbackCanvas, SkCanvas& recordingCanvas) SK_OVERRIDE {
@@ -101,35 +101,3 @@ DEF_TEST(PictureBBH, reporter) {
EmptyClipPictureBBHTest emptyClipPictureTest;
emptyClipPictureTest.run(reporter);
}
-
-static void test_clear(skiatest::Reporter* r, SkBBHFactory* factory) {
- // SkPicture should always call clear()s on the target canvas, even if its clip is empty.
- SkPictureRecorder src, dst;
-
- // A picture that's just clear().
- src.beginRecording(1,1, factory)
- ->clear(SK_ColorGREEN);
- SkAutoTUnref<SkPicture> srcPic(src.endRecording());
-
- // A target canvas with an empty clip.
- SkCanvas* c = dst.beginRecording(1,1, NULL);
- c->clipRect(SkRect::MakeEmpty());
- srcPic->playback(c);
- SkAutoTUnref<SkPicture> dstPic(dst.endRecording());
-
- // Should be Clip - Save - Clear - Restore.
- // Buggy implementations might return 1 (just Clip) or 3 (Clip - Save - Restore).
- // TODO: can we just search that it contains "clear"? <reed>
- REPORTER_ASSERT(r, dstPic->approximateOpCount() == 4 || dstPic->approximateOpCount() == 2);
-}
-
-DEF_TEST(PictureBBH_Clear, r) {
- test_clear(r, NULL);
-
- SkTileGridFactory::TileGridInfo grid = { {1,1}, {0,0}, {0,0} };
- SkTileGridFactory tilegrid(grid);
- test_clear(r, &tilegrid);
-
- SkRTreeFactory rtree;
- test_clear(r, &rtree);
-}