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

Unified Diff: src/images/SkImageRef.cpp

Issue 105523008: Revert "Revert "Revert of https://codereview.chromium.org/110593003/"" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 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 2c1ec38116c60970dd90c465b147f4e80dc83d77..843f4c01f941d3aa9b962d785ba095122397bae0 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)
- : INHERITED(info, mutex), fErrorInDecoding(false)
-{
+ : SkPixelRef(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, this->info().fColorType, (int)fStream->getLength());
+ this, fConfig, (int)fStream->getLength());
#endif
fStream->unref();
@@ -134,18 +134,15 @@ bool SkImageRef::prepareBitmap(SkImageDecoder::Mode mode) {
return false;
}
-bool SkImageRef::onNewLockPixels(LockRec* rec) {
+void* SkImageRef::onLockPixels(SkColorTable** ct) {
if (NULL == fBitmap.getPixels()) {
(void)this->prepareBitmap(SkImageDecoder::kDecodePixels_Mode);
}
- if (NULL == fBitmap.getPixels()) {
- return false;
+ if (ct) {
+ *ct = fBitmap.getColorTable();
}
- rec->fPixels = fBitmap.getPixels();
- rec->fColorTable = NULL;
- rec->fRowBytes = fBitmap.rowBytes();
- return true;
+ return fBitmap.getPixels();
}
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