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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 2330553003: Gamut transformation of the paint color in Ganesh (Closed)
Patch Set: Created 4 years, 3 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/gpu/GrColorSpaceXform.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 78615df6064987b4443a8ba49ce024450920fb2f..51aa535065b7f283d32d5cbc69ab991d54235f25 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -86,12 +86,18 @@ GrDrawContext::GrDrawContext(GrContext* context,
, fContext(context)
, fInstancedPipelineInfo(fRenderTarget.get())
, fColorSpace(std::move(colorSpace))
+ , fColorXformFromSRGB(nullptr)
, fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps))
, fAuditTrail(auditTrail)
#ifdef SK_DEBUG
, fSingleOwner(singleOwner)
#endif
{
+ if (fColorSpace) {
+ // sRGB sources are very common (SkColor, etc...), so we cache that gamut transformation
+ auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
+ fColorXformFromSRGB = GrColorSpaceXform::Make(srgbColorSpace.get(), fColorSpace.get());
+ }
SkDEBUGCODE(this->validate();)
}
« no previous file with comments | « src/gpu/GrColorSpaceXform.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698