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 "SkGradientShader.h" | 8 #include "SkGradientShader.h" |
9 #include "SkSurface.h" | 9 #include "SkSurface.h" |
10 #include "gm.h" | 10 #include "gm.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 /** | 56 /** |
57 * This GM verifies that a transparent bitmap drawn over a | 57 * This GM verifies that a transparent bitmap drawn over a |
58 * checkerboard pattern looks correct. | 58 * checkerboard pattern looks correct. |
59 */ | 59 */ |
60 DEF_SIMPLE_GM(transparency_check, canvas, 1792, 1080) { | 60 DEF_SIMPLE_GM(transparency_check, canvas, 1792, 1080) { |
61 checkerboard(canvas, sk_tool_utils::color_to_565(0xFF999999), | 61 checkerboard(canvas, sk_tool_utils::color_to_565(0xFF999999), |
62 sk_tool_utils::color_to_565(0xFF666666), 8); | 62 sk_tool_utils::color_to_565(0xFF666666), 8); |
63 { | 63 { |
64 SkAutoCanvasRestore autoCanvasRestore(canvas, true); | 64 SkAutoCanvasRestore autoCanvasRestore(canvas, true); |
65 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(256, 9)); | 65 auto surface(SkSurface::MakeRasterN32Premul(256, 9)); |
66 make_transparency(surface->getCanvas(), 256.0f, 9.0f); | 66 make_transparency(surface->getCanvas(), 256.0f, 9.0f); |
67 canvas->scale(7.0f, 120.0f); | 67 canvas->scale(7.0f, 120.0f); |
68 surface->draw(canvas, 0, 0, nullptr); | 68 surface->draw(canvas, 0, 0, nullptr); |
69 } | 69 } |
70 } | 70 } |
OLD | NEW |