aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkColorSpace_XYZ.cpp
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>
* Roll clang for Windows to chromium's current.Gravatar Ben Wagner2018-05-11
| | | | | | | | | | This is mostly to pick up new warnings before chromium complains about them. Change-Id: I69a0c3da63398f98d3f45b0993ed3325c0edae27 Reviewed-on: https://skia-review.googlesource.com/127395 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Ben Wagner <benjaminwagner@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 SkDEBUGFAIL for non-invertible XYZ matrixGravatar Brian Osman2018-04-10
| | | | | | | | | | We have a reasonable fallback for this (extremely unlikely) scenario. Bug: chromium:819192 Change-Id: I7a9a28c067fb029fd1000e1eeb488ede688fc3b2 Reviewed-on: https://skia-review.googlesource.com/119945 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* cache SkMatrix44 type in makeColorSpin()Gravatar Mike Klein2018-03-27
| | | | | | | | | | | This helps prevent races on getType() later, e.g. https://luci-milo.appspot.com/swarming/task/3c80715df637a810/steps/symbolized_dm/0/stdout Change-Id: I3dbc9f6bf2fddff9ca416b0001bfd5da123e6b25 Reviewed-on: https://skia-review.googlesource.com/116466 Commit-Queue: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* make SkGammas less badGravatar Mike Klein2018-01-26
| | | | | | | | | | | | | | | | Data's existing operator== is terribly broken. Instead replace it with what everyone really wants to know, allChannelsSame(). I'm not quite ready to get rid of SkGammas yet, but we're getting close. Bug: chromium:799834 Change-Id: Ibcfd252e380b15fba53eb707f58304a50e90ce9f Reviewed-on: https://skia-review.googlesource.com/100320 Reviewed-by: Herb Derby <herb@google.com> 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>
* Fix color space matrix hashing to avoid hashing the typemaskGravatar Matt Sarett2017-01-04
| | | | | | | | | | BUG=skia: Change-Id: I8d4594fcf0eeebf598871bfe9203ed52460c98ce Reviewed-on: https://skia-review.googlesource.com/6558 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Implement SkICC::WriteICC()Gravatar Matt Sarett2016-12-20
| | | | | | | | | BUG=skia: Change-Id: Idd950c3da2c517780b24e312a4e7cc16ee413c99 Reviewed-on: https://skia-review.googlesource.com/6270 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: 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>
* Optimized gamma table inversion.Gravatar raftias2016-12-01
| | | | | | | | | | | | | | Brought calculation into a central place so the loop did not have to recalculate everything before the previous entry to find the inverse index. O(n) vs O(n^2). Assumes an increasing (or at least non-decreasing) table gamma just as the previous code did. BUG=skia: Change-Id: I7ea200c06511b3d74745fe4a6e3dde706bbee02f Reviewed-on: https://skia-review.googlesource.com/5402 Commit-Queue: Robert Aftias <raftias@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Added CMYK support for ICC profiles.Gravatar raftias2016-12-01
| | | | | | | | | | | | | | Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec (the only file that supports CMYK) and SkColorSpaceXform_A2B to allow parsing and color xforming of ICC CMYK images. CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I11e3d17180244281be3eb43fd608609925a7f71e Reviewed-on: https://skia-review.googlesource.com/5444 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Added CMYK support for ICC profiles."Gravatar Mike Klein2016-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 51c3fcd376c5c9972d9476b5532f6164375a38d1. Reason for revert: ASAN, MSAN both take issue with parse_and_load_gamma() Original change's description: > Added CMYK support for ICC profiles. > > Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel > inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec > (the only file that supports CMYK) and SkColorSpaceXform_A2B to allow > parsing and color xforming of ICC CMYK images. > > BUG=skia: > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5197 > CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD > > > Change-Id: Id6619f63f04071f79cd2d84321857dfa269ad3aa > Reviewed-on: https://skia-review.googlesource.com/5197 > Commit-Queue: Mike Klein <mtklein@chromium.org> > Reviewed-by: Matt Sarett <msarett@google.com> > Reviewed-by: Mike Klein <mtklein@chromium.org> > Reviewed-by: Leon Scroggins <scroggo@google.com> > TBR=mtklein@chromium.org,mtklein@google.com,msarett@google.com,scroggo@google.com,brianosman@google.com,raftias@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ib43fef00bc233c0b4fa47ed29040d69601def267 Reviewed-on: https://skia-review.googlesource.com/5423 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Added CMYK support for ICC profiles.Gravatar raftias2016-12-01
| | | | | | | | | | | | | | | | | | | | Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec (the only file that supports CMYK) and SkColorSpaceXform_A2B to allow parsing and color xforming of ICC CMYK images. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5197 CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Id6619f63f04071f79cd2d84321857dfa269ad3aa Reviewed-on: https://skia-review.googlesource.com/5197 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Leon Scroggins <scroggo@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>
* Rename all color space factories from New* to Make*Gravatar Brian Osman2016-10-24
| | | | | | | | | | | | | | | | | | | | | Matches our naming convention for all other types - factories that return sk_sp (or any type that intelligently manages its own lifetime) are named Make. Previous factories are still around, assuming SK_SUPPORT_LEGACY_COLOR_SPACE_FACTORIES is defined. Enable that define for Android, etc. See also: https://codereview.chromium.org/2442053002/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3822 Change-Id: Iaea9376490736b494e8ffc820831f052bbe1478d Reviewed-on: https://skia-review.googlesource.com/3822 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@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