aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrColorSpaceXform.h
Commit message (Collapse)AuthorAge
* Implement nonlinear (as-encoded) blending in GrColorSpaceXformGravatar Brian Osman2018-06-18
| | | | | | | | | | | | | | | | | | Make GrColorSpaceXform a wrapper over SkColorSpaceXformSteps, and removed the xform cache. The shader code does up to five steps to correctly transform (unpremul, linearize, gamut, encode, premul). Remove all clamping, so we can support sRGB encoded F16. Most of https://skia-review.googlesource.com/c/skia/+/132090, except that GrNonlinearColorSpaceXformEffect is still used for SkColorSpaceXformCanvas and a few other places. As a result, this doesn't trigger any layout test failures. Change-Id: I789a5e327a419b5f7634c00d1b355912046c07b7 Reviewed-on: https://skia-review.googlesource.com/135326 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove GrPixelConfig argument to GrColorSpaceXform[Effect]::MakeGravatar Brian Osman2018-06-14
| | | | | | | | | | | This was for sRGB configs, which are no longer treated special. Pulling this out of https://skia-review.googlesource.com/c/skia/+/132090 to land separately. Change-Id: Id04c4e82ad4ffe375cfd384490839b0488e54d44 Reviewed-on: https://skia-review.googlesource.com/134843 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove const from (immutable) SkColorSpace args to some functionsGravatar Brian Osman2018-06-14
| | | | | | | | | | | | Another piece of https://skia-review.googlesource.com/c/skia/+/132090 that I'd like to land separately. Change-Id: I64d8968cf7e0fb0d288eca71c79d361410c924b8 Reviewed-on: https://skia-review.googlesource.com/134782 Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Auto-Submit: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Add support for transfer functions to GrColorSpaceXformGravatar Brian Osman2017-10-31
| | | | | | | | | | | | | | | | | | | With this change, untagged sources (eg N32) are treated as sRGB data, which causes a huge number of GMs to render more correctly in GPU sRGB/F16/etc... configs. Also, because the sources are treated as having a color space, we actually do gamut conversion for wide or narrow gamut outputs. This change also applies the transfer function math to individual colors in the case of gradient stops and color shaders. (The CPU backend doesn't do this yet, but I think we've decided there's no reason not to support it). Bug: skia: Change-Id: If76e9e4a268f9f74110ff4bbe4fe189ba5d19d9f Reviewed-on: https://skia-review.googlesource.com/64100 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Add clamped/unclamped xform to GrColorSpaceXformGravatar Brian Osman2017-10-20
| | | | | | | | | | | Use that in analytic gradient setup for future-proofing. Also fixed several out-of-date comments in gradient code. Bug: skia: Change-Id: I79726cad786c22f80e08cdc2b7a1e15ae27ecd5a Reviewed-on: https://skia-review.googlesource.com/62320 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Add GrColorSpaceXformEffectGravatar Brian Osman2017-10-18
| | | | | | | | | | | | | This is an FP that just applies a GrColorSpaceXform. I have a long string of follow-up changes that use this, which greatly simplifies many other FPs, and ultimately eliminates the need for color space xforms to be a first-class type in SkSL. Bug: skia: Change-Id: I070d8bab81c9a620a2173c83b0013c63ad53bc8e Reviewed-on: https://skia-review.googlesource.com/60726 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove more headers from include/gpuGravatar Robert Phillips2017-04-21
TBR=bsalomon@google.com Change-Id: I93b28cfcb4d7b50c12e24ea81faab680bccce9ef Reviewed-on: https://skia-review.googlesource.com/14036 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Osman <brianosman@google.com>