| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 SkScalar fTileSize; | 175 SkScalar fTileSize; |
| 176 SkScalar fSceneSize; | 176 SkScalar fSceneSize; |
| 177 | 177 |
| 178 SkAutoTUnref<SkPicture> fPicture; | 178 SkAutoTUnref<SkPicture> fPicture; |
| 179 SkBitmap fBitmap; | 179 SkBitmap fBitmap; |
| 180 | 180 |
| 181 typedef GM INHERITED; | 181 typedef GM INHERITED; |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 DEF_GM( return SkNEW_ARGS(PictureShaderGM, (50, 100)); ) | 184 DEF_GM(return new PictureShaderGM(50, 100);) |
| 185 | 185 |
| 186 DEF_SIMPLE_GM(tiled_picture_shader, canvas, 400, 400) { | 186 DEF_SIMPLE_GM(tiled_picture_shader, canvas, 400, 400) { |
| 187 // https://code.google.com/p/skia/issues/detail?id=3398 | 187 // https://code.google.com/p/skia/issues/detail?id=3398 |
| 188 SkRect tile = SkRect::MakeWH(100, 100); | 188 SkRect tile = SkRect::MakeWH(100, 100); |
| 189 | 189 |
| 190 SkPictureRecorder recorder; | 190 SkPictureRecorder recorder; |
| 191 SkCanvas* c = recorder.beginRecording(tile); | 191 SkCanvas* c = recorder.beginRecording(tile); |
| 192 | 192 |
| 193 SkRect r = tile; | 193 SkRect r = tile; |
| 194 r.inset(4, 4); | 194 r.inset(4, 4); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 210 p.setColor(sk_tool_utils::color_to_565(0xFF8BC34A)); // green | 210 p.setColor(sk_tool_utils::color_to_565(0xFF8BC34A)); // green |
| 211 canvas->drawPaint(p); | 211 canvas->drawPaint(p); |
| 212 | 212 |
| 213 canvas->clipRect(SkRect::MakeXYWH(0, 0, 400, 350)); | 213 canvas->clipRect(SkRect::MakeXYWH(0, 0, 400, 350)); |
| 214 p.setColor(sk_tool_utils::color_to_565(0xFFB6B6B6)); // gray | 214 p.setColor(sk_tool_utils::color_to_565(0xFFB6B6B6)); // gray |
| 215 canvas->drawPaint(p); | 215 canvas->drawPaint(p); |
| 216 p.setShader(shader.get()); | 216 p.setShader(shader.get()); |
| 217 | 217 |
| 218 canvas->drawPaint(p); | 218 canvas->drawPaint(p); |
| 219 } | 219 } |
| OLD | NEW |