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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkData.h" | 10 #include "SkData.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 43.436558f, | 190 43.436558f, |
191 -119.34097f, | 191 -119.34097f, |
192 123.98426f, | 192 123.98426f, |
193 0, 0, SK_Scalar1); | 193 0, 0, SK_Scalar1); |
194 c.concat(matrix); | 194 c.concat(matrix); |
195 | 195 |
196 SkBitmap bm; | 196 SkBitmap bm; |
197 bm.allocN32Pixels(width, height); | 197 bm.allocN32Pixels(width, height); |
198 bm.eraseColor(SK_ColorRED); | 198 bm.eraseColor(SK_ColorRED); |
199 | 199 |
200 SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode, | |
201 SkShader::kRepeat_TileMode); | |
202 matrix.setAll(0.0078740157f, | 200 matrix.setAll(0.0078740157f, |
203 0, | 201 0, |
204 SkIntToScalar(249), | 202 SkIntToScalar(249), |
205 0, | 203 0, |
206 0.0078740157f, | 204 0.0078740157f, |
207 SkIntToScalar(239), | 205 SkIntToScalar(239), |
208 0, 0, SK_Scalar1); | 206 0, 0, SK_Scalar1); |
209 s->setLocalMatrix(matrix); | 207 SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode, |
| 208 SkShader::kRepeat_TileMode, &matr
ix); |
210 | 209 |
211 SkPaint paint; | 210 SkPaint paint; |
212 paint.setShader(s)->unref(); | 211 paint.setShader(s)->unref(); |
213 | 212 |
214 SkRect r = SkRect::MakeXYWH(681, 239, 695, 253); | 213 SkRect r = SkRect::MakeXYWH(681, 239, 695, 253); |
215 c.drawRect(r, paint); | 214 c.drawRect(r, paint); |
216 | 215 |
217 assert_ifDrawnTo(reporter, dev, shouldBeDrawn); | 216 assert_ifDrawnTo(reporter, dev, shouldBeDrawn); |
218 } | 217 } |
219 | 218 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 314 |
316 // ensure that we draw nothing if srcR does not intersect the bitmap | 315 // ensure that we draw nothing if srcR does not intersect the bitmap |
317 REPORTER_ASSERT(reporter, check_for_all_zeros(dst)); | 316 REPORTER_ASSERT(reporter, check_for_all_zeros(dst)); |
318 | 317 |
319 test_nan_antihair(); | 318 test_nan_antihair(); |
320 test_giantrepeat_crbug118018(reporter); | 319 test_giantrepeat_crbug118018(reporter); |
321 | 320 |
322 test_treatAsSprite(reporter); | 321 test_treatAsSprite(reporter); |
323 test_faulty_pixelref(reporter); | 322 test_faulty_pixelref(reporter); |
324 } | 323 } |
OLD | NEW |