diff options
author | 2016-08-02 14:40:46 -0700 | |
---|---|---|
committer | 2016-08-02 14:40:46 -0700 | |
commit | 38d909ec2875f79952de08f36adfaac5680d2c53 (patch) | |
tree | a11067146b42f3faa8531d6ef912f7246bbde1f2 /src/core | |
parent | ada5a44f3bdac10a8a0c53b34f5add7aea9fdbb0 (diff) |
Move off SK_SUPPORT_LEGACY_DATA_FACTORIES.
This moves Skia code off of SK_SUPPORT_LEGACY_DATA_FACTORIES.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2206633004
Review-Url: https://codereview.chromium.org/2206633004
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkWriteBuffer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/SkWriteBuffer.cpp b/src/core/SkWriteBuffer.cpp index ccf1f37dd8..e954399b09 100644 --- a/src/core/SkWriteBuffer.cpp +++ b/src/core/SkWriteBuffer.cpp @@ -144,13 +144,13 @@ void SkBinaryWriteBuffer::writeBitmap(const SkBitmap& bitmap) { SkPixelRef* pixelRef = bitmap.pixelRef(); if (pixelRef) { // see if the pixelref already has an encoded version - SkAutoDataUnref existingData(pixelRef->refEncodedData()); - if (existingData.get() != nullptr) { + sk_sp<SkData> existingData(pixelRef->refEncodedData()); + if (existingData) { // Assumes that if the client did not set a serializer, they are // happy to get the encoded data. if (!fPixelSerializer || fPixelSerializer->useEncodedData(existingData->data(), existingData->size())) { - write_encoded_bitmap(this, existingData, bitmap.pixelRefOrigin()); + write_encoded_bitmap(this, existingData.get(), bitmap.pixelRefOrigin()); return; } } @@ -158,11 +158,11 @@ void SkBinaryWriteBuffer::writeBitmap(const SkBitmap& bitmap) { // see if the caller wants to manually encode SkAutoPixmapUnlock result; if (fPixelSerializer && bitmap.requestLock(&result)) { - SkAutoDataUnref data(fPixelSerializer->encode(result.pixmap())); - if (data.get() != nullptr) { + sk_sp<SkData> data(fPixelSerializer->encode(result.pixmap())); + if (data) { // if we have to "encode" the bitmap, then we assume there is no // offset to share, since we are effectively creating a new pixelref - write_encoded_bitmap(this, data, SkIPoint::Make(0, 0)); + write_encoded_bitmap(this, data.get(), SkIPoint::Make(0, 0)); return; } } |