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

Side by Side Diff: tests/PictureBBHTest.cpp

Issue 777643003: use ClipOp instead of SkRegion for clipping (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « tests/DeferredCanvasTest.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkBBoxHierarchy.h" 9 #include "SkBBoxHierarchy.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // Test to verify the playback of a picture into a canvas that has 76 // Test to verify the playback of a picture into a canvas that has
77 // an empty clip. 77 // an empty clip.
78 // 78 //
79 class EmptyClipPictureBBHTest : public PictureBBHTestBase { 79 class EmptyClipPictureBBHTest : public PictureBBHTestBase {
80 public: 80 public:
81 EmptyClipPictureBBHTest() 81 EmptyClipPictureBBHTest()
82 : PictureBBHTestBase(2, 2, 3, 3) { } 82 : PictureBBHTestBase(2, 2, 3, 3) { }
83 83
84 virtual void doTest(SkCanvas& playbackCanvas, SkCanvas& recordingCanvas) SK_ OVERRIDE { 84 virtual void doTest(SkCanvas& playbackCanvas, SkCanvas& recordingCanvas) SK_ OVERRIDE {
85 // intersect with out of bounds rect -> empty clip. 85 // intersect with out of bounds rect -> empty clip.
86 playbackCanvas.clipRect(SkRect::MakeXYWH(SkIntToScalar(10), SkIntToScala r(10), 86 playbackCanvas.clipRect(SkRect::MakeXYWH(10, 10, 1, 1));
87 SkIntToScalar(1), SkIntToScalar(1)), SkRegion::kIntersect_Op);
88 SkPaint paint; 87 SkPaint paint;
89 recordingCanvas.drawRect(SkRect::MakeXYWH(SkIntToScalar(0), SkIntToScala r(0), 88 recordingCanvas.drawRect(SkRect::MakeWH(3, 3), paint);
90 SkIntToScalar(3), SkIntToScalar(3)), paint);
91 } 89 }
92 90
93 virtual ~EmptyClipPictureBBHTest() { } 91 virtual ~EmptyClipPictureBBHTest() { }
94 }; 92 };
95 93
96 DEF_TEST(PictureBBH, reporter) { 94 DEF_TEST(PictureBBH, reporter) {
97 95
98 DrawEmptyPictureBBHTest emptyPictureTest; 96 DrawEmptyPictureBBHTest emptyPictureTest;
99 emptyPictureTest.run(reporter); 97 emptyPictureTest.run(reporter);
100 98
(...skipping 24 matching lines...) Expand all
125 DEF_TEST(PictureBBH_Clear, r) { 123 DEF_TEST(PictureBBH_Clear, r) {
126 test_clear(r, NULL); 124 test_clear(r, NULL);
127 125
128 SkTileGridFactory::TileGridInfo grid = { {1,1}, {0,0}, {0,0} }; 126 SkTileGridFactory::TileGridInfo grid = { {1,1}, {0,0}, {0,0} };
129 SkTileGridFactory tilegrid(grid); 127 SkTileGridFactory tilegrid(grid);
130 test_clear(r, &tilegrid); 128 test_clear(r, &tilegrid);
131 129
132 SkRTreeFactory rtree; 130 SkRTreeFactory rtree;
133 test_clear(r, &rtree); 131 test_clear(r, &rtree);
134 } 132 }
OLDNEW
« no previous file with comments | « tests/DeferredCanvasTest.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698