OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 canvas->drawBitmap(fMask, 30, 0, &paint); | 77 canvas->drawBitmap(fMask, 30, 0, &paint); |
78 | 78 |
79 canvas->translate(0, 25); | 79 canvas->translate(0, 25); |
80 | 80 |
81 canvas->drawCircle(10, 10, 10, paint); | 81 canvas->drawCircle(10, 10, 10, paint); |
82 canvas->drawCircle(40, 10, 10, paint); // no blue circle expected | 82 canvas->drawCircle(40, 10, 10, paint); // no blue circle expected |
83 | 83 |
84 canvas->translate(0, 25); | 84 canvas->translate(0, 25); |
85 | 85 |
86 // clear the shader, colorized by a solid color with a bitmap mask | 86 // clear the shader, colorized by a solid color with a bitmap mask |
87 paint.setShader(NULL); | 87 paint.setShader(nullptr); |
88 paint.setColor(SK_ColorGREEN); | 88 paint.setColor(SK_ColorGREEN); |
89 canvas->drawBitmap(fMask, 0, 0, &paint); | 89 canvas->drawBitmap(fMask, 0, 0, &paint); |
90 canvas->drawBitmap(fMask, 30, 0, &paint); | 90 canvas->drawBitmap(fMask, 30, 0, &paint); |
91 | 91 |
92 canvas->translate(0, 25); | 92 canvas->translate(0, 25); |
93 | 93 |
94 adopt_shader(&paint, SkShader::CreateBitmapShader(fMask, SkShader::k
Repeat_TileMode, | 94 adopt_shader(&paint, SkShader::CreateBitmapShader(fMask, SkShader::k
Repeat_TileMode, |
95 SkShader::kRepeat_
TileMode, &s)); | 95 SkShader::kRepeat_
TileMode, &s)); |
96 paint.setColor(SK_ColorRED); | 96 paint.setColor(SK_ColorRED); |
97 | 97 |
(...skipping 11 matching lines...) Expand all Loading... |
109 | 109 |
110 typedef GM INHERITED; | 110 typedef GM INHERITED; |
111 }; | 111 }; |
112 | 112 |
113 ////////////////////////////////////////////////////////////////////////////// | 113 ////////////////////////////////////////////////////////////////////////////// |
114 | 114 |
115 static GM* MyFactory(void*) { return new BitmapShaderGM; } | 115 static GM* MyFactory(void*) { return new BitmapShaderGM; } |
116 static GMRegistry reg(MyFactory); | 116 static GMRegistry reg(MyFactory); |
117 | 117 |
118 } | 118 } |
OLD | NEW |