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

Side by Side Diff: tests/PictureBBHTest.cpp

Issue 2355483002: abstract name of clipping ops, to transtion to a more restricted set (Closed)
Patch Set: no need for ifdef for globals Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « tests/GrShapeTest.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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // Test to verify the playback of a picture into a canvas that has 68 // Test to verify the playback of a picture into a canvas that has
69 // an empty clip. 69 // an empty clip.
70 // 70 //
71 class EmptyClipPictureBBHTest : public PictureBBHTestBase { 71 class EmptyClipPictureBBHTest : public PictureBBHTestBase {
72 public: 72 public:
73 EmptyClipPictureBBHTest() 73 EmptyClipPictureBBHTest()
74 : PictureBBHTestBase(2, 2, 3, 3) { } 74 : PictureBBHTestBase(2, 2, 3, 3) { }
75 75
76 void doTest(SkCanvas& playbackCanvas, SkCanvas& recordingCanvas) override { 76 void doTest(SkCanvas& playbackCanvas, SkCanvas& recordingCanvas) override {
77 // intersect with out of bounds rect -> empty clip. 77 // intersect with out of bounds rect -> empty clip.
78 playbackCanvas.clipRect(SkRect::MakeXYWH(SkIntToScalar(10), SkIntToScala r(10), 78 playbackCanvas.clipRect(SkRect::MakeXYWH(10, 10, 1, 1));
79 SkIntToScalar(1), SkIntToScalar(1)), SkRegion::kIntersect_Op);
80 SkPaint paint; 79 SkPaint paint;
81 recordingCanvas.drawRect(SkRect::MakeXYWH(SkIntToScalar(0), SkIntToScala r(0), 80 recordingCanvas.drawRect(SkRect::MakeWH(3, 3), paint);
82 SkIntToScalar(3), SkIntToScalar(3)), paint);
83 } 81 }
84 82
85 virtual ~EmptyClipPictureBBHTest() { } 83 virtual ~EmptyClipPictureBBHTest() { }
86 }; 84 };
87 85
88 DEF_TEST(PictureBBH, reporter) { 86 DEF_TEST(PictureBBH, reporter) {
89 87
90 DrawEmptyPictureBBHTest emptyPictureTest; 88 DrawEmptyPictureBBHTest emptyPictureTest;
91 emptyPictureTest.run(reporter); 89 emptyPictureTest.run(reporter);
92 90
93 EmptyClipPictureBBHTest emptyClipPictureTest; 91 EmptyClipPictureBBHTest emptyClipPictureTest;
94 emptyClipPictureTest.run(reporter); 92 emptyClipPictureTest.run(reporter);
95 } 93 }
OLDNEW
« no previous file with comments | « tests/GrShapeTest.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698