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 "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
11 #include "SkPictureRecorder.h" | 11 #include "SkPictureRecorder.h" |
12 #include "SkTableColorFilter.h" | 12 #include "SkTableColorFilter.h" |
13 #include "SkColorFilterImageFilter.h" | 13 #include "SkColorFilterImageFilter.h" |
14 #include "SkPictureImageFilter.h" | 14 #include "SkPictureImageFilter.h" |
15 | 15 |
16 static const int kTestRectSize = 50; | 16 constexpr int kTestRectSize = 50; |
17 static const int kDetectorGreenValue = 50; | 17 constexpr int kDetectorGreenValue = 50; |
18 | 18 |
19 // Below are few functions to install "detector" color filters. The filter is th
ere to assert that | 19 // Below are few functions to install "detector" color filters. The filter is th
ere to assert that |
20 // the color value it sees is the expected. It will trigger only with kDetectorG
reenValue, and | 20 // the color value it sees is the expected. It will trigger only with kDetectorG
reenValue, and |
21 // turn that value into full green. The idea is that if an optimization incorrec
tly changes | 21 // turn that value into full green. The idea is that if an optimization incorrec
tly changes |
22 // kDetectorGreenValue and then the incorrect value is observable by some part o
f the drawing | 22 // kDetectorGreenValue and then the incorrect value is observable by some part o
f the drawing |
23 // pipeline, that pixel will remain empty. | 23 // pipeline, that pixel will remain empty. |
24 | 24 |
25 static sk_sp<SkColorFilter> make_detector_color_filter() { | 25 static sk_sp<SkColorFilter> make_detector_color_filter() { |
26 uint8_t tableA[256] = { 0, }; | 26 uint8_t tableA[256] = { 0, }; |
27 uint8_t tableR[256] = { 0, }; | 27 uint8_t tableR[256] = { 0, }; |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 canvas->flush(); | 207 canvas->flush(); |
208 } | 208 } |
209 | 209 |
210 canvas->restore(); | 210 canvas->restore(); |
211 canvas->translate(SkIntToScalar(0), SkIntToScalar(kTestRectSize)
+ SkIntToScalar(1)); | 211 canvas->translate(SkIntToScalar(0), SkIntToScalar(kTestRectSize)
+ SkIntToScalar(1)); |
212 } | 212 } |
213 | 213 |
214 } | 214 } |
215 } | 215 } |
216 } | 216 } |
OLD | NEW |