aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkColorSpace.cpp
Commit message (Collapse)AuthorAge
* add explicit accessor for sRGB singleton colorspacesGravatar Mike Klein2018-07-25
| | | | | | | | | | | | | | SkColorSpace::MakeSRGB().get() is scary, and causes more ref/unref pairs than strictly necessary for these singletons. This time the implementation is still in SkColorSpace.cpp, so these should really work as singletons. Change-Id: I40f2942c8dcde3040663a04c4f5330aca90868ae Reviewed-on: https://skia-review.googlesource.com/143305 Auto-Submit: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* trim #include <new> from SkPostConfig.hGravatar Mike Klein2018-06-11
| | | | | | | Change-Id: I693ddcd4ade101ba4eb4102e03adce183aa1d672 Reviewed-on: https://skia-review.googlesource.com/133829 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* 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>
* 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 SK_SUPPORT_LEGACY_ADOBE_XYZGravatar Brian Osman2018-03-12
| | | | | | | | | Chrome stopped using this months ago Change-Id: I5ea432b1545980680b2d54205513a55ef43dfc62 Reviewed-on: https://skia-review.googlesource.com/113711 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Fix typo in comment (inherited from ICC spec)Gravatar Brian Osman2018-02-08
| | | | | | | | | Bug: skia: Change-Id: I23192464011a1846810003981f109d9162dc646a Reviewed-on: https://skia-review.googlesource.com/105620 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* 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 usage of SkGammas in SkColorSpace serializationGravatar Brian Osman2017-12-27
| | | | | | | | Bug: skia:7419 Change-Id: I613d9d19eaa05402aadff12d022a4471605d7ec0 Reviewed-on: https://skia-review.googlesource.com/89183 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* 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>
* Fix Adobe RGB color space in SkiaGravatar Brian Osman2017-12-20
| | | | | | | | | | | | | | | | Our runtime definition of the XYZ matrix was fairly inaccurate. It also didn't round-trip through ICC fixed point correctly. Now, constructing the color space at runtime produces exactly the same matrix as constructing the space from the ICC profile. And the values can then be serialized back to ICC exactly. This eliminates the need for the snapping logic, too. Bug: skia: Change-Id: I69f4a9bfec3eeef153935e21ab3a0630794b1607 Reviewed-on: https://skia-review.googlesource.com/84840 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove SkColorSpace_Base::MakeNamed, along with most uses of Adobe RGBGravatar Brian Osman2017-12-14
| | | | | | | | Bug: skia: Change-Id: Ic914aacc4c47200714d66cf4487932bcb8a7693a Reviewed-on: https://skia-review.googlesource.com/85040 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Revert "Remove SkColorSpace_Base::MakeNamed, along with most uses of Adobe RGB"Gravatar Mike Klein2017-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 411b8ea74d66d08252d9b617d7e7d458604dbc2e. Reason for revert: a couple layout tests in the roll. :/ Original change's description: > Remove SkColorSpace_Base::MakeNamed, along with most uses of Adobe RGB > > Bug: skia: > Change-Id: If5935eac48184bc8cbe4db21dac4d6033a8704e6 > Reviewed-on: https://skia-review.googlesource.com/84200 > Commit-Queue: Brian Osman <brianosman@google.com> > Reviewed-by: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,brianosman@google.com Change-Id: I6d2eb57b613035ec26da15218182c808bed364ed No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/84920 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Remove SkColorSpace_Base::MakeNamed, along with most uses of Adobe RGBGravatar Brian Osman2017-12-13
| | | | | | | | Bug: skia: Change-Id: If5935eac48184bc8cbe4db21dac4d6033a8704e6 Reviewed-on: https://skia-review.googlesource.com/84200 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* 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 Type enum to SkColorSpaceGravatar Mike Reed2017-10-27
| | | | | | | | Bug: 727128 Change-Id: I116de4efd6e64504a4e1892f431f528533b1173a Reviewed-on: https://skia-review.googlesource.com/64261 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Fix 3 related races in SkColorSpace.cpp.Gravatar Mike Klein2017-09-19
| | | | | | | | | | | | | As written one thread can be comparing against, say, gSRGB, while another thread is initializing it. TSAN caught us. To fix this, we funnel everything through a function that returns its own local static, which is intialized on first use in a thread safe way. Change-Id: I2b7aa4628daff0511ad969d9800d40d967e2938e Reviewed-on: https://skia-review.googlesource.com/48761 Reviewed-by: Brian Osman <brianosman@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>
* Revert "Revert "Add color spin test for SkColorSpaceXformCanvas""Gravatar Mike Klein2017-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 73e21af21390c2806eb1350253233903808edd6b. Reason for revert: I will fix the broken bot next week. Original change's description: > Revert "Add color spin test for SkColorSpaceXformCanvas" > > This reverts commit cb01aec63bcb3dee52afcf3605bcd64166b873c0. > > Reason for revert: Breaks Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE > > Original change's description: > > Add color spin test for SkColorSpaceXformCanvas > > > > Also changes behavior to treat nullptr srcs as sRGB. > > > > Testing locally, it looks like 353 gms have no diffs from 8888. > > There are 269 diffs - some are fine (gms that do color space stuff) > > and some are bugs. > > > > BUG=skia: > > > > Change-Id: I55c2825f4f4b857e0b0a0ec050c6db82ac881492 > > Reviewed-on: https://skia-review.googlesource.com/9738 > > Reviewed-by: Brian Osman <brianosman@google.com> > > Commit-Queue: Matt Sarett <msarett@google.com> > > > > TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reviews@skia.org > # Not skipping CQ checks because original CL landed > 1 day ago. > BUG=skia: > > Change-Id: I70bb69f747b863d267494e37a60888a51ab0184c > Reviewed-on: https://skia-review.googlesource.com/9823 > Reviewed-by: Eric Boren <borenet@google.com> > Commit-Queue: Eric Boren <borenet@google.com> > TBR=borenet@google.com,mtklein@google.com,msarett@google.com,reviews@skia.org,brianosman@google.com # Not skipping CQ checks because original CL landed > 1 day ago. BUG=skia: Change-Id: I766382e6655f614042cded84f547f9fd5b109fca Reviewed-on: https://skia-review.googlesource.com/9879 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Revert "Add color spin test for SkColorSpaceXformCanvas"Gravatar Eric Boren2017-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cb01aec63bcb3dee52afcf3605bcd64166b873c0. Reason for revert: Breaks Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE Original change's description: > Add color spin test for SkColorSpaceXformCanvas > > Also changes behavior to treat nullptr srcs as sRGB. > > Testing locally, it looks like 353 gms have no diffs from 8888. > There are 269 diffs - some are fine (gms that do color space stuff) > and some are bugs. > > BUG=skia: > > Change-Id: I55c2825f4f4b857e0b0a0ec050c6db82ac881492 > Reviewed-on: https://skia-review.googlesource.com/9738 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reviews@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. BUG=skia: Change-Id: I70bb69f747b863d267494e37a60888a51ab0184c Reviewed-on: https://skia-review.googlesource.com/9823 Reviewed-by: Eric Boren <borenet@google.com> Commit-Queue: Eric Boren <borenet@google.com>
* Add color spin test for SkColorSpaceXformCanvasGravatar Matt Sarett2017-03-15
| | | | | | | | | | | | | | | Also changes behavior to treat nullptr srcs as sRGB. Testing locally, it looks like 353 gms have no diffs from 8888. There are 269 diffs - some are fine (gms that do color space stuff) and some are bugs. BUG=skia: Change-Id: I55c2825f4f4b857e0b0a0ec050c6db82ac881492 Reviewed-on: https://skia-review.googlesource.com/9738 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Expose SkColorSpaceTransferFn inversion functionGravatar Brian Osman2017-03-14
| | | | | | | | | | | Also adds tolerance to checks against zero BUG=skia: Change-Id: I2ad5737c6eef7e3ed52a685dceb347a434607336 Reviewed-on: https://skia-review.googlesource.com/9643 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Add SkColorSpace::isSRGB()Gravatar Matt Sarett2017-03-06
| | | | | | | | | BUG=skia: Change-Id: I124480a15e0c3cb01f4e22397c0a116f2d1c0d7d Reviewed-on: https://skia-review.googlesource.com/9239 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* SkAndroidCodec: Leave pixels in encoded colorspace when tf is numericalGravatar Matt Sarett2017-03-01
| | | | | | | | | Color space conversion will be deferred until later. Change-Id: I0fbade9bb374fe2ee9328f87284a2d86a199f7b4 Reviewed-on: https://skia-review.googlesource.com/9080 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add SkColorSpace::isNumericalTransferFn() to the public APIGravatar Matt Sarett2017-02-28
| | | | | | | | | | | | | | | This adds a little more flexibility for clients wanting to handle color space transformation outside of the codecs. Ex: they can leave the encoded data as is and apply the numerical transfer fn in a later step. BUG=skia: Change-Id: Ieca53b01648d4cb9cf0995715deacd4c4876900f Reviewed-on: https://skia-review.googlesource.com/9077 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Enable legacy premuls in SkColorSpaceXformGravatar Matt Sarett2017-02-22
| | | | | | | | | | | | | | | | | | | | | ***Will allow for simplified Android framework code, they typically want a color correct transform followed by a gamma encoded premul. ***Chrome does the same, so this will make it easier to replace their codecs. ***Will decrease code size. Both types of premuls are moved off the fast path here - one is essentially unused in production and the other is not "encouraged". ***Will actually make the common case faster: sRGB->sRGB means no color xform, just premul in SkSwizzler. BUG=skia: CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Ia4ec1d273b6f137151f951d37c0ebf975f6b9a3e Reviewed-on: https://skia-review.googlesource.com/8848 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Use non-linear color spaces for Android decode outputsGravatar Matt Sarett2017-02-16
| | | | | | | | | | BUG=skia: Change-Id: Ic4bce28f4bc45f73cbfcacc3630140d11fa9c41f Reviewed-on: https://skia-review.googlesource.com/8530 Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Use non-linear blending flag in raster pipeline blitterGravatar Matt Sarett2017-02-15
| | | | | | | | | | | BUG=skia: Change-Id: I00b52e6de3b46b7d26c1df2aa63c521b6c7ece2d Reviewed-on: https://skia-review.googlesource.com/8526 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@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>
* Delete legacy named color space APIGravatar Matt Sarett2017-02-10
| | | | | | | | | BUG=skia: Change-Id: I3a41b5affdfad830cea969a1e4932794d27f4f7a Reviewed-on: https://skia-review.googlesource.com/8331 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* SkColorSpace: remove named API, add gamut APIGravatar Matt Sarett2017-02-07
| | | | | | | | | | | Reland from: https://skia-review.googlesource.com/c/8021/ BUG=skia: Change-Id: I18985f130587b15fccbc86b76b2bb5c49ba5ba8a Reviewed-on: https://skia-review.googlesource.com/8136 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "SkColorSpace: remove named API, add gamut API"Gravatar Matt Sarett2017-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ecaaf6f1c156e5690200322fc2636380c1f63dd8. Reason for revert: Breaks everything Original change's description: > SkColorSpace: remove named API, add gamut API > > BUG=skia: > > Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6 > Reviewed-on: https://skia-review.googlesource.com/8021 > Reviewed-by: Brian Osman <brianosman@google.com> > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Change-Id: Ief5a0a4eeabe75a21f7512e23fc15309151066c4 Reviewed-on: https://skia-review.googlesource.com/8127 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* SkColorSpace: remove named API, add gamut APIGravatar Matt Sarett2017-02-07
| | | | | | | | | | BUG=skia: Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6 Reviewed-on: https://skia-review.googlesource.com/8021 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add toXYZD50() to SkColorSpace APIGravatar Matt Sarett2017-02-06
| | | | | | | | | | BUG=skia: Change-Id: I996877c9482453fc5ff58b0f66fa29715bea2191 Reviewed-on: https://skia-review.googlesource.com/8024 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Improve detection of color space transfer fnsGravatar Matt Sarett2017-01-04
| | | | | | | | | BUG=skia: Change-Id: I744af0efd4d48a8932b834092ed2dbad13008c1d Reviewed-on: https://skia-review.googlesource.com/6556 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>
* Refine constant sRGB and Adobe RGB to D50 matricesGravatar Matt Sarett2016-12-02
| | | | | | | | | | | | | | | | | | The new values are calculated starting with the "true" values, adapted to D50 using the Bradford transform. I don't remember where the old values came from, they've been around forever. It's possible that I just typed in the values that came out of ICC profiles (these would have been imperfect, given that there's a fixed-point -> float conversion happening there). BUG=skia: Change-Id: I8e870266bc8ab5372c3ccf6a5ee6691b2915af43 Reviewed-on: https://skia-review.googlesource.com/5450 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@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>
* Remove unneeded SkColorSpace constructorGravatar Matt Sarett2016-10-28
| | | | | | | | | | | | | TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4140 Change-Id: Ib1c477b6b56a100ea449ffa20bdf18041c044a78 Reviewed-on: https://skia-review.googlesource.com/4140 Reviewed-by: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: 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
* Cache dst LUTs in SkColorSpaceXformGravatar Matt Sarett2016-10-16
| | | | | | | | | | | | | | | | | | | | | | This is only useful in the rare case that the dst does not fall into one of our main paths. But it's a good optimization, since this does happen, and typically, the dst won't change. ColorCodecBench z620 --nonstd --xform_only Without Patch 511us With Patch 348us BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3400 Change-Id: Ibf68d9ce7072680465662922f4aa15630545e3d6 Reviewed-on: https://skia-review.googlesource.com/3400 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add NewRGB() with float gamma to SkColorSpace public APIGravatar Matt Sarett2016-10-14
| | | | | | | | | | | | | Necessary because PNGs like to specify their gamma this way. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3402 Change-Id: I399984d611db907b115b345df1afc88d39326fbb Reviewed-on: https://skia-review.googlesource.com/3402 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Removed makeLinearGamma() from the public API for SkColorSpaceGravatar raftias2016-10-13
| | | | | | | | | | | | | | | It will now reside in SkColorSpace_Base. Future work for SkColorSpace will cause this function to not be desirable or sensible to call on all SkColorSpaces. Call sites were changed to make a kSRGBLinear_Named instead of kSRGB_Named -> makeLinearGamma() (the majority of cases), and if that was not possible, SkColorSpace_Base::makeLinearGamma() was called instead. TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2412613005 Review-Url: https://codereview.chromium.org/2412613005
* Add SkColorSpaceTransferFn to SkColorSpaceGravatar Matt Sarett2016-10-11
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3178 Change-Id: I354342d4469cee0e25a7b0d189e925e431da623c Reviewed-on: https://skia-review.googlesource.com/3178 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add SkColorSpacePrimaries to help with making D50 matricesGravatar msarett2016-10-11
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2304753002 Review-Url: https://codereview.chromium.org/2304753002
* Move toXYZD50() to SkColorSpace_BaseGravatar msarett2016-09-28
| | | | | | | | | | | | SkColorSpace needs to become more versatile, in order to support profiles that cannot specified with just a "to XYZ D50" matrix. This a just first step to clean up the public API. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2381553002 Review-Url: https://codereview.chromium.org/2381553002
* Added kSRGBLinear_Named color space, along with testsGravatar brianosman2016-09-27
| | | | | | | | | | | | Gradients (and other shaders) are going to end up serializing this particular color space very frequently, so we want a shorthand way of writing it out. I think it's also helpful to have a clearer way of creating it (vs. NewNamed(kSRGB_Named)->makeLinearGamma()). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2377763002 Review-Url: https://codereview.chromium.org/2377763002