| 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" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // incorrect if the alpha is folded or folded incorrectly. These test the ob
servable state | 173 // incorrect if the alpha is folded or folded incorrectly. These test the ob
servable state |
| 174 // throughout the pixel pipeline, and thus may turn off the optimizations (t
his is why we | 174 // throughout the pixel pipeline, and thus may turn off the optimizations (t
his is why we |
| 175 // trigger the optimizations above). | 175 // trigger the optimizations above). |
| 176 | 176 |
| 177 // Draws two green rects side by side: one is without the optimization, the
other is with | 177 // Draws two green rects side by side: one is without the optimization, the
other is with |
| 178 // the possibility that optimization is applied. | 178 // the possibility that optimization is applied. |
| 179 // At the end, draws the same patterns in translucent black. This tests that
the detectors | 179 // At the end, draws the same patterns in translucent black. This tests that
the detectors |
| 180 // work, eg. that if the value the detector sees is wrong, the resulting ima
ge shows this. | 180 // work, eg. that if the value the detector sees is wrong, the resulting ima
ge shows this. |
| 181 SkColor shapeColors[] = { | 181 SkColor shapeColors[] = { |
| 182 SkColorSetARGB(255, 0, kDetectorGreenValue, 0), | 182 SkColorSetARGB(255, 0, kDetectorGreenValue, 0), |
| 183 SkColorSetARGB(255, 0, kDetectorGreenValue + 1, 0) // This tests that de
tectors work. | 183 SkColorSetARGB(255, 0, (kDetectorGreenValue + 1), 0) // This tests that
detectors work. |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 InstallDetectorFunc detectorInstallFuncs[] = { | 186 InstallDetectorFunc detectorInstallFuncs[] = { |
| 187 install_detector_image_filter, | 187 install_detector_image_filter, |
| 188 install_detector_color_filter | 188 install_detector_color_filter |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 for (size_t i = 0; i < SK_ARRAY_COUNT(shapeColors); ++i) { | 191 for (size_t i = 0; i < SK_ARRAY_COUNT(shapeColors); ++i) { |
| 192 shapeColor = shapeColors[i]; | 192 shapeColor = shapeColors[i]; |
| 193 for (size_t j = 0; j < SK_ARRAY_COUNT(shapeColors); ++j) { | 193 for (size_t j = 0; j < SK_ARRAY_COUNT(shapeColors); ++j) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 209 } | 209 } |
| 210 | 210 |
| 211 canvas->restore(); | 211 canvas->restore(); |
| 212 canvas->translate(SkIntToScalar(0), SkIntToScalar(kTestRectSize)
+ SkIntToScalar(1)); | 212 canvas->translate(SkIntToScalar(0), SkIntToScalar(kTestRectSize)
+ SkIntToScalar(1)); |
| 213 } | 213 } |
| 214 | 214 |
| 215 } | 215 } |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| OLD | NEW |