From 54f30c13fc0a5d89797fc9be5f0fb1050d96b6f4 Mon Sep 17 00:00:00 2001 From: brianosman Date: Mon, 18 Jul 2016 10:53:52 -0700 Subject: Introduce GrColorSpaceXform, for gamut conversion on textures GrTextureAccess optionally includes an instance, computed from the src and dst color spaces. In all common cases (no color space for either src or dst, or same color space for both), no object is allocated. This change is orthogonal to my attempts to get color space attached to render targets - regardless of how we choose to do that, this will give us the source color space at all points where we are connecting src to dst. There are many dangling injection points where I've been inserting nullptr, but I have a record of all of them. Additionally, there are now three places (the most common simple paths for bitmap/image rendering) where things are plumbed enough that I expect to have access to the dst color space (all marked with XFORMTODO). In addition to getting the dst color space, I need to inject shader code and uniform uploading for appendTextureLookup and friends. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2154753003 Review-Url: https://codereview.chromium.org/2154753003 --- gm/texdata.cpp | 2 +- gm/texturedomaineffect.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gm') diff --git a/gm/texdata.cpp b/gm/texdata.cpp index 01eedec633..4cad11336e 100644 --- a/gm/texdata.cpp +++ b/gm/texdata.cpp @@ -98,7 +98,7 @@ DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) { SkMatrix tm; tm = vm; tm.postIDiv(2*S, 2*S); - paint.addColorTextureProcessor(texture, tm); + paint.addColorTextureProcessor(texture, nullptr, tm); drawContext->drawRect(clip, paint, vm, SkRect::MakeWH(2*S, 2*S)); diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp index 3680006cc5..ba574b6b09 100644 --- a/gm/texturedomaineffect.cpp +++ b/gm/texturedomaineffect.cpp @@ -115,7 +115,7 @@ protected: GrPaint grPaint; grPaint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); sk_sp fp( - GrTextureDomainEffect::Make(texture, textureMatrices[tm], + GrTextureDomainEffect::Make(texture, nullptr, textureMatrices[tm], GrTextureDomain::MakeTexelDomain(texture, texelDomains[d]), mode, GrTextureParams::kNone_FilterMode)); -- cgit v1.2.3