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

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: Switched to SkString. Better labels for several tests. Added "bitmap wrapped in shader" to demonstr… 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
« no previous file with comments | « src/core/SkSpriteBlitter.h ('k') | src/core/SkSpriteBlitter_ARGB32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/core/SkSpriteBlitter.h ('k') | src/core/SkSpriteBlitter_ARGB32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698