aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapController.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-04-17 11:50:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-17 19:01:27 +0000
commit68ce7ce9ec8ab161dd39352d97e54d9b4367224a (patch)
tree830ea3c6eefe2c37973c2948c7431a482ab4231b /src/core/SkBitmapController.cpp
parent27a50b8b3e4d0b9076830380502655d67c42d704 (diff)
support either 32bit swizzle in HQ mode
Bug: skia:6515 Change-Id: I8570a76824026d973fd0cc7247b34de7ae70a190 Reviewed-on: https://skia-review.googlesource.com/13593 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkBitmapController.cpp')
-rw-r--r--src/core/SkBitmapController.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/core/SkBitmapController.cpp b/src/core/SkBitmapController.cpp
index ba287b584a..d44f89cd0f 100644
--- a/src/core/SkBitmapController.cpp
+++ b/src/core/SkBitmapController.cpp
@@ -85,9 +85,16 @@ bool SkDefaultBitmapControllerState::processHQRequest(const SkBitmapProvider& pr
return false;
#endif
- if (kN32_SkColorType != provider.info().colorType() || !cache_size_okay(provider, fInvMatrix) ||
- fInvMatrix.hasPerspective())
- {
+ bool supported = false;
+ switch (provider.info().colorType()) {
+ case kRGBA_8888_SkColorType:
+ case kBGRA_8888_SkColorType:
+ supported = true;
+ break;
+ default:
+ break;
+ }
+ if (!supported || !cache_size_okay(provider, fInvMatrix) || fInvMatrix.hasPerspective()) {
return false; // can't handle the reqeust
}
@@ -135,8 +142,8 @@ bool SkDefaultBitmapControllerState::processHQRequest(const SkBitmapProvider& pr
SkPixmap dst;
SkBitmapCache::RecPtr rec;
- const SkImageInfo info = SkImageInfo::MakeN32(desc.fScaledWidth, desc.fScaledHeight,
- src.alphaType());
+ const SkImageInfo info = SkImageInfo::Make(desc.fScaledWidth, desc.fScaledHeight,
+ src.colorType(), src.alphaType());
if (provider.isVolatile()) {
if (!fResultBitmap.tryAllocPixels(info)) {
return false;