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

Unified Diff: src/gpu/SkGrPixelRef.cpp

Issue 68973005: Expand pixelref to return SkImageInfo and rowbytes (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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: src/gpu/SkGrPixelRef.cpp
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp
index dc5d7558f0d7a3e5c0294ec59f08f1622ef0ea16..d5d957f5cadb1c78db0225c071a5eccfc2e43c1a 100644
--- a/src/gpu/SkGrPixelRef.cpp
+++ b/src/gpu/SkGrPixelRef.cpp
@@ -24,10 +24,8 @@ SkROLockPixelsPixelRef::SkROLockPixelsPixelRef() : INHERITED(&gROLockPixelsPixel
SkROLockPixelsPixelRef::~SkROLockPixelsPixelRef() {
}
-void* SkROLockPixelsPixelRef::onLockPixels(SkColorTable** ctable) {
- if (ctable) {
- *ctable = NULL;
- }
+void* SkROLockPixelsPixelRef::onLockPixels(SkImageInfo* info, size_t* rowBytes,
+ SkColorTable** ctable) {
fBitmap.reset();
// SkDebugf("---------- calling readpixels in support of lockpixels\n");
if (!this->onReadPixels(&fBitmap, NULL)) {
@@ -35,6 +33,10 @@ void* SkROLockPixelsPixelRef::onLockPixels(SkColorTable** ctable) {
return NULL;
}
fBitmap.lockPixels();
+
+ fBitmap.asImageInfo(info);
+ *rowBytes = fBitmap.rowBytes();
+ *ctable = NULL;
return fBitmap.getPixels();
}

Powered by Google App Engine
This is Rietveld 408576698