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

Unified Diff: src/core/SkWriteBuffer.cpp

Issue 1779263003: Make sp variants for SkData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix dynamicmemorywstream Created 4 years, 9 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
Index: src/core/SkWriteBuffer.cpp
diff --git a/src/core/SkWriteBuffer.cpp b/src/core/SkWriteBuffer.cpp
index f8b31954037fbf7fcab6ade2d84f5ba03fd976bd..f023b911d6882e2b1a4bdca1847e2105bea1d18a 100644
--- a/src/core/SkWriteBuffer.cpp
+++ b/src/core/SkWriteBuffer.cpp
@@ -186,7 +186,7 @@ void SkWriteBuffer::writeBitmap(const SkBitmap& bitmap) {
SkPixelRef* pixelRef = bitmap.pixelRef();
if (pixelRef) {
// see if the pixelref already has an encoded version
- SkAutoDataUnref existingData(pixelRef->refEncodedData());
+ SkAutoTUnref<SkData> existingData(pixelRef->refEncodedData());
bungeman-skia 2016/03/11 14:53:13 Not sk_sp?
reed1 2016/03/11 19:23:34 PixelRef (and PixelSerializer below) are not yet c
if (existingData.get() != nullptr) {
// Assumes that if the client did not set a serializer, they are
// happy to get the encoded data.
@@ -201,7 +201,7 @@ void SkWriteBuffer::writeBitmap(const SkBitmap& bitmap) {
SkAutoPixmapUnlock result;
if (fPixelSerializer && bitmap.requestLock(&result)) {
SkASSERT(nullptr == fBitmapHeap);
- SkAutoDataUnref data(fPixelSerializer->encode(result.pixmap()));
+ SkAutoTUnref<SkData> data(fPixelSerializer->encode(result.pixmap()));
if (data.get() != nullptr) {
// if we have to "encode" the bitmap, then we assume there is no
// offset to share, since we are effectively creating a new pixelref

Powered by Google App Engine
This is Rietveld 408576698