diff options
author | Brian Salomon <bsalomon@google.com> | 2017-10-25 15:12:19 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-25 19:32:20 +0000 |
commit | 4cbb6e6d551e8bea2c040b1aa9dce253cffb9af0 (patch) | |
tree | a93401716e0f5d45760da36b49c8cf8ea8e1cc21 /src/shaders/SkShaderBase.h | |
parent | 291af4f17e0630f78a8c4d22f304243fb28ae42b (diff) |
Pass GrRenderTargetContext's GrColorSpaceInfo to SkShader and SkColorFilter.
Also to SkColorTo(Premul|Unpremul)GrColor4f.
This can avoid cache lookups to find GrColorSpaceXforms as the xform pointer is stored in GrColorSpaceInfo after the first lookup.
Also uses GrColorSpaceInfo to construct GrTextUtils::Paint.
Bug: skia:
Change-Id: Idf19d512a60d2269e6921c7fb54d93aee499a70d
Reviewed-on: https://skia-review.googlesource.com/63660
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/shaders/SkShaderBase.h')
-rw-r--r-- | src/shaders/SkShaderBase.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/shaders/SkShaderBase.h b/src/shaders/SkShaderBase.h index d63813c393..85c08fe75d 100644 --- a/src/shaders/SkShaderBase.h +++ b/src/shaders/SkShaderBase.h @@ -13,6 +13,7 @@ #include "SkShader.h" class GrContext; +class GrColorSpaceInfo; class GrFragmentProcessor; class SkArenaAlloc; class SkColorSpace; @@ -140,18 +141,18 @@ public: const SkMatrix* viewMatrix, const SkMatrix* localMatrix, SkFilterQuality filterQuality, - SkColorSpace* dstColorSpace) - : fContext(context) - , fViewMatrix(viewMatrix) - , fLocalMatrix(localMatrix) - , fFilterQuality(filterQuality) - , fDstColorSpace(dstColorSpace) {} - - GrContext* fContext; - const SkMatrix* fViewMatrix; - const SkMatrix* fLocalMatrix; - SkFilterQuality fFilterQuality; - SkColorSpace* fDstColorSpace; + const GrColorSpaceInfo* dstColorSpaceInfo) + : fContext(context) + , fViewMatrix(viewMatrix) + , fLocalMatrix(localMatrix) + , fFilterQuality(filterQuality) + , fDstColorSpaceInfo(dstColorSpaceInfo) {} + + GrContext* fContext; + const SkMatrix* fViewMatrix; + const SkMatrix* fLocalMatrix; + SkFilterQuality fFilterQuality; + const GrColorSpaceInfo* fDstColorSpaceInfo; }; /** |