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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 bm.eraseColor(SK_ColorRED); | 189 bm.eraseColor(SK_ColorRED); |
190 | 190 |
191 matrix.setAll(0.0078740157f, | 191 matrix.setAll(0.0078740157f, |
192 0, | 192 0, |
193 SkIntToScalar(249), | 193 SkIntToScalar(249), |
194 0, | 194 0, |
195 0.0078740157f, | 195 0.0078740157f, |
196 SkIntToScalar(239), | 196 SkIntToScalar(239), |
197 0, 0, SK_Scalar1); | 197 0, 0, SK_Scalar1); |
| 198 SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode, |
| 199 SkShader::kRepeat_TileMode, &matr
ix); |
| 200 |
198 SkPaint paint; | 201 SkPaint paint; |
199 paint.setShader(SkShader::MakeBitmapShader(bm, SkShader::kRepeat_TileMode, | 202 paint.setShader(s)->unref(); |
200 SkShader::kRepeat_TileMode, &matr
ix)); | |
201 | 203 |
202 SkRect r = SkRect::MakeXYWH(681, 239, 695, 253); | 204 SkRect r = SkRect::MakeXYWH(681, 239, 695, 253); |
203 c.drawRect(r, paint); | 205 c.drawRect(r, paint); |
204 | 206 |
205 assert_ifDrawnTo(reporter, dev, shouldBeDrawn); | 207 assert_ifDrawnTo(reporter, dev, shouldBeDrawn); |
206 } | 208 } |
207 | 209 |
208 /* | 210 /* |
209 * Original bug was asserting that the matrix-proc had generated a (Y) value | 211 * Original bug was asserting that the matrix-proc had generated a (Y) value |
210 * that was out of range. This led (in the release build) to the sampler-proc | 212 * that was out of range. This led (in the release build) to the sampler-proc |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 305 |
304 // ensure that we draw nothing if srcR does not intersect the bitmap | 306 // ensure that we draw nothing if srcR does not intersect the bitmap |
305 REPORTER_ASSERT(reporter, check_for_all_zeros(dst)); | 307 REPORTER_ASSERT(reporter, check_for_all_zeros(dst)); |
306 | 308 |
307 test_nan_antihair(); | 309 test_nan_antihair(); |
308 test_giantrepeat_crbug118018(reporter); | 310 test_giantrepeat_crbug118018(reporter); |
309 | 311 |
310 test_treatAsSprite(reporter); | 312 test_treatAsSprite(reporter); |
311 test_faulty_pixelref(reporter); | 313 test_faulty_pixelref(reporter); |
312 } | 314 } |
OLD | NEW |