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

Unified Diff: dm/DMSrcSink.cpp

Issue 2078623002: Support sRGB dsts in opt code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Drop parens Created 4 years, 6 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 | « dm/DMSrcSink.h ('k') | src/core/SkColorSpaceXform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 97f1e4866444792f5c8ecc437bd521f7d200835a..8afbfb9f2f92d61110251a1c06adafc194d7817f 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -886,9 +886,12 @@ Error ColorCodecSrc::draw(SkCanvas* canvas) const {
case kBaseline_Mode:
canvas->drawBitmap(bitmap, 0, 0);
break;
+ case kDst_sRGB_Mode:
case kDst_HPZR30w_Mode: {
sk_sp<SkColorSpace> srcSpace = sk_ref_sp(codec->getColorSpace());
- sk_sp<SkColorSpace> dstSpace = SkColorSpace::NewICC(dstData->data(), dstData->size());
+ sk_sp<SkColorSpace> dstSpace = (kDst_sRGB_Mode == fMode) ?
+ SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) :
+ SkColorSpace::NewICC(dstData->data(), dstData->size());
SkASSERT(dstSpace);
std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(srcSpace, dstSpace);
« no previous file with comments | « dm/DMSrcSink.h ('k') | src/core/SkColorSpaceXform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698