Chromium Code Reviews| 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
|