OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "SkBlurDrawLooper.h" | 9 #include "SkBlurDrawLooper.h" |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 canvas->translate(SkIntToScalar(0), SkIntToScalar(40)); | 121 canvas->translate(SkIntToScalar(0), SkIntToScalar(40)); |
122 setup(&paint, gRec[2].fColor, gRec[2].fStrokeWidth); | 122 setup(&paint, gRec[2].fColor, gRec[2].fStrokeWidth); |
123 canvas->drawPath(fCirclePath, paint); | 123 canvas->drawPath(fCirclePath, paint); |
124 | 124 |
125 // see bug.skia.org/562 (reference, draws correct) | 125 // see bug.skia.org/562 (reference, draws correct) |
126 canvas->translate(0, 40); | 126 canvas->translate(0, 40); |
127 paint.setColor(SK_ColorBLACK); | 127 paint.setColor(SK_ColorBLACK); |
128 canvas->drawBitmap(fBitmap, 10, 10, &paint); | 128 canvas->drawBitmap(fBitmap, 10, 10, &paint); |
129 | 129 |
130 canvas->translate(0, 40); | 130 canvas->translate(0, 40); |
131 paint.setShader(SkShader::MakeBitmapShader( | 131 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader( |
132 fBitmap, SkShader::kRepeat_TileMode, | 132 fBitmap, SkShader::kRepeat_TileMode, |
133 SkShader::kRepeat_TileMode)); | 133 SkShader::kRepeat_TileMode)); |
134 | 134 |
135 // see bug.skia.org/562 (shows bug as reported) | 135 // see bug.skia.org/562 (shows bug as reported) |
| 136 paint.setShader(shader); |
136 paint.setStyle(SkPaint::kFill_Style); | 137 paint.setStyle(SkPaint::kFill_Style); |
137 canvas->drawRect(SkRect::MakeXYWH(10, 10, 20, 20), paint); | 138 canvas->drawRect(SkRect::MakeXYWH(10, 10, 20, 20), paint); |
138 paint.setShader(nullptr); | 139 paint.setShader(nullptr); |
139 } | 140 } |
140 } | 141 } |
141 | 142 |
142 private: | 143 private: |
143 typedef GM INHERITED; | 144 typedef GM INHERITED; |
144 }; | 145 }; |
145 | 146 |
146 /////////////////////////////////////////////////////////////////////////////// | 147 /////////////////////////////////////////////////////////////////////////////// |
147 | 148 |
148 static GM* MyFactory(void*) { return new ShadowsGM; } | 149 static GM* MyFactory(void*) { return new ShadowsGM; } |
149 static GMRegistry reg(MyFactory); | 150 static GMRegistry reg(MyFactory); |
150 | 151 |
151 } | 152 } |
OLD | NEW |