Index: src/core/SkSpriteBlitter4f.cpp |
diff --git a/src/core/SkSpriteBlitter4f.cpp b/src/core/SkSpriteBlitter4f.cpp |
index 474bf4d0f606bb0681dc6dd748b747f7bce1692a..0079b2916034679937ae0c6d6a7c4bd7b93a0579 100644 |
--- a/src/core/SkSpriteBlitter4f.cpp |
+++ b/src/core/SkSpriteBlitter4f.cpp |
@@ -82,8 +82,12 @@ SkSpriteBlitter* SkSpriteBlitter::ChooseF16(const SkPixmap& source, const SkPain |
class Sprite_sRGB : public Sprite_4f { |
public: |
- Sprite_sRGB(const SkPixmap& src, const SkPaint& paint) : INHERITED(src, paint) { |
- uint32_t flags = SkXfermode::kDstIsSRGB_D32Flag; |
+ Sprite_sRGB(const SkPixmap& src, const SkPaint& paint, SkColorProfileType dstPt) |
+ : INHERITED(src, paint) { |
+ uint32_t flags = 0; |
+ if (kSRGB_SkColorProfileType == dstPt) { |
+ flags |= SkXfermode::kDstIsSRGB_D32Flag; |
+ } |
if (src.isOpaque()) { |
flags |= SkXfermode::kSrcIsOpaque_D32Flag; |
} |
@@ -111,8 +115,9 @@ private: |
}; |
-SkSpriteBlitter* SkSpriteBlitter::ChooseS32(const SkPixmap& source, const SkPaint& paint, |
- SkTBlitterAllocator* allocator) { |
+SkSpriteBlitter* SkSpriteBlitter::ChooseNew32(const SkPixmap& source, const SkPaint& paint, |
+ SkTBlitterAllocator* allocator, |
+ SkColorProfileType dstPt) { |
SkASSERT(allocator != nullptr); |
if (paint.getMaskFilter() != nullptr) { |
@@ -122,7 +127,7 @@ SkSpriteBlitter* SkSpriteBlitter::ChooseS32(const SkPixmap& source, const SkPain |
switch (source.colorType()) { |
case kN32_SkColorType: |
case kRGBA_F16_SkColorType: |
- return allocator->createT<Sprite_sRGB>(source, paint); |
+ return allocator->createT<Sprite_sRGB>(source, paint, dstPt); |
default: |
return nullptr; |
} |