aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar herb <herb@google.com>2016-06-03 09:44:53 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-03 09:44:53 -0700
commit5823846397066377b65e011a42becd2d665110ad (patch)
tree6b1f132de5ecf30f9fefe5724670f0855127bedd /src
parentae92262f3ba5b3412ff468877277d817f1b61308 (diff)
Add gm for displaying different variants of 8888 bitmaps and fix a small rejection case for sprite blitters.
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBlitter_Sprite.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp
index 2ddc5f4855..dc912b0f65 100644
--- a/src/core/SkBlitter_Sprite.cpp
+++ b/src/core/SkBlitter_Sprite.cpp
@@ -149,6 +149,12 @@ SkBlitter* SkBlitter::ChooseSprite(const SkPixmap& dst, const SkPaint& paint,
*/
SkASSERT(allocator != nullptr);
+ // Defer to the general code if the pixels are unpremultipled. This case is not common,
+ // and this simplifies the code.
+ if (source.alphaType() == kUnpremul_SkAlphaType) {
+ return nullptr;
+ }
+
SkSpriteBlitter* blitter = nullptr;
if (SkSpriteBlitter_Src_SrcOver::Supports(dst, source, paint)) {