diff options
author | Brian Osman <brianosman@google.com> | 2017-03-07 13:22:22 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-07 19:50:52 +0000 |
commit | 472991481bf1aaf6e966d9e8d3c64208cfc84247 (patch) | |
tree | e24087aa7e8e7c46d42e801fc02ae6f18afce10e /include | |
parent | d543e0a835002cc423de0d09c86eea99a0c0a2ba (diff) |
Groundwork for nonlinear blending mode in Ganesh
Changing a bit of plumbing so we have what we need for one-off color
conversion, and fixing the logic in some of our surface validation.
Plenty more to come, want to submit this stuff in manageable chunks.
BUG=skia:6242
Change-Id: Iac9954c7cc490cc99663db4b9cdf5d6388fc39c7
Reviewed-on: https://skia-review.googlesource.com/9389
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrSurfaceContext.h | 2 | ||||
-rw-r--r-- | include/gpu/SkGr.h | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/include/gpu/GrSurfaceContext.h b/include/gpu/GrSurfaceContext.h index 24041e8829..ed049be506 100644 --- a/include/gpu/GrSurfaceContext.h +++ b/include/gpu/GrSurfaceContext.h @@ -34,7 +34,7 @@ public: SkColorSpace* getColorSpace() const { return fColorSpace.get(); } sk_sp<SkColorSpace> refColorSpace() const { return fColorSpace; } - bool isGammaCorrect() const { return SkToBool(fColorSpace.get()); } + bool isGammaCorrect() const; // TODO: these two calls would be way cooler if this object had a GrSurfaceProxy pointer int width() const { return this->asSurfaceProxy()->width(); } diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h index f7ca0c8e4d..02df699ab4 100644 --- a/include/gpu/SkGr.h +++ b/include/gpu/SkGr.h @@ -46,11 +46,13 @@ GrColor4f SkColorToPremulGrColor4f(SkColor c, SkColorSpace* dstColorSpace); GrColor4f SkColorToUnpremulGrColor4f(SkColor c, SkColorSpace* dstColorSpace); /** - * As above, but with explicit control over the linearization and gamut xform steps. - * Typically used when you have easy access to a pre-computed xform. + * As above, but with a caller-supplied color space xform object. Faster for the cases where we + * have that cached. */ -GrColor4f SkColorToPremulGrColor4f(SkColor c, bool gammaCorrect, GrColorSpaceXform* gamutXform); -GrColor4f SkColorToUnpremulGrColor4f(SkColor c, bool gammaCorrect, GrColorSpaceXform* gamutXform); +GrColor4f SkColorToPremulGrColor4f(SkColor c, SkColorSpace* dstColorSpace, + GrColorSpaceXform* gamutXform); +GrColor4f SkColorToUnpremulGrColor4f(SkColor c, SkColorSpace* dstColorSpace, + GrColorSpaceXform* gamutXform); static inline GrColor SkColorToOpaqueGrColor(SkColor c) { unsigned r = SkColorGetR(c); |