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

Side by Side Diff: tests/DrawBitmapRectTest.cpp

Issue 1793303002: Reland of "more shader-->sp conversions (patchset #5 id:80001 of https://codereview.chromium… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make pictureRef a value, so its clearer what's going on 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
201 SkPaint paint; 198 SkPaint paint;
202 paint.setShader(s)->unref(); 199 paint.setShader(SkShader::MakeBitmapShader(bm, SkShader::kRepeat_TileMode,
200 SkShader::kRepeat_TileMode, &matr ix));
203 201
204 SkRect r = SkRect::MakeXYWH(681, 239, 695, 253); 202 SkRect r = SkRect::MakeXYWH(681, 239, 695, 253);
205 c.drawRect(r, paint); 203 c.drawRect(r, paint);
206 204
207 assert_ifDrawnTo(reporter, dev, shouldBeDrawn); 205 assert_ifDrawnTo(reporter, dev, shouldBeDrawn);
208 } 206 }
209 207
210 /* 208 /*
211 * Original bug was asserting that the matrix-proc had generated a (Y) value 209 * Original bug was asserting that the matrix-proc had generated a (Y) value
212 * that was out of range. This led (in the release build) to the sampler-proc 210 * 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
305 303
306 // ensure that we draw nothing if srcR does not intersect the bitmap 304 // ensure that we draw nothing if srcR does not intersect the bitmap
307 REPORTER_ASSERT(reporter, check_for_all_zeros(dst)); 305 REPORTER_ASSERT(reporter, check_for_all_zeros(dst));
308 306
309 test_nan_antihair(); 307 test_nan_antihair();
310 test_giantrepeat_crbug118018(reporter); 308 test_giantrepeat_crbug118018(reporter);
311 309
312 test_treatAsSprite(reporter); 310 test_treatAsSprite(reporter);
313 test_faulty_pixelref(reporter); 311 test_faulty_pixelref(reporter);
314 } 312 }
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