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

Unified Diff: tests/SkpSkGrTest.cpp

Issue 159723006: add peekPixels to canvas (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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
Index: tests/SkpSkGrTest.cpp
diff --git a/tests/SkpSkGrTest.cpp b/tests/SkpSkGrTest.cpp
index 2c01a7e42ab12272cfa5f09afae9ad0055bafe28..79230bd9d891133bd2a5f74e4d21056fb91cb04f 100644
--- a/tests/SkpSkGrTest.cpp
+++ b/tests/SkpSkGrTest.cpp
@@ -454,7 +454,11 @@ void TestResult::testOne() {
SkGpuDevice grDevice(context, texture.get());
SkCanvas grCanvas(&grDevice);
drawPict(pic, &grCanvas, fScaleOversized ? scale : 1);
- const SkBitmap& grBitmap = grDevice.accessBitmap(false);
+
+ SkBitmap grBitmap;
+ grBitmap.allocPixels(grCanvas.imageInfo());
+ grCanvas.readPixels(&grBitmap, 0, 0);
+
if (fTestStep == kCompareBits) {
fPixelError = similarBits(grBitmap, bitmap);
int skTime = timePict(pic, &skCanvas);

Powered by Google App Engine
This is Rietveld 408576698