aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkImageEncoder_CG.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-04-27 12:45:45 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-27 17:18:03 +0000
commitd4a338f4d0a0cdc08d7d3668931c60997f0fa971 (patch)
tree676fe5dcd3d19c14c5bf091243cadea35ebef205 /src/ports/SkImageEncoder_CG.cpp
parent9fa99614ec4e695f6e7e9fe19508758757543b8c (diff)
Delete copyTo(Allocator), hide copyTo() behind flag
Replace uses of copyTo() in Skia. Bug: skia:6464 Change-Id: I921dc53a1c29a5176d18f05741f7c0b5a008e548 Reviewed-on: https://skia-review.googlesource.com/14502 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/ports/SkImageEncoder_CG.cpp')
-rw-r--r--src/ports/SkImageEncoder_CG.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ports/SkImageEncoder_CG.cpp b/src/ports/SkImageEncoder_CG.cpp
index b3fd243324..8c2a542fc3 100644
--- a/src/ports/SkImageEncoder_CG.cpp
+++ b/src/ports/SkImageEncoder_CG.cpp
@@ -89,9 +89,10 @@ bool SkEncodeImageWithCG(SkWStream* stream, const SkPixmap& pixmap, SkEncodedIma
// <Error>: CGImageDestinationFinalize image destination does not have enough images
// So instead we copy to 8888.
if (bm.colorType() == kARGB_4444_SkColorType) {
- SkBitmap bitmap8888;
- bm.copyTo(&bitmap8888, kN32_SkColorType);
- bm.swap(bitmap8888);
+ SkBitmap bitmapN32;
+ bitmapN32.allocPixels(bm.info().makeColorType(kN32_SkColorType));
+ bm.readPixels(bitmapN32.info(), bitmapN32.getPixels(), bitmapN32.rowBytes(), 0, 0);
+ bm.swap(bitmapN32);
}
type = kUTTypePNG;
break;