diff options
author | Brian Osman <brianosman@google.com> | 2016-09-30 11:41:59 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-09-30 17:33:45 +0000 |
commit | c68d4aa4ead74e7c89f0d638f56234f4103e19e7 (patch) | |
tree | 0f0b011f48bc7f5cb197990f5613d9e4455ef377 /include | |
parent | d921dbb9b88327eef7b1fbd42e9d88bace4a65ff (diff) |
Helper functions to do SkColor -> GrColor4f
I started fixing more effects and realized I needed something like this.
Wanted to land it separately. After this, I'll add the DC's cached xform
from sRGB to AsFPArgs, so that we can easily leverage this code in more
places (mostly GrConstColorProcessor, or any effect that falls back to
that based on invariants, etc...)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2844
Change-Id: I335546f02a6c49620494d736140a72c14441b35d
Reviewed-on: https://skia-review.googlesource.com/2844
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/SkGr.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h index 70db775bfd..43d61e250b 100644 --- a/include/gpu/SkGr.h +++ b/include/gpu/SkGr.h @@ -16,6 +16,7 @@ #include "SkImageInfo.h" class GrCaps; +class GrColorSpaceXform; class GrContext; class GrTexture; class GrTextureParams; @@ -41,6 +42,9 @@ static inline GrColor SkColorToUnpremulGrColor(SkColor c) { return GrColorPackRGBA(r, g, b, a); } +GrColor4f SkColorToPremulGrColor4f(SkColor c, bool gammaCorrect, GrColorSpaceXform* gamutXform); +GrColor4f SkColorToUnpremulGrColor4f(SkColor c, bool gammaCorrect, GrColorSpaceXform* gamutXform); + static inline GrColor SkColorToOpaqueGrColor(SkColor c) { unsigned r = SkColorGetR(c); unsigned g = SkColorGetG(c); |