Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: tests/PictureBBHTest.cpp

Issue 835813002: Clean up dead clear() code in SkRecord. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clearer? Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRecords.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PictureBBHTest.cpp
diff --git a/tests/PictureBBHTest.cpp b/tests/PictureBBHTest.cpp
index 562d9b59913026fc66e41c0e92b63b862085819b..ac16dbbc71cc85e259f88ba4b05139d3b9b3e45b 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);
-}
« no previous file with comments | « src/core/SkRecords.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698