aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkColor.cpp
Commit message (Collapse)AuthorAge
* make most of SkColorPriv.h privateGravatar Cary Clark2017-09-15
| | | | | | | | | | | | | created new file src/core/SkColorData.h for internal consumption. Note that many of the functions there are unused as well. Bug: skia: 6898 R: reed@google.com Change-Id: I25bfd5a9c21f53558c4ca65a77eb5d322d897c6d Reviewed-on: https://skia-review.googlesource.com/46848 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com>
* remove unused SkPoint3 from SkColor.hGravatar Mike Reed2017-07-22
| | | | | | | | Bug: skia: Change-Id: Iba327a5604dc11525c4d8d0a535a7c417a1b8185 Reviewed-on: https://skia-review.googlesource.com/25961 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "treat SkPMColor as sRGB in SkPM4f::FromPMColor()"Gravatar Mike Klein2017-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a4f3e14d896708376aa50b2a8804796e6e1ee644. Reason for revert: affecting 565 in ways I didn't expect Original change's description: > treat SkPMColor as sRGB in SkPM4f::FromPMColor() > > We made the wrong call in SkPM4f::FromPMColor(). SkPM4f::FromPMColor() > is only used by the color correct drawing pipeline, not legacy. That > means it makes a lot more sense to treat SkPMColors as premul sRGB than > premul linear. > > You can see the effect very clearly in any code path using the fallback > SkShader::Context::shadeSpan4f(). We shade legacy 8888, then > "linearize" to float by calling SkPM4f::FromPMColor(). At head we're > not really linearizing, which means everything ends up too bright in the > end. Things get double sRGB-encoded, etc. > > It is expected that this CL will make many color correct images look > darker and a lot more like legacy mode. It may be jarring... we've > gotten used to seeing this bug and thinking brighter == fixed. > > The only GM that changes in actual legacy 8888 is gamut, which > explicitly creates non-legacy 8888 images... the diff there is expected. > > Change-Id: I77ac6cfe8f7ffb15e90f4aad798dbe8f9d3aafbd > Reviewed-on: https://skia-review.googlesource.com/15227 > Commit-Queue: Mike Klein <mtklein@chromium.org> > Reviewed-by: Herb Derby <herb@google.com> > Reviewed-by: Mike Reed <reed@google.com> > TBR=mtklein@chromium.org,herb@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I80d852cbb618e94744f786bc82a4648128e99c71 Reviewed-on: https://skia-review.googlesource.com/15300 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* treat SkPMColor as sRGB in SkPM4f::FromPMColor()Gravatar Mike Klein2017-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | We made the wrong call in SkPM4f::FromPMColor(). SkPM4f::FromPMColor() is only used by the color correct drawing pipeline, not legacy. That means it makes a lot more sense to treat SkPMColors as premul sRGB than premul linear. You can see the effect very clearly in any code path using the fallback SkShader::Context::shadeSpan4f(). We shade legacy 8888, then "linearize" to float by calling SkPM4f::FromPMColor(). At head we're not really linearizing, which means everything ends up too bright in the end. Things get double sRGB-encoded, etc. It is expected that this CL will make many color correct images look darker and a lot more like legacy mode. It may be jarring... we've gotten used to seeing this bug and thinking brighter == fixed. The only GM that changes in actual legacy 8888 is gamut, which explicitly creates non-legacy 8888 images... the diff there is expected. Change-Id: I77ac6cfe8f7ffb15e90f4aad798dbe8f9d3aafbd Reviewed-on: https://skia-review.googlesource.com/15227 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Make SkColorToHSV and SkHSVToColor "perfect" inversesGravatar Leon Scroggins III2017-01-11
| | | | | | | | | | | | | | | | | | For all possible opaque SkColors, make converting to HSV and back return the original SkColor. In SkHSVToColor, store values as normalized floats (instead of converting to byte values) as long as possible. Add a test that cycles through all opaque SkColors and verifies correct conversion. BUG=b/33737498 Change-Id: I7ff61a999a271565a9ffe82ae3c9676fc49d67e3 Reviewed-on: https://skia-review.googlesource.com/6720 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Added SkColor4f::FromColor3f(SkColor3f, float a)Gravatar dvonbeck2016-08-19
| | | | | | | | | Planning to use this for the ColorDisplay widget in https://codereview.chromium.org/2259183003/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2264643002 Review-Url: https://codereview.chromium.org/2264643002
* Correct sRGB <-> linear everywhere.Gravatar mtklein2016-07-20
| | | | | | | | | | | | | | | | | | | | | | This trims the SkPM4fPriv methods down to just foolproof methods. (Anything trying to build these itself is probably wrong.) Things like Sk4f srgb_to_linear(Sk4f) can't really exist anymore, at least not efficiently, so this refactor is somewhat more invasive than you might think. Generally this means things using to_4f() are also making a misstep... that's gone too. It also does not make sense to try to play games with linear floats with 255 bias any more. That hack can't work with real sRGB coding. Rather than update them, I've removed a couple of L32 xfermode fast paths. I'd even rather drop it entirely... BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2163683002 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/2163683002
* remove experimental treat-skcolor-as-srgb flagGravatar reed2016-06-24
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2097003003 Review-Url: https://codereview.chromium.org/2097003003
* Change SkColor4f to RGBA channel orderGravatar brianosman2016-06-24
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2093763003 Review-Url: https://codereview.chromium.org/2093763003
* WIP: runtime switch for how to interpret SkColor -vs- srgbGravatar reed2016-04-15
| | | | | | | | | | | | | | | | | | Still very conflicted about the "right" way to proceed with this, but thought I'd experiment with a runtime flag, so we can practice seeing SKPs in various stages of "srgb correctness". Other aspects to either fix, or at least provide runtime switches for: - untagged images - gradients - colorshader - drawVertices BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1891013002 TBR= Review URL: https://codereview.chromium.org/1891013002
* make pm4f be RGBA always, not pmcolor orderGravatar reed2016-03-08
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1774523002 Review URL: https://codereview.chromium.org/1774523002
* SkNx: kth<...>() -> [...]Gravatar mtklein2016-02-21
| | | | | | | | | | Just some syntax cleanup. No real change: kth<...>() was calling [...] already. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1714363002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review URL: https://codereview.chromium.org/1714363002
* make SkPM4f privateGravatar reed2016-02-18
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1713653002 Review URL: https://codereview.chromium.org/1713653002
* add kRGBA_F16_SkColorTypeGravatar reed2016-02-05
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1666343002 Review URL: https://codereview.chromium.org/1666343002
* extend compose-colorfilter to 4fGravatar reed2016-02-04
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1664663003 Review URL: https://codereview.chromium.org/1664663003
* SkNx Load/store: take any pointer.Gravatar mtklein2016-01-31
| | | | | | | | | | This means we can remove a lot of explicit casts in code that uses SkNx. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1650653002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review URL: https://codereview.chromium.org/1650653002
* float components in xfermodesGravatar reed2016-01-30
| | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1623483002 TBR=mtklein Review URL: https://codereview.chromium.org/1634273002
* starter procs for blending with pm4fGravatar reed2016-01-29
| | | | | | | | | | | | | | | | | | | | curr/maxrss loops min median mean max stddev samples config bench 8/8 MB 4 87.1µs 91µs 89.8µs 92µs 2% ▇▇▇▇█▇▅▁▁▁ nonrendering xfer4f_srcover_N_opaque_linear 9/9 MB 2 196µs 196µs 215µs 383µs 27% ▁▁▁▁█▁▁▁▁▁ nonrendering xfer4f_srcover_N_opaque_srgb 9/9 MB 1 313µs 313µs 313µs 313µs 0% ▁▄▅▅▅▂████ nonrendering xfer4f_srcover_N_alpha_linear 9/9 MB 1 580µs 580µs 582µs 602µs 1% ▁▁▁▁▁▁▂▁▁█ nonrendering xfer4f_srcover_N_alpha_srgb 9/9 MB 23 13.1µs 13.1µs 13.1µs 13.1µs 0% ▆▄▄█▂▂▂▁▂▁ nonrendering xfer4f_srcover_1_opaque_linear 9/9 MB 23 13.2µs 13.2µs 13.2µs 13.2µs 0% █▄▂▁▃▁▂▂▂▂ nonrendering xfer4f_srcover_1_opaque_srgb 9/9 MB 2 178µs 183µs 183µs 185µs 1% ▇▇▇█▇▇▇▇▇▁ nonrendering xfer4f_srcover_1_alpha_linear 9/9 MB 1 517µs 517µs 517µs 517µs 0% ▇█▄▃▄▁▂▁▂▄ nonrendering xfer4f_srcover_1_alpha_srgb BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1642703003 TBR= landing now so these incremental types/functions can be used to collaborate with herb's work. nothing is active at this point Review URL: https://codereview.chromium.org/1642703003
* Revert[2] of expand unitests for color4fGravatar reed2016-01-23
| | | | | | | | | | | This reverts commit 5f34e8ed82e6cbf29401bda5d423a50a2ab6db74. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1622983002 TBR= Review URL: https://codereview.chromium.org/1622983002
* Revert of expand unitests for color4f (patchset #1 id:1 of ↵Gravatar reed2016-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1622893002/ ) Reason for revert: leaking shadercontext in test Original issue's description: > expand unitests for color4f > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1622893002 > > TBR= > > Committed: https://skia.googlesource.com/skia/+/fac684502b6047ffc7dc2e59bd7e5a7cbfa5bf78 TBR= # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1622923002
* expand unitests for color4fGravatar reed2016-01-23
| | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1622893002 TBR= Review URL: https://codereview.chromium.org/1622893002
* Revert[2] of float color componentsGravatar reed2016-01-22
| | | | | | | | | | | | | This reverts commit 2a2bdc698460c38ac9e24ba4abdeefec67bcba37. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1622483002 TBR= NOTRY=True Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Release-Trybot seems wicked slow Review URL: https://codereview.chromium.org/1622483002
* Revert of experiment: float color components (patchset #6 id:100001 of ↵Gravatar reed2016-01-22
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1617813002/ ) Reason for revert: broke some colormatrix tests Original issue's description: > experiment: float color components > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1617813002 > > Committed: https://skia.googlesource.com/skia/+/353c148d8e8c9031daca34c6f9d6bcc6f08706c7 TBR=fmalita@chromium.org,mtklein@google.com,herb@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1623453002
* experiment: float color componentsGravatar reed2016-01-21
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1617813002 Review URL: https://codereview.chromium.org/1617813002
* Add special case circle blur for GaneshGravatar robertphillips2015-09-15
| | | | | | | | This makes the blurcircles bench go from ~33us to ~8us on Windows desktop. It will require layout test suppressions Review URL: https://codereview.chromium.org/1311583005
* IWYU: 'core' target, files starting A-C.Gravatar bungeman2015-08-05
| | | | | | | | | TBR=reed@google.com Verbal lgtm, does not change API. Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69 Review URL: https://codereview.chromium.org/1265033002
* Revert of IWYU: 'core' target, files starting A-C. (patchset #5 id:80001 of ↵Gravatar reed2015-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1265033002/ ) Reason for revert: revert to unblock DEPS roll ../../chrome/browser/chromeos/display/overscan_calibrator.cc:43:10: error: variable has incomplete type 'SkPath' SkPath base_path; Original issue's description: > IWYU: 'core' target, files starting A-C. > > TBR=reed@google.com > Verbal lgtm, does not change API. > > Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69 TBR=reed@google.com,mtklein@google.com,bungeman@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1273613002
* IWYU: 'core' target, files starting A-C.Gravatar bungeman2015-08-04
| | | | | | | TBR=reed@google.com Verbal lgtm, does not change API. Review URL: https://codereview.chromium.org/1265033002
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7406 2bbb7eff-a529-9590-31e7-b0007b416f81
* Result of running tools/sanitize_source_files.py (which was added in ↵Gravatar rmistry@google.com2012-08-23
| | | | | | | | | https://codereview.appspot.com/6465078/) This CL is part I of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6485054 git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
* Automatic update of all copyright notices to reflect new license terms.Gravatar epoger@google.com2011-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have manually examined all of these diffs and restored a few files that seem to require manual adjustment. The following files still need to be modified manually, in a separate CL: android_sample/SampleApp/AndroidManifest.xml android_sample/SampleApp/res/layout/layout.xml android_sample/SampleApp/res/menu/sample.xml android_sample/SampleApp/res/values/strings.xml android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java experimental/CiCarbonSampleMain.c experimental/CocoaDebugger/main.m experimental/FileReaderApp/main.m experimental/SimpleCocoaApp/main.m experimental/iOSSampleApp/Shared/SkAlertPrompt.h experimental/iOSSampleApp/Shared/SkAlertPrompt.m experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig gpu/src/android/GrGLDefaultInterface_android.cpp gyp/common.gypi gyp_skia include/ports/SkHarfBuzzFont.h include/views/SkOSWindow_wxwidgets.h make.bat make.py src/opts/memset.arm.S src/opts/memset16_neon.S src/opts/memset32_neon.S src/opts/opts_check_arm.cpp src/ports/SkDebug_brew.cpp src/ports/SkMemory_brew.cpp src/ports/SkOSFile_brew.cpp src/ports/SkXMLParser_empty.cpp src/utils/ios/SkImageDecoder_iOS.mm src/utils/ios/SkOSFile_iOS.mm src/utils/ios/SkStream_NSData.mm tests/FillPathTest.cpp Review URL: http://codereview.appspot.com/4816058 git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
* make inline version of premultiply, to speed up gradient creation.Gravatar reed@google.com2011-06-30
| | | | | | | | | | | We could speed-up again if we... - respected kDither and only built 1/2 of the table for non-dither requests - output simple params to the gpu rather than always a texture - detected that we have no alpha, and then can skip premul per-entry git-svn-id: http://skia.googlecode.com/svn/trunk@1772 2bbb7eff-a529-9590-31e7-b0007b416f81
* grab from latest androidGravatar reed@android.com2008-12-17
git-svn-id: http://skia.googlecode.com/svn/trunk@27 2bbb7eff-a529-9590-31e7-b0007b416f81