Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: tests/DrawBitmapRectTest.cpp

Issue 1790353002: Revert of more shader-->sp conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/CanvasTest.cpp ('k') | tests/GradientTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tests/CanvasTest.cpp ('k') | tests/GradientTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698