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

Unified Diff: skia/ext/platform_canvas_unittest.cc

Issue 2340813006: accessBitmap is no longer called/needed (Closed)
Patch Set: update unittest Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/bitmap_platform_device_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/platform_canvas_unittest.cc
diff --git a/skia/ext/platform_canvas_unittest.cc b/skia/ext/platform_canvas_unittest.cc
index 8f30a5c2b071098f93e9a07298d602c2aeb31069..eb3f7ef2b7f2ec2e7a1fe5a8b68f96c0ea7ceee8 100644
--- a/skia/ext/platform_canvas_unittest.cc
+++ b/skia/ext/platform_canvas_unittest.cc
@@ -102,9 +102,11 @@ bool VerifyRoundedRect(const SkCanvas& canvas,
int y,
int w,
int h) {
- SkBaseDevice* device = canvas.getTopDevice(true);
- const SkBitmap& bitmap = device->accessBitmap(false);
- SkAutoLockPixels lock(bitmap);
+ SkBitmap bitmap;
+ bitmap.allocN32Pixels(w, h);
+ if (!canvas.readPixels(&bitmap, x, y)) {
f(malita) 2016/09/17 14:21:22 nit: can readPixels ever fail for this unit test?
reed1 2016/09/19 00:11:52 This is a general pixel checker. I'm not sure that
+ return false;
+ }
// Check corner points first. They should be of canvas_color.
if (!IsOfColor(bitmap, x, y, canvas_color)) return false;
f(malita) 2016/09/17 14:21:22 Previously we were reading the full backing store,
reed1 2016/09/19 00:11:52 Good point about needing the entire canvas read. W
« no previous file with comments | « skia/ext/bitmap_platform_device_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698