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 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader( | 131 paint.setShader(SkShader::MakeBitmapShader( |
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); | |
137 paint.setStyle(SkPaint::kFill_Style); | 136 paint.setStyle(SkPaint::kFill_Style); |
138 canvas->drawRect(SkRect::MakeXYWH(10, 10, 20, 20), paint); | 137 canvas->drawRect(SkRect::MakeXYWH(10, 10, 20, 20), paint); |
139 paint.setShader(nullptr); | 138 paint.setShader(nullptr); |
140 } | 139 } |
141 } | 140 } |
142 | 141 |
143 private: | 142 private: |
144 typedef GM INHERITED; | 143 typedef GM INHERITED; |
145 }; | 144 }; |
146 | 145 |
147 /////////////////////////////////////////////////////////////////////////////// | 146 /////////////////////////////////////////////////////////////////////////////// |
148 | 147 |
149 static GM* MyFactory(void*) { return new ShadowsGM; } | 148 static GM* MyFactory(void*) { return new ShadowsGM; } |
150 static GMRegistry reg(MyFactory); | 149 static GMRegistry reg(MyFactory); |
151 | 150 |
152 } | 151 } |
OLD | NEW |