OLD | NEW |
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 11 matching lines...) Expand all Loading... |
22 fPictureWidth = recordWidth; | 22 fPictureWidth = recordWidth; |
23 fPictureHeight = recordHeight; | 23 fPictureHeight = recordHeight; |
24 } | 24 } |
25 | 25 |
26 virtual ~PictureBBHTestBase() { } | 26 virtual ~PictureBBHTestBase() { } |
27 | 27 |
28 virtual void doTest(SkCanvas& playbackCanvas, SkCanvas& recordingCanvas) = 0
; | 28 virtual void doTest(SkCanvas& playbackCanvas, SkCanvas& recordingCanvas) = 0
; |
29 | 29 |
30 void run(skiatest::Reporter* reporter) { | 30 void run(skiatest::Reporter* reporter) { |
31 // No BBH | 31 // No BBH |
32 this->run(NULL, reporter); | 32 this->run(nullptr, reporter); |
33 | 33 |
34 // With an R-Tree | 34 // With an R-Tree |
35 SkRTreeFactory RTreeFactory; | 35 SkRTreeFactory RTreeFactory; |
36 this->run(&RTreeFactory, reporter); | 36 this->run(&RTreeFactory, reporter); |
37 } | 37 } |
38 | 38 |
39 private: | 39 private: |
40 void run(SkBBHFactory* factory, skiatest::Reporter* reporter) { | 40 void run(SkBBHFactory* factory, skiatest::Reporter* reporter) { |
41 SkCanvas playbackCanvas(fResultBitmap); | 41 SkCanvas playbackCanvas(fResultBitmap); |
42 playbackCanvas.clear(SK_ColorGREEN); | 42 playbackCanvas.clear(SK_ColorGREEN); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 }; | 86 }; |
87 | 87 |
88 DEF_TEST(PictureBBH, reporter) { | 88 DEF_TEST(PictureBBH, reporter) { |
89 | 89 |
90 DrawEmptyPictureBBHTest emptyPictureTest; | 90 DrawEmptyPictureBBHTest emptyPictureTest; |
91 emptyPictureTest.run(reporter); | 91 emptyPictureTest.run(reporter); |
92 | 92 |
93 EmptyClipPictureBBHTest emptyClipPictureTest; | 93 EmptyClipPictureBBHTest emptyClipPictureTest; |
94 emptyClipPictureTest.run(reporter); | 94 emptyClipPictureTest.run(reporter); |
95 } | 95 } |
OLD | NEW |