aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrColorSpaceInfo.cpp
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>
* Include sRGB -> Linear in the cached "from sRGB" xformGravatar Brian Osman2018-06-15
| | | | | | | | | | | | | | | This simplifies the handling of paint color conversion, as well as GrDrawVerticesOp and the default geometry processor. We don't need to track "linearize" separate from the color space xform. We only supply an xform if needed. The linearize is now done automatically by the xform, though we aren't converting to destination gamma. https://skia-review.googlesource.com/c/skia/+/132090 will fix that. Change-Id: I0af3f29c123c3dadb818f87c5d295bc78e2ff079 Reviewed-on: https://skia-review.googlesource.com/135141 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@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>
* Pass GrRenderTargetContext's GrColorSpaceInfo to SkShader and SkColorFilter.Gravatar Brian Salomon2017-10-25
| | | | | | | | | | | | | | 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>
* Add GrColorSpaceInfo and use in place of GrRenderTargetContext in paint ↵Gravatar Brian Salomon2017-10-24
conversion. This moves us closer to making GrAtlasTextContext and related classes usable without a GrRenderTargetContext. Change-Id: Ife52d69a3f925e23da88043acb4d8dc9f672a025 Reviewed-on: https://skia-review.googlesource.com/63304 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>