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

Unified Diff: tests/CanvasTest.cpp

Issue 1784563002: unify peekPixels around pixmap parameter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update GrUploadPixmapToTexture to know about the new desc if readPixels was called 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/image/SkSurface.cpp ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CanvasTest.cpp
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 2390c7455f58351a2d93d464ea65d8ffac120cfa..f34430f475aea5bd1be0ccccc22f1e553760233c 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -646,17 +646,16 @@ static void test_newraster(skiatest::Reporter* reporter) {
SkCanvas* canvas = SkCanvas::NewRasterDirect(info, baseAddr, minRowBytes);
REPORTER_ASSERT(reporter, canvas);
- SkImageInfo info2;
- size_t rowBytes;
- const SkPMColor* addr = (const SkPMColor*)canvas->peekPixels(&info2, &rowBytes);
+ SkPixmap pmap;
+ const SkPMColor* addr = canvas->peekPixels(&pmap) ? pmap.addr32() : nullptr;
REPORTER_ASSERT(reporter, addr);
- REPORTER_ASSERT(reporter, info == info2);
- REPORTER_ASSERT(reporter, minRowBytes == rowBytes);
+ REPORTER_ASSERT(reporter, info == pmap.info());
+ REPORTER_ASSERT(reporter, minRowBytes == pmap.rowBytes());
for (int y = 0; y < info.height(); ++y) {
for (int x = 0; x < info.width(); ++x) {
REPORTER_ASSERT(reporter, 0 == addr[x]);
}
- addr = (const SkPMColor*)((const char*)addr + rowBytes);
+ addr = (const SkPMColor*)((const char*)addr + pmap.rowBytes());
}
delete canvas;
« no previous file with comments | « src/image/SkSurface.cpp ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698