aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkColorSpace_XYZ.h
Commit message (Collapse)AuthorAge
* remove bit, srgbnl config in DMGravatar Mike Klein2018-05-29
| | | | | | | | | | | We're not going to need the bit. I've rewritten "esrgb" and "srgbnl" to express themselves the way I'd like them to work. Their images are supressed in Gold already. Change-Id: I6da58cc75dcb998cbfcf9a8f65de31c030adb494 Reviewed-on: https://skia-review.googlesource.com/130506 Reviewed-by: Brian Osman <brianosman@google.com>
* Reland "start cleaning up non-skcms SkColorSpaceXforms"Gravatar Mike Klein2018-05-23
| | | | | | | | | | | | | | | | | | | | | | | | This is a reland of 339133f82c30cd3080672db28e6f72c894cba05a Original change's description: > start cleaning up non-skcms SkColorSpaceXforms > > I think this gets rid of > - SkColorSpaceXform_Base > - SkColorSpaceXform_XYZ > - SkColorSpaceXform_A2B > and lots of support code. Might be more left to clean up? > > Change-Id: I560d974d1e879dfd6a63ee2244a3dd88bd495c8a > Reviewed-on: https://skia-review.googlesource.com/129512 > Commit-Queue: Brian Osman <brianosman@google.com> > Auto-Submit: Mike Klein <mtklein@chromium.org> > Reviewed-by: Brian Osman <brianosman@google.com> Change-Id: I33ee0d8bcfd72c401823a2e7d5168c9ecc9a5181 Reviewed-on: https://skia-review.googlesource.com/129624 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Revert "start cleaning up non-skcms SkColorSpaceXforms"Gravatar Mike Klein2018-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 339133f82c30cd3080672db28e6f72c894cba05a. Reason for revert: broke NinePatchDrawableTest.testGetPadding? stranger things have happened. Original change's description: > start cleaning up non-skcms SkColorSpaceXforms > > I think this gets rid of > - SkColorSpaceXform_Base > - SkColorSpaceXform_XYZ > - SkColorSpaceXform_A2B > and lots of support code. Might be more left to clean up? > > Change-Id: I560d974d1e879dfd6a63ee2244a3dd88bd495c8a > Reviewed-on: https://skia-review.googlesource.com/129512 > Commit-Queue: Brian Osman <brianosman@google.com> > Auto-Submit: Mike Klein <mtklein@chromium.org> > Reviewed-by: Brian Osman <brianosman@google.com> TBR=mtklein@chromium.org,brianosman@google.com Change-Id: I9e76195481b8658b34936aeece278d81c286c0fa No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/129680 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* start cleaning up non-skcms SkColorSpaceXformsGravatar Mike Klein2018-05-22
| | | | | | | | | | | | | | I think this gets rid of - SkColorSpaceXform_Base - SkColorSpaceXform_XYZ - SkColorSpaceXform_A2B and lots of support code. Might be more left to clean up? Change-Id: I560d974d1e879dfd6a63ee2244a3dd88bd495c8a Reviewed-on: https://skia-review.googlesource.com/129512 Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* non-linear blending first stepsGravatar Mike Klein2018-05-10
| | | | | | | | | | | | | | | | | | | | | | | Code: - Add a non-linear blending bit and makeNonlinearBlending() to SkColorSpace - remove enough F16=linear checks to make it possible to create surfaces and encode pngs with nonlinear F16 Testing: - add "esrgb" software config to DM, run it - add "srgbnl" software config, run it - deemphasize importance of "srgb" config on bots - update unit tests to reflect relaxed F16 constraints - add a new unit test file with _really_ basic tests, and a new unit test that's not working yet Bug: skia:7942 Change-Id: I8ac042bdf9f3d791765393b68fd9256375184d83 Reviewed-on: https://skia-review.googlesource.com/127325 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove SkColorSpace_BaseGravatar Mike Klein2018-01-26
| | | | | | | | | | | | The type SkColorSpace_Base doesn't need to exist. Its one type() query can be answered instead by toXYZD50(). Now all that's left in the file is SkGammas, so rename it to SkGammas.h. Change-Id: Id60ddbfb342accfd5674ae89b37a24a6583ef7b8 Reviewed-on: https://skia-review.googlesource.com/99702 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Remove more functionality from SkColorSpace_BaseGravatar Brian Osman2017-12-21
| | | | | | | | | | | Push profile data into XYZ and A2B classes Move SkColorSpace_Base::MakeRGB to SkColorSpace Bug: skia: Change-Id: I4782eb2a5c77b54d302e1982654755015dea7651 Reviewed-on: https://skia-review.googlesource.com/88560 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Push much of the SkColorSpace_Base interface up to SkColorSpaceGravatar Brian Osman2017-12-12
| | | | | | | | | | | Some pieces still remain, but the next step looks less mechanical, so I wanted to land this piece independently. Bug: skia: Change-Id: Ie63afcfa08af2f6e4996911fa2225c43441dbfb2 Reviewed-on: https://skia-review.googlesource.com/84120 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Add SkColorSpace_Base::makeColorSpinGravatar Brian Osman2017-11-14
| | | | | | | | | | | | This is a utility that creates a version of an existing XYZ color space that performs our color spin operation. Assigning this to a source remaps RGB to GBR. Assigning it to a destination does the opposite (RGB to BRG). Bug: skia: Change-Id: I3528698220bd32aa01dcd3db225e60f151a4b5bd Reviewed-on: https://skia-review.googlesource.com/71280 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* make make{SRGB,Linear}Gamma() constGravatar Mike Klein2017-06-12
| | | | | | | Change-Id: If20a43a905ae65643d071978b345d9ff09c04cf1 Reviewed-on: https://skia-review.googlesource.com/19541 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Delete SkColorSpace::ColorSpaceFlagsGravatar Matt Sarett2017-03-24
| | | | | | | | | BUG=skia: Change-Id: Ia0688876915cd773614ca0c4ccd467cf6e7c603e Reviewed-on: https://skia-review.googlesource.com/10105 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Non linear blending flag for SkColorSpaceGravatar Brian Osman2017-02-15
| | | | | | | | | | BUG=skia:6242 Change-Id: I63cce6019ce854ba807b2a819ef4fe3214898bee Reviewed-on: https://skia-review.googlesource.com/8344 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Revert "Revert "WIP: Skia support library for ICC tasks""Gravatar Ravi Mistry2016-12-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit eb733fbf56538838a36814c75cd03f917462cb22. Reason for revert: Revert patch was automatically merged incorrectly? Original change's description: > Revert "WIP: Skia support library for ICC tasks" > > This reverts commit fc8dc3194acb959ee5980b41766660ca0644bcab. > > Reason for revert: Breaks Build-Mac-Clang-Arm7-{Debug,Release}-iOS builds. > Example tasks: > * https://chromium-swarm.appspot.com/task?id=3322f668620b9e10&refresh=10 > * https://chromium-swarm.appspot.com/task?id=332296146331e810&refresh=10 > > Original change's description: > > WIP: Skia support library for ICC tasks > > > > As a starting point, this would be mostly trivial to implement using > > SkColorSpace. > > > > This also would give us the flexibility to begin to move all of > > the ICC related code from SkColorSpace to SkICC. > > > > What are the advantages of moving this away from SkColorSpace? > > (1) A long term goal (once Chrome uses SkCodec), might be to > > move SkColorSpace::MakeICC() out of the public API. That way, > > we can guarantee that we can draw to/from *any* SkColorSpace. > > (2) Keeps SkColorSpace separate from ICC-specific representations > > like SkColorSpaceTransferFn etc. > > > > BUG=skia: > > > > Change-Id: Iddeb9903221fb57fbfc01218d8641c928b4a5165 > > Reviewed-on: https://skia-review.googlesource.com/5676 > > Commit-Queue: Matt Sarett <msarett@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > Reviewed-by: Mike Reed <reed@google.com> > > > > TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org > BUG=skia: > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: Ibdf272fce25892402bd3e85595fb8814cdf59856 > Reviewed-on: https://skia-review.googlesource.com/6232 > Commit-Queue: Ravi Mistry <rmistry@google.com> > Reviewed-by: Ravi Mistry <rmistry@google.com> > TBR=mtklein@google.com,rmistry@google.com,msarett@google.com,reviews@skia.org,brianosman@google.com,reed@google.com BUG=skia: NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I68b1624cfab8adfe31b17e1193a7766507dec8b0 Reviewed-on: https://skia-review.googlesource.com/6233 Commit-Queue: Ravi Mistry <rmistry@google.com> Reviewed-by: Ravi Mistry <rmistry@google.com>
* Revert "WIP: Skia support library for ICC tasks"Gravatar Ravi Mistry2016-12-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fc8dc3194acb959ee5980b41766660ca0644bcab. Reason for revert: Breaks Build-Mac-Clang-Arm7-{Debug,Release}-iOS builds. Example tasks: * https://chromium-swarm.appspot.com/task?id=3322f668620b9e10&refresh=10 * https://chromium-swarm.appspot.com/task?id=332296146331e810&refresh=10 Original change's description: > WIP: Skia support library for ICC tasks > > As a starting point, this would be mostly trivial to implement using > SkColorSpace. > > This also would give us the flexibility to begin to move all of > the ICC related code from SkColorSpace to SkICC. > > What are the advantages of moving this away from SkColorSpace? > (1) A long term goal (once Chrome uses SkCodec), might be to > move SkColorSpace::MakeICC() out of the public API. That way, > we can guarantee that we can draw to/from *any* SkColorSpace. > (2) Keeps SkColorSpace separate from ICC-specific representations > like SkColorSpaceTransferFn etc. > > BUG=skia: > > Change-Id: Iddeb9903221fb57fbfc01218d8641c928b4a5165 > Reviewed-on: https://skia-review.googlesource.com/5676 > Commit-Queue: Matt Sarett <msarett@google.com> > Reviewed-by: Brian Osman <brianosman@google.com> > Reviewed-by: Mike Reed <reed@google.com> > TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org BUG=skia: NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ibdf272fce25892402bd3e85595fb8814cdf59856 Reviewed-on: https://skia-review.googlesource.com/6232 Commit-Queue: Ravi Mistry <rmistry@google.com> Reviewed-by: Ravi Mistry <rmistry@google.com>
* WIP: Skia support library for ICC tasksGravatar Matt Sarett2016-12-16
| | | | | | | | | | | | | | | | | | | | | | | As a starting point, this would be mostly trivial to implement using SkColorSpace. This also would give us the flexibility to begin to move all of the ICC related code from SkColorSpace to SkICC. What are the advantages of moving this away from SkColorSpace? (1) A long term goal (once Chrome uses SkCodec), might be to move SkColorSpace::MakeICC() out of the public API. That way, we can guarantee that we can draw to/from *any* SkColorSpace. (2) Keeps SkColorSpace separate from ICC-specific representations like SkColorSpaceTransferFn etc. BUG=skia: Change-Id: Iddeb9903221fb57fbfc01218d8641c928b4a5165 Reviewed-on: https://skia-review.googlesource.com/5676 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Rearrange ICC profile parsingGravatar Matt Sarett2016-12-16
| | | | | | | | | | | | | | | | | | | | | | | None of the small details have changed, just some high level reorganization: (1) Check for XYZ spaces before A2B. (2) If we fail to parse the XYZ space, fallback by trying to parse the A2B space. This should cause no image diffs on Gold. There is an image from the ICC website that is *supposed* to test that we parse the A2B tag before the XYZ tag. Our behavior on this image will actually not change - the XYZ tag is invalid (non-D50 matrix), so we fall back to A2B anyway. I think this behavior is ok. BUG:674584 Change-Id: I271fd990937268e03e98f5037a0837a574e775ef Reviewed-on: https://skia-review.googlesource.com/6143 Reviewed-by: Robert Aftias <raftias@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add/promote gamma helpers to SkColorSpace_BaseGravatar Brian Osman2016-11-07
| | | | | | | | | | | | | | | | | | | When decoding images with strange transfer functions, we need to pick an "equivalent" drawable format and color space. These help when doing that. Our default answer is to use F16 linear, but some GPUs may not be able to draw that, in which case we'll fall back to sRGB 8888. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4453 Change-Id: I7f7342423d2a57fb45c965e1a023d255cdafedee Reviewed-on: https://skia-review.googlesource.com/4453 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Matt Sarett <msarett@google.com>
* Hash the gamut of XYZ color spaces, to speed up comparisonGravatar Brian Osman2016-10-20
| | | | | | | | | | | | | | Also going to use this to allow caching of GrColorSpaceXforms BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3670 Change-Id: I56ed2dcbdddc22046263f56d68f2d6aea55547c8 Reviewed-on: https://skia-review.googlesource.com/3670 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Matt Sarett <msarett@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Refactored SkColorSpace and added in a Lab PCS GMGravatar raftias2016-10-18
The refactoring breaks off A2B0 tag support into a separate subclass of SkColorSpace_Base, while keeping the current (besides CLUT) functionality in a XYZTRC subclass. ICC profile loading is now aware of this and creates the A2B0 subclass when SkColorSpace::NewICC() is called on a profile in need of the A2B0 functionality. The LabPCSDemo GM loads a .icc profile containing a LAB PCS and then runs a Lab->XYZ conversion on an image using it so we can display it and test out the A2B0 SkColorSpace functionality, sans a/b/m-curves, as well as the Lab->XYZ conversion code. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2389983002 Review-Url: https://codereview.chromium.org/2389983002