aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders
Commit message (Collapse)AuthorAge
...
* move checkLE functionality directly onto readbufferGravatar Mike Reed2018-01-26
| | | | | | | | Bug: skia: Change-Id: I549717f04e2e4cafc41ccbe13009805f47943d5d Reviewed-on: https://skia-review.googlesource.com/99703 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Fix some fuzzer bugs from Skia's image filter fuzzerGravatar Robert Phillips2018-01-23
| | | | | | | | Change-Id: I432b3a351eecca0d36635e37f91d32c0e281b7d9 Reviewed-on: https://skia-review.googlesource.com/98384 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com>
* IWYU -- SkShader.hGravatar Mike Reed2018-01-23
| | | | | | | | Bug: skia: Change-Id: I57bffc14c4888627a22158e35f3ac3b762138f02 Reviewed-on: https://skia-review.googlesource.com/98520 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Revert "simplify GrFPArgs, isolating localmatrix""Gravatar Mike Reed2018-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3d628fe00a7d6cf4a375d758e7436f104d11417d. Reason for revert: not needed for roll Original change's description: > Revert "simplify GrFPArgs, isolating localmatrix" > > This reverts commit b76c71702517643b5f6081991b376bbf73b34bde. > > Reason for revert: try to unblock android roller > > Original change's description: > > simplify GrFPArgs, isolating localmatrix > > > > Bug: skia: > > Change-Id: Icee24e0a355a7d1bae29b7721b4d95db8023ca77 > > Reviewed-on: https://skia-review.googlesource.com/97063 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Mike Reed <reed@google.com> > > TBR=bsalomon@google.com,reed@google.com > > Change-Id: Ic7a2288844cde57922b2cc74b855eb517ade48be > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/97580 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=bsalomon@google.com,reed@google.com Change-Id: I6f7b86b5a3243d4610371654624e5606e889adef No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/97584 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "simplify GrFPArgs, isolating localmatrix"Gravatar Mike Reed2018-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b76c71702517643b5f6081991b376bbf73b34bde. Reason for revert: try to unblock android roller Original change's description: > simplify GrFPArgs, isolating localmatrix > > Bug: skia: > Change-Id: Icee24e0a355a7d1bae29b7721b4d95db8023ca77 > Reviewed-on: https://skia-review.googlesource.com/97063 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=bsalomon@google.com,reed@google.com Change-Id: Ic7a2288844cde57922b2cc74b855eb517ade48be No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/97580 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* simplify GrFPArgs, isolating localmatrixGravatar Mike Reed2018-01-19
| | | | | | | | Bug: skia: Change-Id: Icee24e0a355a7d1bae29b7721b4d95db8023ca77 Reviewed-on: https://skia-review.googlesource.com/97063 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Reed <reed@google.com>
* rename inner AsFPArgs to stand-alone GrFPArgsGravatar Mike Reed2018-01-19
| | | | | | | | | | This prepares us to share this with other effects (most notably maskfilters) Bug: skia: Change-Id: I12530fdf10c4e5f2a9ab6d394bf9e87c54ea60c4 Reviewed-on: https://skia-review.googlesource.com/97062 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* remove code from old picture serial guardGravatar Mike Reed2018-01-19
| | | | | | | | Bug: skia: Change-Id: If50a76c7f570d6e88f6583d381d0354568398039 Reviewed-on: https://skia-review.googlesource.com/97060 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Reuse the CPU 2pt conical code in the GPU backendGravatar Yuqian Li2018-01-17
| | | | | | | | Bug: skia: Change-Id: I7e58c4faee018138ae6f93e92850a4e0a0126854 Reviewed-on: https://skia-review.googlesource.com/94041 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Remove legacy 2pt conical gradientGravatar Yuqian Li2018-01-16
| | | | | | | | Bug: skia:7459 Change-Id: Iccc2588f80e22b13ed5d23656b8c75d7b7058a36 Reviewed-on: https://skia-review.googlesource.com/92700 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Remove DumpHelper as the bug is fixedGravatar Yuqian Li2018-01-09
| | | | | | | | Bug: skia:7436 Change-Id: I1dd09eb2b2d07f13b1ace01259791d8e0ce26ae8 Reviewed-on: https://skia-review.googlesource.com/92702 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Add GrProxyProviderGravatar Robert Phillips2018-01-08
| | | | | | | | | This pulls all the proxy tracking & creation functionality out of the GrResourceCache and GrResourceProvider and consolidates it in the GrProxyProvider. Change-Id: I7256f7c544319a70c1bd93dd5a9ccbe5fa0a544f Reviewed-on: https://skia-review.googlesource.com/91501 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Update 2pt conical gradient in raster pipelineGravatar Yuqian Li2018-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | The updated algorithm matches our new GPU algorithm (https://skia.org/dev/design/conical) and it brings about 7%-26% speedup. In the next CL, I'll simplify the GPU code by reusing the CPU code in this CL. 7.20% faster in gradient_conical_clamp_hicolor 8.94% faster in gradient_conicalZero_clamp_hicolor 10.00% faster in gradient_conicalOut_clamp_hicolor 11.72% faster in gradient_conicalOutZero_clamp_hicolor 13.62% faster in gradient_conical_clamp_3color 16.52% faster in gradient_conicalZero_clamp_3color 17.48% faster in gradient_conical_clamp 17.70% faster in gradient_conical_clamp_shallow 20.60% faster in gradient_conicalOut_clamp_3color 20.98% faster in gradient_conicalOutZero_clamp_3color 21.79% faster in gradient_conicalZero_clamp 22.48% faster in gradient_conicalOut_clamp 26.13% faster in gradient_conicalOutZero_clamp Bug: skia: Change-Id: Ia159495e1c77658cb28e48c9edf84938464e501c Reviewed-on: https://skia-review.googlesource.com/90262 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Revert "Revert "remove legacy support for old old picture versions""Gravatar Mike Reed2018-01-03
| | | | | | | | | | | | This reverts commit 6f1151140f331c78d99ede3cac10462dc8b32cde. Chrome has been updated, so this should be able to land. Bug: skia: Change-Id: I5a66782a39fecfac00edeb66fbd03dae4df1712c Reviewed-on: https://skia-review.googlesource.com/90205 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* remove unneeded readbuffer flagsGravatar Mike Reed2018-01-03
| | | | | | | | | | | - buffers are always 'cross-process' - readbuffer is always validating Bug:796107 Change-Id: I59614e9c29490c0b029c60d2aafe2806671bc9e1 Reviewed-on: https://skia-review.googlesource.com/90560 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Changes to make 2pt gradient source code better aligned with our future docGravatar Yuqian Li2018-01-02
| | | | | | | | | | See https://skia-review.googlesource.com/c/skia/+/89340 for the doc Bug: skia: Change-Id: I7a57eea317bbc424278c9eaa524a6b7e3b36178e Reviewed-on: https://skia-review.googlesource.com/90203 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Stronger fix for swapping r0, r1 in 2pt conical gradientsGravatar Yuqian Li2018-01-02
| | | | | | | | Bug: chromium:798173 Change-Id: I2ac0ee94ecc6230fd450c17b6a0de9065f5b3f16 Reviewed-on: https://skia-review.googlesource.com/90202 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "remove legacy support for old old picture versions"Gravatar Mike Reed2017-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f3504d430cec35330017aa2af3a51083801c7dd9. Reason for revert: breaks unittest in Printing unittest in chrome Original change's description: > remove legacy support for old old picture versions > > Bug: skia: > Change-Id: Ieb97eabdb18e8c7bfa86e6a1fc6e0389cd096daa > Reviewed-on: https://skia-review.googlesource.com/89860 > Reviewed-by: Florin Malita <fmalita@chromium.org> > Commit-Queue: Mike Reed <reed@google.com> TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com Change-Id: I9f90da5dcfb9543f2f575fa7dc3b9c82996b041d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/90020 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* remove legacy support for old old picture versionsGravatar Mike Reed2017-12-29
| | | | | | | | Bug: skia: Change-Id: Ieb97eabdb18e8c7bfa86e6a1fc6e0389cd096daa Reviewed-on: https://skia-review.googlesource.com/89860 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Fix bug of a + (b - a) == 0 for small positive b and huge a (e.g., 1e18)Gravatar Yuqian Li2017-12-28
| | | | | | | | | | | | | | I am unable to make a MSAN build to work locally. But I think that this should fix the problem by looking at the gradient of the fuzzer: Z.createRadialGradient(1.94159387872, 138.616510533, 2.22085316544e+18, 10.3399911492, 176.149195942, 153.078363987); Bug: chromium:797184 Change-Id: I16c571a378742c4ef50afe9c5baba791da7fc208 Reviewed-on: https://skia-review.googlesource.com/89541 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Fix conical test where r1 = r2 = 0Gravatar Yuqian Li2017-12-27
| | | | | | | | Bug: skia:7436 Change-Id: I0fdbd458d4e2da53e587be27ac90fbb2d32584e5 Reviewed-on: https://skia-review.googlesource.com/89520 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* attempt 3: add experimental bilerp_clamp_8888 stageGravatar Mike Klein2017-12-22
| | | | | | | | | | | | | | | | | | | | | | It looks like we can specialize hot image shaders into their own single stages for a good speedup on both x86 and ARM. I've started here with bilerp_clamp_8888, and will follow up with bgra and 565, and lowp versions of those, and probably also the same for nearest neighbors. All pixels are identical in GMs. This time, rewrite the loop over sample points to be a little friendlier to 32-bit x86 code generation. The previous version created an object file indirection feature build_stages.py can't handle. CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-All-Android,Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android Change-Id: I150b6af4a5b89e009dc04ca69e1857892e173deb Reviewed-on: https://skia-review.googlesource.com/89180 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Debug random 2pt conical shadersGravatar Yuqian Li2017-12-21
| | | | | | | | Bug: skia:7436 Change-Id: I5131c7f1208f04e6145c0bc11454ef0c39ce8e2f Reviewed-on: https://skia-review.googlesource.com/88426 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Reland "remove bicubic clamp in SkImageShader"Gravatar Mike Klein2017-12-21
| | | | | | | | | | | | | | | | | | | | | | This is a reland of bc9f3499c345ce59f8cd3889c580fa75db54034b Original change's description: > remove bicubic clamp in SkImageShader > > We ought to be able to handle out-of-gamut colors now, whatever > their provenance. Should be we can just not clamp here. > > Bug: skia:5733 > > Change-Id: Icd9851543638fd81755afee2eac2347702b88e9f > Reviewed-on: https://skia-review.googlesource.com/87000 > Commit-Queue: Mike Klein <mtklein@chromium.org> > Reviewed-by: Brian Osman <brianosman@google.com> Bug: skia:5733 Change-Id: I66dafdb12abdb02e8677a6f6b18602a2fa3f5f8b Reviewed-on: https://skia-review.googlesource.com/88760 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "remove bicubic clamp in SkImageShader"Gravatar Mike Klein2017-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bc9f3499c345ce59f8cd3889c580fa75db54034b. Reason for revert: gotta be the reason for layout test issues. Original change's description: > remove bicubic clamp in SkImageShader > > We ought to be able to handle out-of-gamut colors now, whatever > their provenance. Should be we can just not clamp here. > > Bug: skia:5733 > > Change-Id: Icd9851543638fd81755afee2eac2347702b88e9f > Reviewed-on: https://skia-review.googlesource.com/87000 > Commit-Queue: Mike Klein <mtklein@chromium.org> > Reviewed-by: Brian Osman <brianosman@google.com> TBR=mtklein@chromium.org,brianosman@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:5733 Change-Id: I3bccf494479b845210ee2a6824dcc32b89a93312 Reviewed-on: https://skia-review.googlesource.com/88423 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Guard the sqrt(temp) where temp < 0 in 2pt conical gradientGravatar Yuqian Li2017-12-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although Linux and Android will return NAN, iOS and some some Win10 devices would return undefined values. This relands 82161 (with the fix mentioned above). The speedup is a little less due to the additional temp < 0 check. 4.08% faster in gradient_conicalOutZero_clamp 6.83% faster in gradient_conical_clamp_shallow_dither 9.43% faster in gradient_conicalOutZero_clamp_3color 12.66% faster in gradient_conicalOut_clamp_hicolor 16.67% faster in gradient_conicalOut_clamp_3color 17.83% faster in gradient_conicalOut_clamp and the speedup is further reduced because we break up the if with two conditions into two ifs with single condition: 7.32% faster in gradient_conical_clamp_shallow_dither 8.00% faster in gradient_conicalOut_clamp_hicolor 8.57% faster in gradient_conicalOut_clamp 8.73% faster in gradient_conicalOut_clamp_3color CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android,Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android,Test-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Debug-All-CommandBuffer Change-Id: I41fb8d97e31c577b52a200f0b883591c9bdc4d1c Reviewed-on: https://skia-review.googlesource.com/84963 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* remove bicubic clamp in SkImageShaderGravatar Mike Klein2017-12-20
| | | | | | | | | | | | We ought to be able to handle out-of-gamut colors now, whatever their provenance. Should be we can just not clamp here. Bug: skia:5733 Change-Id: Icd9851543638fd81755afee2eac2347702b88e9f Reviewed-on: https://skia-review.googlesource.com/87000 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* Revert "attempt 2: add experimental bilerp_clamp_8888 stage"Gravatar Mike Klein2017-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8a64e52a98d178be13fd137b3b3a3c6aff457d85. Reason for revert: Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-All-Android Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android Original change's description: > attempt 2: add experimental bilerp_clamp_8888 stage > > It looks like we can specialize hot image shaders into their > own single stages for a good speedup on both x86 and ARM. > > I've started here with bilerp_clamp_8888, and will > follow up with bgra and 565, and lowp versions of those, > and probably also the same for nearest neighbors. > > All pixels are identical in GMs. > > Change-Id: Ib5ed6e528efd9e3eed96ba67d02fbec2e8133a81 > Reviewed-on: https://skia-review.googlesource.com/86860 > Reviewed-by: Mike Klein <mtklein@chromium.org> > Commit-Queue: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,liyuqian@google.com Change-Id: I34409a7b4aee4fd54baee44f7fc53bd0982500fe No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/86601 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* attempt 2: add experimental bilerp_clamp_8888 stageGravatar Mike Klein2017-12-18
| | | | | | | | | | | | | | | | It looks like we can specialize hot image shaders into their own single stages for a good speedup on both x86 and ARM. I've started here with bilerp_clamp_8888, and will follow up with bgra and 565, and lowp versions of those, and probably also the same for nearest neighbors. All pixels are identical in GMs. Change-Id: Ib5ed6e528efd9e3eed96ba67d02fbec2e8133a81 Reviewed-on: https://skia-review.googlesource.com/86860 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove append_from_srgb()Gravatar Mike Klein2017-12-18
| | | | | | | | | | | It's now no different than append(from_srgb). Bug: skia:7419 Change-Id: I97c59b6987f033ec2f1859db40ca3056b87b370a Reviewed-on: https://skia-review.googlesource.com/86741 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Remove SkClampRange (unused)Gravatar Brian Osman2017-12-14
| | | | | | | | Bug: skia: Change-Id: I57fbdd39079a92e803902524a7950dd5f571639c Reviewed-on: https://skia-review.googlesource.com/84961 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Reimplement TwoPointConicalGradient_gpu"Gravatar Yuqian Li2017-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 84f18c422ae98085c452d3f721ec32228e92f531. Reason for revert: GMs are incorrect on some mobile devices Original change's description: > Reimplement TwoPointConicalGradient_gpu > > 4.24% faster in gradient_conical_clamp_shallow_dither > 6.43% faster in gradient_conicalOutZero_clamp_hicolor > 10.41% faster in gradient_conicalOut_clamp_hicolor > 14.85% faster in gradient_conicalOutZero_clamp_3color > 16.72% faster in gradient_conicalOut_clamp > 24.30% faster in gradient_conicalOut_clamp_3color > > CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android,Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android > > Bug: skia: > Change-Id: I6bc1f24c9463fc9c2acbcba7bd4d55b37ade1613 > Reviewed-on: https://skia-review.googlesource.com/82161 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=egdaniel@google.com,fmalita@google.com,liyuqian@google.com Change-Id: Ieb20cce12a958abb8293218b89baf3d5a2aad0a8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Cq-Include-Trybots: skia.primary:Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android, Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android Reviewed-on: https://skia-review.googlesource.com/84801 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Reimplement TwoPointConicalGradient_gpuGravatar Yuqian Li2017-12-13
| | | | | | | | | | | | | | | | | 4.24% faster in gradient_conical_clamp_shallow_dither 6.43% faster in gradient_conicalOutZero_clamp_hicolor 10.41% faster in gradient_conicalOut_clamp_hicolor 14.85% faster in gradient_conicalOutZero_clamp_3color 16.72% faster in gradient_conicalOut_clamp 24.30% faster in gradient_conicalOut_clamp_3color CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android,Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android Bug: skia: Change-Id: I6bc1f24c9463fc9c2acbcba7bd4d55b37ade1613 Reviewed-on: https://skia-review.googlesource.com/82161 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Yuqian Li <liyuqian@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>
* Use first/second instead of min/max in 2pt conical gradientGravatar Yuqian Li2017-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | Here's the tiny performance gain: $python tools/calmbench/calmbench.py firstsecond --extraarg "-m conic" firstsecond (compared to master) is likely 4.23% faster in gradient_conicalOut_clamp_3color 4.23% faster in gradient_conicalOutZero_clamp_3color 4.79% faster in gradient_conical_clamp_shallow_dither 6.04% faster in gradient_conical_clamp_3color 6.04% faster in gradient_conicalZero_clamp_3color 6.42% faster in gradient_conicalOut_clamp 6.43% faster in gradient_conicalOutZero_clamp 6.74% faster in gradient_conical_clamp 6.98% faster in gradient_conical_clamp_shallow 6.98% faster in gradient_conicalZero_clamp Bug: skia: Change-Id: Id74866908b99753ed8b16a657d3f67c9255d0043 Reviewed-on: https://skia-review.googlesource.com/76561 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Revert "add experimental bilerp_clamp_8888 stage"Gravatar Mike Klein2017-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a7fa3377d24643d86117159f8a58d2ee66880a4d. Reason for revert: lots of crashing GPU bots. Original change's description: > add experimental bilerp_clamp_8888 stage > > It looks like we can specialize hot image shaders into their > own single stages for a good speedup on both x86 and ARM. > > I've started here with bilerp_clamp_8888, and will > follow up with bgra and 565, and lowp versions of those, > and probably also the same for nearest neighbors. > > All pixels are identical in GMs. > > Change-Id: I2f6995767cd38053d670b8d0bfdb71b687803d70 > Reviewed-on: https://skia-review.googlesource.com/82100 > Reviewed-by: Yuqian Li <liyuqian@google.com> > Commit-Queue: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,mtklein@google.com,liyuqian@google.com Change-Id: If70abb91b69bcd781e395dd3ac05ff1eebb1169f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/83340 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* add experimental bilerp_clamp_8888 stageGravatar Mike Klein2017-12-11
| | | | | | | | | | | | | | | | It looks like we can specialize hot image shaders into their own single stages for a good speedup on both x86 and ARM. I've started here with bilerp_clamp_8888, and will follow up with bgra and 565, and lowp versions of those, and probably also the same for nearest neighbors. All pixels are identical in GMs. Change-Id: I2f6995767cd38053d670b8d0bfdb71b687803d70 Reviewed-on: https://skia-review.googlesource.com/82100 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Add cap on intel to avoid calling abs and floor on the same line in aGravatar Greg Daniel2017-12-02
| | | | | | | | | | | | | | | | | | | | shader. This fixes a bug on some intel devices where we are failing in the ProcessorOptimizationTest. I've tried other "no op" type things between the floor call and abs which also fixed the issue, as well as adding explicit checks to see if we are less than -1 or greater than 1 where the clamp is. Thus the clamp itself should be a no op and shouldn't secretly be fixing the problem outside of forcing the floor and abs lines to be separate. Bug: skia: Change-Id: I85bf82e0e02607b78470b7a5f8f918e9f53f0154 Reviewed-on: https://skia-review.googlesource.com/76820 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* remove unused readBitmapAsImage from readbufferGravatar Mike Reed2017-11-28
| | | | | | | | Bug: skia: Change-Id: Ic200ec39999a06f407de29e15b646baddb9e341d Reviewed-on: https://skia-review.googlesource.com/76982 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* converted ConstColorProcessor to SkSLGravatar Ethan Nicholas2017-11-20
| | | | | | | | Bug: skia: Change-Id: Ic3b18f82c1ab940637fb26dec1cf376dd859b35d Reviewed-on: https://skia-review.googlesource.com/73720 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
* Simplify analytical GPU gradient implsGravatar Florin Malita2017-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) reformulate the gradient data as a series of interpolation intervals, defined as tuples of (color_scale, color_bias) such that color(t) = t * color_scale + color_bias (this allows us to skip the relative_t computation and simply feed tiled_t into a fast MAD) 2) then, the existing specializations can be generalized as a) select an interpolation interval (possibly based on a threshold) b) compute the interpolated color using the method in #1 3) simplify the hard-edge cases by using clamp intervals (color_scale == 0) and relaxing the clamping step (allowing tiled_t < 0 or tiled_t > 1, in order to hit the clamping intervals during the selection step) The existing specializations are converted as follows: * kTwo_ColorType -> single interpolation interval, normal clamping * kThree_ColorType -> two interpolation intervals, normal clamping, threshold == pos[1] * kSingleHardStop_ColorType -> two interpolation intervals, normal clamping, threshold == pos[1/2] * kHardStopLeftEdged_ColorType -> two interpolation intervals, clamping (-inf, 1], threshold == 0 * kHardStopRightEdged_ColorType -> two interpolation intervals, clamping [0, +inf), threshold == 1 This reduces the SkSL overhead in a couple of ways: * the clamp stage is sometimes reduced to min/max vs. full clamp() * the color interpolation stage is just a MAD vs. full mix() Change-Id: I65be84d131d56136ec5e946c2b3dba149a4473cf Reviewed-on: https://skia-review.googlesource.com/68218 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Remove SK_SUPPORT_LEGACY_UNIFORM_GRADIENTSGravatar Florin Malita2017-11-06
| | | | | | | | | | All clients are now switched over. Change-Id: Idfdb910241ab9f7c2caf5baf59e9c3277aef164f Reviewed-on: https://skia-review.googlesource.com/67846 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Detect explicit uniform gradient positionsGravatar Florin Malita2017-11-04
| | | | | | | | | | | | | | | | | | When the color stop positions are uniform, the client is allowed to not specify them (implicit positions, signaled by a null |pos| pointer). This enables some internal optiomizations and yields improved rasterization times. But if the client does pass explicit uniform positions, we currently treat them as general/non-uniform. Detect explicit uniform color stop positions at construction time, and drop them - to ensure optimal treatment downstream. Change-Id: I32ee86daa652622de2936a6f47acb68b64e0b70a Reviewed-on: https://skia-review.googlesource.com/67765 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Remove SK_SUPPORT_LEGACY_GRADIENT_COLOR_CONVERSIONGravatar Florin Malita2017-11-03
| | | | | | | | | | | | The original change didn't produce any diffs, so this flag is not useful. TBR= Change-Id: Ic4c8d6dcd7d03ace8624345fd624bc5840b99d27 Reviewed-on: https://skia-review.googlesource.com/67724 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Enforce gradient color stop monotonicity in ctorGravatar Florin Malita2017-11-03
| | | | | | | | | | | | | | From the SVG 1.1 spec: Each gradient offset value is required to be equal to or greater than the previous gradient stop's offset value. If a given gradient stop's offset value is not equal to or greater than all previous offset values, then the offset value is adjusted to be equal to the largest of all previous offset values. Change-Id: I797369a1e14dc776ceb6478ac9fcdd4792e65562 Reviewed-on: https://skia-review.googlesource.com/67761 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Remove gradient onGetGLSLProcessorKey() overridesGravatar Florin Malita2017-11-03
| | | | | | | | | | | None of the gradient processor subclassess contributes anything to the base class key. Relocate the key logic to GrGradientEffect, and remove unneeded builerplate. Change-Id: I6b33ad359212579adedf95c0c3d481373c83d4c4 Reviewed-on: https://skia-review.googlesource.com/67721 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Streamline legacy gradient color conversionGravatar Florin Malita2017-11-01
| | | | | | | | | | | | | | | | To produce colors for interpolation in legacy mode, we currently do something like SkColor c = Sk4f_toS32(swizzle_rb(Sk4f::Load(c4f))); color4f = swizzle_rb(SkNx_cast<float>(Sk4b::Load(&c)) * (1/255.0f)); Let's see if we can streamline some of that. Change-Id: I423b5aa8c2df8d115cc236d5f0a2e79923a9c2cc Reviewed-on: https://skia-review.googlesource.com/66142 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* Gradient cleanup passGravatar Florin Malita2017-11-01
| | | | | | | | | | | 1) replace manual storage management with SkAutoSTMalloc 2) simplify explicit positions processing (remove redundant branch) Change-Id: I7841e2018ac421768ed1d61c4e3ef6a1d28f6244 Reviewed-on: https://skia-review.googlesource.com/66146 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Don't store legacy colors in gradient shadersGravatar Florin Malita2017-10-31
| | | | | | | | | | | | We only pass linear/4f colors to the ctor, and then derive the legacy colors from them. Might as well just derive when needed. Change-Id: I82b3d159da91f6faa4a3e7d681763c0ec1cdab07 Reviewed-on: https://skia-review.googlesource.com/65680 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* Add support for transfer functions to GrColorSpaceXformGravatar Brian Osman2017-10-31
| | | | | | | | | | | | | | | | | | | With this change, untagged sources (eg N32) are treated as sRGB data, which causes a huge number of GMs to render more correctly in GPU sRGB/F16/etc... configs. Also, because the sources are treated as having a color space, we actually do gamut conversion for wide or narrow gamut outputs. This change also applies the transfer function math to individual colors in the case of gradient stops and color shaders. (The CPU backend doesn't do this yet, but I think we've decided there's no reason not to support it). Bug: skia: Change-Id: If76e9e4a268f9f74110ff4bbe4fe189ba5d19d9f Reviewed-on: https://skia-review.googlesource.com/64100 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>