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

Unified Diff: src/lazy/SkCachingPixelRef.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/lazy/SkCachingPixelRef.cpp
diff --git a/src/lazy/SkCachingPixelRef.cpp b/src/lazy/SkCachingPixelRef.cpp
index d12b7cf881cffa08e403a1073cdc7b9ace06a9a8..bebd1fc94a70b82324cff003d912142126b62d02 100644
--- a/src/lazy/SkCachingPixelRef.cpp
+++ b/src/lazy/SkCachingPixelRef.cpp
@@ -45,8 +45,8 @@ bool SkCachingPixelRef::configure(SkBitmap* bitmap) {
return bitmap->setConfig(info, 0);
}
-void* SkCachingPixelRef::onLockPixels(SkColorTable** colorTable) {
- (void)colorTable;
+void* SkCachingPixelRef::onLockPixels(SkImageInfo* infoPtr, size_t* rowBytes,
+ SkColorTable** colorTable) {
SkImageInfo info;
if (!this->getInfo(&info)) {
return NULL;
@@ -73,6 +73,11 @@ void* SkCachingPixelRef::onLockPixels(SkColorTable** colorTable) {
SkAutoLockPixels autoLockPixels(bitmap);
void* pixels = bitmap.getPixels();
SkASSERT(pixels != NULL);
+
+ *infoPtr = info;
+ *rowBytes = bitmap.rowBytes();
+ *colorTable = NULL;
+
// At this point, the autoLockPixels will unlockPixels()
// to remove bitmap's lock on the pixels. We will then
// destroy bitmap. The *only* guarantee that this pointer

Powered by Google App Engine
This is Rietveld 408576698