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 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 sk_sp<SkShader> shader(SkShader::MakePictureShader(picture, SkShader::kRepea t_TileMode, | 197 sk_sp<SkShader> shader(SkShader::MakePictureShader(picture, SkShader::kRepea t_TileMode, |
198 SkShader::kRepeat_TileMod e, | 198 SkShader::kRepeat_TileMod e, |
199 nullptr, nullptr)); | 199 nullptr, nullptr)); |
200 | 200 |
201 p.setColor(sk_tool_utils::color_to_565(0xFF8BC34A)); // green | 201 p.setColor(sk_tool_utils::color_to_565(0xFF8BC34A)); // green |
202 canvas->drawPaint(p); | 202 canvas->drawPaint(p); |
203 | 203 |
204 canvas->clipRect(SkRect::MakeXYWH(0, 0, 400, 350)); | 204 canvas->clipRect(SkRect::MakeXYWH(0, 0, 400, 350)); |
205 p.setColor(sk_tool_utils::color_to_565(0xFFB6B6B6)); // gray | 205 p.setColor(sk_tool_utils::color_to_565(0xFFB6B6B6)); // gray |
206 canvas->drawPaint(p); | 206 canvas->drawPaint(p); |
207 p.setShader(shader.get()); | 207 p.setShader(std::move(shader)); |
tomhudson
2016/03/25 14:28:07
Nit: could fold shader construction into this line
reed1
2016/03/25 15:04:31
Done.
| |
208 | 208 |
209 canvas->drawPaint(p); | 209 canvas->drawPaint(p); |
210 } | 210 } |
OLD | NEW |