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

Unified Diff: src/images/SkImageRef.cpp

Issue 119753010: Revert "Revert of https://codereview.chromium.org/110593003/" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 12 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/gpu/SkGrPixelRef.cpp ('k') | src/images/SkImageRef_ashmem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageRef.cpp
diff --git a/src/images/SkImageRef.cpp b/src/images/SkImageRef.cpp
index 843f4c01f941d3aa9b962d785ba095122397bae0..2c1ec38116c60970dd90c465b147f4e80dc83d77 100644
--- a/src/images/SkImageRef.cpp
+++ b/src/images/SkImageRef.cpp
@@ -15,12 +15,12 @@
//#define DUMP_IMAGEREF_LIFECYCLE
-
///////////////////////////////////////////////////////////////////////////////
SkImageRef::SkImageRef(const SkImageInfo& info, SkStreamRewindable* stream,
int sampleSize, SkBaseMutex* mutex)
- : SkPixelRef(info, mutex), fErrorInDecoding(false) {
+ : INHERITED(info, mutex), fErrorInDecoding(false)
+{
SkASSERT(stream);
stream->ref();
fStream = stream;
@@ -39,7 +39,7 @@ SkImageRef::~SkImageRef() {
#ifdef DUMP_IMAGEREF_LIFECYCLE
SkDebugf("delete ImageRef %p [%d] data=%d\n",
- this, fConfig, (int)fStream->getLength());
+ this, this->info().fColorType, (int)fStream->getLength());
#endif
fStream->unref();
@@ -134,15 +134,18 @@ bool SkImageRef::prepareBitmap(SkImageDecoder::Mode mode) {
return false;
}
-void* SkImageRef::onLockPixels(SkColorTable** ct) {
+bool SkImageRef::onNewLockPixels(LockRec* rec) {
if (NULL == fBitmap.getPixels()) {
(void)this->prepareBitmap(SkImageDecoder::kDecodePixels_Mode);
}
- if (ct) {
- *ct = fBitmap.getColorTable();
+ if (NULL == fBitmap.getPixels()) {
+ return false;
}
- return fBitmap.getPixels();
+ rec->fPixels = fBitmap.getPixels();
+ rec->fColorTable = NULL;
+ rec->fRowBytes = fBitmap.rowBytes();
+ return true;
}
size_t SkImageRef::ramUsed() const {
« no previous file with comments | « src/gpu/SkGrPixelRef.cpp ('k') | src/images/SkImageRef_ashmem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698