aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/all_bitmap_configs.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-04-27 20:08:39 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-27 20:08:45 +0000
commit0122af08f6af0dee490e1a4f35b552377d0d4753 (patch)
treedc2a227b525f067fe8c837cc8d4c5c3480cb69de /gm/all_bitmap_configs.cpp
parent4b32ab1b7cac09f42b0867f6c63cd8656dd9918d (diff)
Revert "Delete copyTo(Allocator), hide copyTo() behind flag"
This reverts commit d4a338f4d0a0cdc08d7d3668931c60997f0fa971. Reason for revert: Looks like I missed something I was supposed to delete in Android. Original change's description: > 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> > TBR=msarett@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I4d252940cc6a2462b030007055ea6c229471fc6e Reviewed-on: https://skia-review.googlesource.com/14602 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'gm/all_bitmap_configs.cpp')
-rw-r--r--gm/all_bitmap_configs.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/gm/all_bitmap_configs.cpp b/gm/all_bitmap_configs.cpp
index 98d6621c6b..7e9dfab522 100644
--- a/gm/all_bitmap_configs.cpp
+++ b/gm/all_bitmap_configs.cpp
@@ -14,15 +14,8 @@
#include "SkColorPriv.h"
static SkBitmap copy_bitmap(const SkBitmap& src, SkColorType colorType) {
- const SkBitmap* srcPtr = &src;
- SkBitmap tmp(src);
- if (kRGB_565_SkColorType == colorType) {
- tmp.setAlphaType(kOpaque_SkAlphaType);
- srcPtr = &tmp;
- }
-
SkBitmap copy;
- sk_tool_utils::copy_to(&copy, colorType, *srcPtr);
+ src.copyTo(&copy, colorType);
copy.setImmutable();
return copy;
}
@@ -207,7 +200,7 @@ sk_sp<SkImage> make_not_native32_color_wheel() {
const SkColorType ct = kBGRA_8888_SkColorType;
#endif
static_assert(ct != kN32_SkColorType, "BRGA!=RGBA");
- SkAssertResult(sk_tool_utils::copy_to(&notN32bitmap, ct, n32bitmap));
+ SkAssertResult(n32bitmap.copyTo(&notN32bitmap, ct));
SkASSERT(notN32bitmap.colorType() == ct);
return SkImage::MakeFromBitmap(notN32bitmap);
}