Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: src/core/SkSpriteBlitter4f.cpp

Issue 1734983003: New GM that exercises gamma-correctness in various parts of the pipeline. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkSpriteBlitter4f.cpp
diff --git a/src/core/SkSpriteBlitter4f.cpp b/src/core/SkSpriteBlitter4f.cpp
index 474bf4d0f606bb0681dc6dd748b747f7bce1692a..df8959529961ad7398417a00b7ccec14a25e9110 100644
--- a/src/core/SkSpriteBlitter4f.cpp
+++ b/src/core/SkSpriteBlitter4f.cpp
@@ -82,8 +82,11 @@ 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 +114,8 @@ 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 +125,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;
}

Powered by Google App Engine
This is Rietveld 408576698