Index: src/core/SkPixelRef.cpp |
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp |
index 6cc67d89af9220562464d603f79f864de5fac8e8..fedbb5ac7d67ccf412c8ec7cc036ae54c6295e5a 100644 |
--- a/src/core/SkPixelRef.cpp |
+++ b/src/core/SkPixelRef.cpp |
@@ -82,9 +82,8 @@ 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& info, SkBaseMutex* mutex) { |
+SkPixelRef::SkPixelRef(const SkImageInfo& info, SkBaseMutex* mutex) : fInfo(info) { |
hal.canary
2014/01/02 17:39:31
Bikeshed: I prefer this syntax:
SkPixelRef::SkPix
|
this->setMutex(mutex); |
- fInfo = info; |
fPixels = NULL; |
fColorTable = NULL; // we do not track ownership of this |
fLockCount = 0; |
@@ -93,9 +92,8 @@ SkPixelRef::SkPixelRef(const SkImageInfo& info, SkBaseMutex* mutex) { |
fPreLocked = false; |
} |
-SkPixelRef::SkPixelRef(const SkImageInfo& info) { |
+SkPixelRef::SkPixelRef(const SkImageInfo& info) : fInfo(info) { |
this->setMutex(NULL); |
- fInfo = info; |
fPixels = NULL; |
fColorTable = NULL; // we do not track ownership of this |
fLockCount = 0; |
@@ -104,25 +102,17 @@ SkPixelRef::SkPixelRef(const SkImageInfo& info) { |
fPreLocked = false; |
} |
-#ifdef SK_SUPPORT_LEGACY_PIXELREF_CONSTRUCTOR |
-// 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; |
- this->needsNewGenID(); |
- fIsImmutable = false; |
- fPreLocked = false; |
+static SkImageInfo read_info(SkFlattenableReadBuffer& buffer) { |
+ SkImageInfo info; |
+ info.unflatten(buffer); |
+ return info; |
} |
-#endif |
SkPixelRef::SkPixelRef(SkFlattenableReadBuffer& buffer, SkBaseMutex* mutex) |
- : INHERITED(buffer) { |
+ : INHERITED(buffer) |
+ , fInfo(read_info(buffer)) |
+{ |
this->setMutex(mutex); |
- fInfo.unflatten(buffer); |
fPixels = NULL; |
fColorTable = NULL; // we do not track ownership of this |
fLockCount = 0; |