aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/core/SkPixelRef.h2
-rw-r--r--src/core/SkPixelRef.cpp8
2 files changed, 8 insertions, 2 deletions
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h
index b87b0dc114..ec4937bea0 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -295,6 +295,8 @@ protected:
private:
SkBaseMutex* fMutex; // must remain in scope for the life of this object
+ // FIXME: fInfo should be const once we remove old constructor that does
+ // not set it.
SkImageInfo fInfo;
void* fPixels;
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp
index b5daf0b57a..e93882a465 100644
--- a/src/core/SkPixelRef.cpp
+++ b/src/core/SkPixelRef.cpp
@@ -82,8 +82,9 @@ void SkPixelRef::setMutex(SkBaseMutex* mutex) {
// just need a > 0 value, so pick a funny one to aid in debugging
#define SKPIXELREF_PRELOCKED_LOCKCOUNT 123456789
-SkPixelRef::SkPixelRef(const SkImageInfo&, SkBaseMutex* mutex) {
+SkPixelRef::SkPixelRef(const SkImageInfo& info, SkBaseMutex* mutex) {
this->setMutex(mutex);
+ fInfo = info;
fPixels = NULL;
fColorTable = NULL; // we do not track ownership of this
fLockCount = 0;
@@ -92,8 +93,9 @@ SkPixelRef::SkPixelRef(const SkImageInfo&, SkBaseMutex* mutex) {
fPreLocked = false;
}
-SkPixelRef::SkPixelRef(const SkImageInfo&) {
+SkPixelRef::SkPixelRef(const SkImageInfo& info) {
this->setMutex(NULL);
+ fInfo = info;
fPixels = NULL;
fColorTable = NULL; // we do not track ownership of this
fLockCount = 0;
@@ -106,6 +108,8 @@ SkPixelRef::SkPixelRef(const SkImageInfo&) {
// THIS GUY IS DEPRECATED -- don't use me!
SkPixelRef::SkPixelRef(SkBaseMutex* mutex) {
this->setMutex(mutex);
+ // Fill with dummy values.
+ sk_bzero(&fInfo, sizeof(fInfo));
fPixels = NULL;
fColorTable = NULL; // we do not track ownership of this
fLockCount = 0;