OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
9 #include "SkSurface.h" | 9 #include "SkSurface.h" |
10 #include "Resources.h" | 10 #include "Resources.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 for (int x = 0; x < bm->width(); x++) { | 259 for (int x = 0; x < bm->width(); x++) { |
260 *pm.writable_addr32(x, y) = make_pixel(x, y, alphaType); | 260 *pm.writable_addr32(x, y) = make_pixel(x, y, alphaType); |
261 } | 261 } |
262 } | 262 } |
263 } | 263 } |
264 | 264 |
265 DEF_SIMPLE_GM(all_variants_8888, canvas, 4 * SCALE + 30, 2 * SCALE + 10) { | 265 DEF_SIMPLE_GM(all_variants_8888, canvas, 4 * SCALE + 30, 2 * SCALE + 10) { |
266 sk_tool_utils::draw_checkerboard(canvas, SK_ColorLTGRAY, SK_ColorWHITE, 8); | 266 sk_tool_utils::draw_checkerboard(canvas, SK_ColorLTGRAY, SK_ColorWHITE, 8); |
267 | 267 |
268 sk_sp<SkColorSpace> colorSpaces[] { | 268 sk_sp<SkColorSpace> colorSpaces[] { |
| 269 SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named), |
269 nullptr, | 270 nullptr, |
270 SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) | |
271 }; | 271 }; |
272 for (auto colorSpace : colorSpaces) { | 272 for (auto colorSpace : colorSpaces) { |
273 canvas->save(); | 273 canvas->save(); |
274 for (auto alphaType : {kPremul_SkAlphaType, kUnpremul_SkAlphaType}) { | 274 for (auto alphaType : {kPremul_SkAlphaType, kUnpremul_SkAlphaType}) { |
275 canvas->save(); | 275 canvas->save(); |
276 for (auto colorType : {kRGBA_8888_SkColorType, kBGRA_8888_SkColorTyp
e}) { | 276 for (auto colorType : {kRGBA_8888_SkColorType, kBGRA_8888_SkColorTyp
e}) { |
277 SkBitmap bm; | 277 SkBitmap bm; |
278 make_color_test_bitmap_variant(colorType, alphaType, colorSpace,
&bm); | 278 make_color_test_bitmap_variant(colorType, alphaType, colorSpace,
&bm); |
279 canvas->drawBitmap(bm, 0.0f, 0.0f); | 279 canvas->drawBitmap(bm, 0.0f, 0.0f); |
280 canvas->translate(SCALE + 10, 0.0f); | 280 canvas->translate(SCALE + 10, 0.0f); |
281 } | 281 } |
282 canvas->restore(); | 282 canvas->restore(); |
283 canvas->translate(0.0f, SCALE + 10); | 283 canvas->translate(0.0f, SCALE + 10); |
284 } | 284 } |
285 canvas->restore(); | 285 canvas->restore(); |
286 canvas->translate(2 * (SCALE + 10), 0.0f); | 286 canvas->translate(2 * (SCALE + 10), 0.0f); |
287 } | 287 } |
288 } | 288 } |
OLD | NEW |