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 "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
9 #include "sk_tool_utils_flags.h" | 9 #include "sk_tool_utils_flags.h" |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 bm.eraseColor(c1); | 66 bm.eraseColor(c1); |
67 bm.eraseArea(SkIRect::MakeLTRB(0, 0, size, size), c2); | 67 bm.eraseArea(SkIRect::MakeLTRB(0, 0, size, size), c2); |
68 bm.eraseArea(SkIRect::MakeLTRB(size, size, 2 * size, 2 * size), c2); | 68 bm.eraseArea(SkIRect::MakeLTRB(size, size, 2 * size, 2 * size), c2); |
69 return SkShader::CreateBitmapShader( | 69 return SkShader::CreateBitmapShader( |
70 bm, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode); | 70 bm, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode); |
71 } | 71 } |
72 | 72 |
73 void draw_checkerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) { | 73 void draw_checkerboard(SkCanvas* canvas, SkColor c1, SkColor c2, int size) { |
74 SkPaint paint; | 74 SkPaint paint; |
75 paint.setShader(create_checkerboard_shader(c1, c2, size))->unref(); | 75 paint.setShader(create_checkerboard_shader(c1, c2, size))->unref(); |
| 76 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
76 canvas->drawPaint(paint); | 77 canvas->drawPaint(paint); |
77 } | 78 } |
78 | 79 |
79 } // namespace sk_tool_utils | 80 } // namespace sk_tool_utils |
OLD | NEW |