aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkColorSpace_ICC.cpp
Commit message (Collapse)AuthorAge
* Make skcms mandatoryGravatar Brian Osman2018-05-30
| | | | | | | Change-Id: I6b08cd586d313e3bc41c0da90698fc26ae1a8bb8 Reviewed-on: https://skia-review.googlesource.com/130822 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* make SkColorSpace::MakeICC strict as skcmsGravatar Mike Klein2018-05-07
| | | | | | | | | | | | | | | We do this somewhat trivially by calling skcms_Parse() and failing if it fails. This will help keep us sane while we work to remove SkColorSpace::MakeICC(). Change-Id: Icb1bc1a088083e181f46465dbb3a530f0e004193 Reviewed-on: https://skia-review.googlesource.com/126510 Commit-Queue: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* Reject XYZ profiles missing some (or all) TRC tagsGravatar Brian Osman2018-04-23
| | | | | | | | | | | | | | The previous behavior isn't justified by the spec, and doesn't match skcms' behavior. To ease migration and avoid discrepancy when dealing with fuzzer-generated profiles, enforce the stricter rules here. Bug: chromium:835666 Change-Id: Ice6452b521a737d6dc339571dcbb313567235ed6 Reviewed-on: https://skia-review.googlesource.com/122952 Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> Auto-Submit: Brian Osman <brianosman@google.com> Reviewed-by: 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>
* Simplify SkColorSpace::MakeICCGravatar Leon Scroggins III2017-10-31
| | | | | | | | | | | | | | | | | | | Rather than restricting the supported ICC types in MakeICC, create any ICC type that we support, and make the client reject them as necessary by querying the SkColorSpace::Type. Remove ICCTypeFlag and replace uses of it with SkColorSpace::Type. This depends on a change in Chromium (https://chromium-review.googlesource.com/c/chromium/src/+/741843). Without that, this change will start allowing non-CMYK images to use CMYK profiles. Bug: 727128 Change-Id: I085b4665e49bc80083264496d864cc4cd62ae914 Reviewed-on: https://skia-review.googlesource.com/64841 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Remove trailing whitespace.Gravatar Ben Wagner2017-10-09
| | | | | | | | | | | Also adds a presubmit to prevent adding trailing whitespace to source code in the future. Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6 Reviewed-on: https://skia-review.googlesource.com/57380 Reviewed-by: Ravi Mistry <rmistry@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* SkColorSpace_ICC: classify two entry tables as linearGravatar Matt Sarett2017-05-17
| | | | | | | | | | | | | | | | | | | | The bug linked in this CL was caused by the switch to SkJumper - where we decided to stop interpolating table-lookups. In this case, the image has tables with two entries: 0, 1. This fixes the bug by optimizing away the table lookup for these trivial no-op tables. I think this is a good change on its own. We see these tables fairly regularly. A more robust fix would expand "small" tables into larger ones through interpolation. Should we also do this? Bug: 722855 Change-Id: I3881734c6f28b5519cbe593dd05cc7b6b1b8a9d0 Reviewed-on: https://skia-review.googlesource.com/17272 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Avoid interpolating color lut with less than 2 pointsGravatar Matt Sarett2017-05-05
| | | | | | | | Bug: 717935 Change-Id: Ibf15b815891eef5a0239bc408bcbfe7c8b1507c5 Reviewed-on: https://skia-review.googlesource.com/15301 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Fix out of bounds read in SkColorSpace::MakeICCGravatar Matt Sarett2017-04-18
| | | | | | | | Bug: 711895 Change-Id: I8574289bda842cf1be3fb5bcf347a81b98fdc6b0 Reviewed-on: https://skia-review.googlesource.com/13690 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: 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>
* Unify ICC support for gray jpegs and gray pngsGravatar Matt Sarett2017-01-13
| | | | | | | | | | | | | | | | | | | | | | (1) Parse ICC gray profiles into RGB SkColorSpace objects. This is easy - "gray transfer fn + white point" is subset of "RGB transfer fns + matrix". This makes it easier/possible for the drawing code to reason about color spaces attached to kGray buffers. (2) Allow gray images to be tagged with gray ICCs OR rgb ICCs. ICC gray forces to designer to use "D50 gray". It is not uncommon to see gray images with RGB profiles - and this actually allows the designer to choose more kinds of gray (ex: sRGB gray). (3) Make SkJpegCodec support gray images with RGB ICCs. (4) Make SkPngCodec support gray images with Gray ICCs. (5) Delete gray from SkColorSpace_A2B - we no longer create these objects for gray profiles. BUG=skia: Change-Id: Id5eca803798330c54a19c4657def2e5976d1941e Reviewed-on: https://skia-review.googlesource.com/6922 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* SkTypes.h : move SkAutoMalloc into SkAutoMalloc.hGravatar Hal Canary2017-01-11
| | | | | | | | | | | | | | | | * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" Revert "Revert 'SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h'" This reverts commit c456b73fef9589bbdc5eb83eaa83e53c357bb3da. Change-Id: Ie2c1a17c20134b8ceab85a68b3ae3e61c24fbaab Reviewed-on: https://skia-review.googlesource.com/6886 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h"Gravatar Kevin Lubick2017-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a5494f117086d712855e4b6289c58c92d1549bcf. Reason for revert: Broke Google3 Original change's description: > SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h > > * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). > > * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h > > * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" > > Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88 > Reviewed-on: https://skia-review.googlesource.com/4543 > Reviewed-by: Ben Wagner <bungeman@google.com> > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Hal Canary <halcanary@google.com> > TBR=halcanary@google.com,bungeman@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ie8bd176121c3ee83c110d66c0d0ac65e09bfc9c5 Reviewed-on: https://skia-review.googlesource.com/6884 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* SkTypes.h : move SkAutoMalloc into SkAutoMalloc.hGravatar Hal Canary2017-01-11
| | | | | | | | | | | | | | * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88 Reviewed-on: https://skia-review.googlesource.com/4543 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@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>
* Fix swapped interpretation of c and e in SkColorSpace_ICCGravatar Matt Sarett2016-12-19
| | | | | | | | | | | | | | | | The ICC errata supports the opposite of what we do. http://www.color.org/icc_specs2.xalter TBR=reed@google.com BUG=skia: CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I18ace7f312926b264e624c30d8cb983eff5c434b Reviewed-on: https://skia-review.googlesource.com/6277 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Move existing writeICC() code into SkICCGravatar Matt Sarett2016-12-19
| | | | | | | | | BUG=skia: Change-Id: Ifb7db7adcc69104fa9abe1765fd60b7f627bdbaf Reviewed-on: https://skia-review.googlesource.com/6261 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@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>
* Removed non-Identity matrix in non-PCSXYZ Input check for ICC profilesGravatar raftias2016-12-08
| | | | | | | | | | | | | The presence seems to be disallowed in the specs (10.8/10.9), but two test images on the ICC website have them, and fail if we abort. Replaced the failure with a print warning. BUG=skia: Change-Id: I463f1a8861eaa0eb62081c3213017dba9012c890 Reviewed-on: https://skia-review.googlesource.com/5658 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Aftias <raftias@google.com>
* Added some named gamma recognition to lutnType ICC profile parsingGravatar raftias2016-12-08
| | | | | | | | | | | | | | Most CMYK images I tested had linear gamma specified as tables, which is easily recognized and when present allows an entire SkRasterPipeline stage to be avoided for every single channel. This is likely due to the fact that gamma tables are required in lutntype A2B0 profiles. BUG=skia: Change-Id: I82b65848c4099035d61098abb66e9afe0b080930 Reviewed-on: https://skia-review.googlesource.com/5388 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Aftias <raftias@google.com>
* Color-correct Gray JPEG image decoding via ICC profiles.Gravatar raftias2016-12-05
| | | | | | | | | | | | | | | | | | SkColorSpace::MakeICC now parses Gray ICC profiles and SkColorSpaceXform_A2B can now render color spaces from Gray ICC profiles. This is not enabled for SkPngCodec as of right now as we don't have any Gray PNG test images currently. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5214 CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Iea7136d1c163cd17cf0818af57f93efdbcb577e7 Reviewed-on: https://skia-review.googlesource.com/5214 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Aftias <raftias@google.com>
* Fix for Fuzzer when AtoBType profiles are empty.Gravatar raftias2016-12-01
| | | | | | | | | | | | | When all A/B/M-curves, the matrix and the CLUT were not there it would crash. There is now a check to avoid that. Past this point it should not be an empty, as SkColorSpaceXform did not make such an assumption. BUG=skia:6023 Change-Id: I099bcef7efac100d438a30bf59d9c170119b8545 Reviewed-on: https://skia-review.googlesource.com/5480 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Aftias <raftias@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>
* Moved A2B0 profile parsing before XYZGravatar raftias2016-11-29
| | | | | | | | | | | | This allows us to correctly display images with both a A2B0 tag and *XYZ/*TRC tags, instead of ignoring the A2B0 information. BUG=skia: Change-Id: Icd63db5a55692ef4c5b3f098d963e7e3f583f9a4 Reviewed-on: https://skia-review.googlesource.com/5230 Commit-Queue: Robert Aftias <raftias@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Fixed fuzzer issue with lut16Type A2B ICC profilesGravatar raftias2016-11-22
| | | | | | | | | | | | | | There was no check for if a profile had gamma table with 0 elements. Now it verifies that the table has 2-4096 entries as the ICC specs say. BUG=667695 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5124 Change-Id: I36de202e398654ce8dd88e765455b4c4577724d2 Reviewed-on: https://skia-review.googlesource.com/5124 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Aftias <raftias@google.com>
* Implemented parsing of lut8/lut16Type A2B ICC tagsGravatar raftias2016-11-21
| | | | | | | | | | | | | | | | | SkColorSpace::NewICC() can now successfully parse lut8Type/lut16Type A2B0 tags instead of just A2B0Type ones. It will store the resulting information in a SkColorSpace_A2B which allows color-correct decoding of some images which previously were not supported. BUG=138556 BUG=574209 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4770 Change-Id: I83b565af3f39f12a4bc37e0e7968f7d41e553291 Reviewed-on: https://skia-review.googlesource.com/4770 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Aftias <raftias@google.com>
* Fixed issue with some A2B0 images being too darkGravatar raftias2016-11-21
| | | | | | | | | | | | | | The issue was with the A2B0 matrix not being scaled by its encoding factor when it needed to be (for A2B0 matrices only). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5003 Change-Id: I3f202323e137e1b014e564bd96d87c601c4748ab Reviewed-on: https://skia-review.googlesource.com/5003 Commit-Queue: Robert Aftias <raftias@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Reject non-D50 matrices from ICC profilesGravatar Matt Sarett2016-10-31
| | | | | | | | | | | | BUG:660838 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4200 Change-Id: Ib57eb3705d6fe638e3a9cb56788937fc7e282847 Reviewed-on: https://skia-review.googlesource.com/4200 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Improve comments describing common sRGB curvesGravatar Matt Sarett2016-10-27
| | | | | | | | | | | BUG=skia:5897 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4037 Change-Id: Id1253cc9b960aad47bc0f9b7e40f10830d46d98d Reviewed-on: https://skia-review.googlesource.com/4037 Reviewed-by: Heather Miller <hcm@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Refactored SkColorSpace_A2B to allow arbitrary ordering of elementsGravatar raftias2016-10-24
| | | | | | | | | | | | | | | This is essential for representing non-lutAtoBType A2B tags such as lut16Type, lut8Type, mpet. Parsing of A2B0 tags was also moved ahead of the TRC/XYZ-matrix parsing, as profiles examined with both tags either had the TRC/XYZ tags as a fall-back or were incorrectly displayed if only the TRC/XYZ tags were used. This was submitted alone to reduce CL size. Tests that will use these changes will be introduced in the subsequent CLs that add on lut8/16Type A2B0 parsing. We already have lut16Type test images and these have been tested locally, but require additional code not submitted yet for lut16Type ICC profile parsing and A2B colorspace xforms. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2444553002 Review-Url: https://codereview.chromium.org/2444553002
* 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>
* Fixed potential read-out-of-bounds issue in ICC profile loadingGravatar raftias2016-10-20
| | | | | | | | | | | | For 8-bit precision color LUT in A2B0 ICC color space profiles it was skipping every 2nd CLUT value and then reading past the end of the CLUT data table. Now it properly increments through 8-bit precision color LUT tables in profiles. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2434563007 Review-Url: https://chromiumcodereview.appspot.com/2434563007
* 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
* 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>
* Remove exec bit from source file.Gravatar Ben Wagner2016-10-03
| | | | | | | | | | | | | Exec bit added in https://skia.googlesource.com/skia/+/40ff5fe59b77b0b3e34467cc2f8666e4e88356f9 BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2869 Change-Id: I238f75fe2a865923568ac8f63ee1978df6c89f6c Reviewed-on: https://skia-review.googlesource.com/2869 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Fix storage of gamut transform matrices in SkColorSpaceGravatar brianosman2016-09-09
| | | | | | | | | | | | | | | We were effectively storing the transpose, which made all of our operations on individual colors, and our concatenation of matrices awkward and backwards. I'm planning to push this further into Ganesh, where I had incorrectly adjusted to the previous layout, treating colors as row vectors in the shaders. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2324843003 Review-Url: https://codereview.chromium.org/2324843003
* Delete SkColorSpace::gammaNamed() from public APIGravatar msarett2016-09-07
| | | | | | | | | Move fGammaNamed to SkColorSpace_Base. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2318663003 Review-Url: https://codereview.chromium.org/2318663003
* Revert of More robust check for sRGB gamma tables (patchset #2 id:60001 of ↵Gravatar msarett2016-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2263233003/ ) Reason for revert: From the previous commit message: "This check is not fast. If we find that it doesn't help us recognize sRGB curves, we should delete it." Turns out it doesn't help. Looks to me like the tables are not sRGB. Original issue's description: > More robust check for sRGB gamma tables > > This is in response to a UMA showing that 5% dst gammas are > unidentified tables. We want to see if some of these tables > should be marked as sRGB. > https://uma.googleplex.com/p/chrome/histograms?endDate=latest&dayCount=1&histograms=Blink.ColorSpace.Destination&fixupData=true&showMax=true&filters=isofficial%2Ceq%2CTrue&implicitFilters=isofficial > > This check is not fast. If we find that it doesn't help > us recognize sRGB curves, we should delete it. > > BUG=skia:5656 > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2263233003 > > Committed: https://skia.googlesource.com/skia/+/4ff08df15a8042cdb4fc90a82e1044847d0de300 TBR=mtklein@google.com,brianosman@google.com # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=skia:5656 Review-Url: https://codereview.chromium.org/2315863003
* Delete kInvalid_GammaNamed (part 2)Gravatar msarett2016-09-05
| | | | | | | | | We are done using this for UMA. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2306123002 Review-Url: https://codereview.chromium.org/2306123002
* Warn on bad rendering intents (instead of valid ones)Gravatar msarett2016-08-24
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2274843002 Review-Url: https://codereview.chromium.org/2274843002
* More robust check for sRGB gamma tablesGravatar msarett2016-08-22
| | | | | | | | | | | | | | | This is in response to a UMA showing that 5% dst gammas are unidentified tables. We want to see if some of these tables should be marked as sRGB. https://uma.googleplex.com/p/chrome/histograms?endDate=latest&dayCount=1&histograms=Blink.ColorSpace.Destination&fixupData=true&showMax=true&filters=isofficial%2Ceq%2CTrue&implicitFilters=isofficial This check is not fast. If we find that it doesn't help us recognize sRGB curves, we should delete it. BUG=skia:5656 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2263233003 Review-Url: https://codereview.chromium.org/2263233003
* Detect all named gammasGravatar msarett2016-08-22
| | | | | | | | | | | | | | | | | | | | | | | | Our DstColorSpace UMA is showing some named gammas that are not appropriately detected and placed in named categories. https://uma.googleplex.com/p/chrome/histograms?endDate=latest&dayCount=1&histograms=Blink.ColorSpace.Destination&fixupData=true&showMax=true&filters=isofficial%2Ceq%2CTrue&implicitFilters=isofficial This CL should fix that. I'm not sure (yet) how I feel about this landing permanently. Seems a little messy. But it will be interesting to see how this affects the UMA. My best guess is that we are hitting this case when all three gammas are "invalid" in different ways. I'm expecting to see some profiles end up in the "invalid" category now. It's also possible that we'll see these cases being absorbed into sRGB or somewhere else. BUG=skia:5656 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2261213002 Review-Url: https://codereview.chromium.org/2261213002
* Prevent overflows when using gamma_alloc_sizeGravatar gogil2016-08-14
| | | | | | | BUG=636268 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2230163002 Review-Url: https://codereview.chromium.org/2230163002
* Expose more gamma info for UMA statisticsGravatar msarett2016-07-27
| | | | | | | | TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2188633003 Review-Url: https://codereview.chromium.org/2188633003
* Miscellaneous color space refactorsGravatar msarett2016-07-21
| | | | | | | | | | | | | | | | (1) Use float matrix[16] everywhere (enables future code sharing). (2) SkColorLookUpTable refactors *** Store in a single allocation (like SkGammas) *** Eliminate fOutputChannels (we always require 3, and probably always will) (3) Change names of read_big_endian_* helpers BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2166093003 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review-Url: https://codereview.chromium.org/2166093003
* Refactor parsing and storage of SkGammasGravatar msarett2016-07-21
| | | | | | | | | | | | | | | | | Benefits: (1) Parses and stores gamma tags in a single allocation. (2) Recognizes equal gamma tags to skip parsing work and save memory. Non-Benefits: (1) Not less complicated. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2117773002 Committed: https://skia.googlesource.com/skia/+/2ea944c2b710caf29d4795ac953bad14224796f7 Committed: https://skia.googlesource.com/skia/+/959ccc1f3f49e1ddeb51c32c30ac4a2d94653856 Review-Url: https://codereview.chromium.org/2117773002