This is just a name refactor and I'm happy to delay it until we're done
with the current wave of gradient CLs. The main ideas:
- we use the "linear_gradient" stages for all gradients,
so cut the "linear" and just call them "gradient";
- remind ourselves that the 2-stop stage requires even spacing, i.e.
stops at 0 and 1. This name should harmonize with Herb's new
general evenly spaced gradient stage, currently
"evenly_spaced_linear_gradient", and after it lands and I rebase,
"evenly_spaced_gradient"
- remind ourselves which polar coordinate xy_to_polar_unit returns,
the angle.
Change-Id: I0fd0c8bd4c1ead7d2d0fff45a199d318b71f34ac
Reviewed-on: https://skia-review.googlesource.com/16500
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
This reverts commit 892501d09b.
Reason for revert:
https://bugs.chromium.org/p/chromium/issues/detail?id=721682
:(
Original change's description:
> Evenly space gradient stage.
>
> This seems like an experiment at this point because I don't know how to do
> this kind of thing on arm.
>
>
> Numbers from Skylake...
> Before:
> ./out/Release/nanobench --config srgb \
> --match gradient_linear_clamp_3color gradient_linear_clamp_hicolor -q 19:48:13
> Timer overhead: 36.7ns
> ! -> high variance, ? -> moderate variance
> micros bench
> 439.92 ? gradient_linear_clamp_3color srgb
> 2697.60 gradient_linear_clamp_hicolor srgb
> 437.28 gradient_linear_clamp_3color_4f srgb
> 2700.50 gradient_linear_clamp_hicolor_4f srgb
>
>
> After:
> micros bench
> 382.35 gradient_linear_clamp_3color srgb
> 593.49 gradient_linear_clamp_hicolor srgb
> 382.36 gradient_linear_clamp_3color_4f srgb
> 565.60 gradient_linear_clamp_hicolor_4f srgb
>
>
> Numbers on my Mac Trashcan are about even; there is no
> speedup or slowdown between master and this change.
>
> Change-Id: I04402452e23c0888512362fd1d6d5436cea61719
> Reviewed-on: https://skia-review.googlesource.com/15960
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
>
TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com,fmalita@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: Ic6a064c66686b6f238ca1417ba1abd9ce25de1b4
Reviewed-on: https://skia-review.googlesource.com/16660
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Bug: skia:
Change-Id: Iab3dbb007ae67b5d82a727cb1fd5ced6b10b325a
Reviewed-on: https://skia-review.googlesource.com/16605
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Add some simple checks so we can tell whether a shadow's umbra is
completely covered by the occluder, partially covered, or less than
halfway covered.
Change-Id: I092281c4933bd0380946eb0fdd458ce04b0d713c
Reviewed-on: https://skia-review.googlesource.com/16603
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This seems like an experiment at this point because I don't know how to do
this kind of thing on arm.
Numbers from Skylake...
Before:
./out/Release/nanobench --config srgb \
--match gradient_linear_clamp_3color gradient_linear_clamp_hicolor -q 19:48:13
Timer overhead: 36.7ns
! -> high variance, ? -> moderate variance
micros bench
439.92 ? gradient_linear_clamp_3color srgb
2697.60 gradient_linear_clamp_hicolor srgb
437.28 gradient_linear_clamp_3color_4f srgb
2700.50 gradient_linear_clamp_hicolor_4f srgb
After:
micros bench
382.35 gradient_linear_clamp_3color srgb
593.49 gradient_linear_clamp_hicolor srgb
382.36 gradient_linear_clamp_3color_4f srgb
565.60 gradient_linear_clamp_hicolor_4f srgb
Numbers on my Mac Trashcan are about even; there is no
speedup or slowdown between master and this change.
Change-Id: I04402452e23c0888512362fd1d6d5436cea61719
Reviewed-on: https://skia-review.googlesource.com/15960
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
While we're refactoring how gradients work it's going to be easier
to centralized how and when we tile.
- PS2 changed linear and radial in place to alwys clamp.
- PS3 moved tiling to the base class, where it's even harder to
screw up. Sweeps don't need but don't mind tiling.
- PS4 clamps when iff evenly spaced
PS4 has image diffs for only a few GMs that I'm not familiar with.
If its logic reads as correct to you, they may be bug fixes?
Change-Id: I5e37d6e88aaea898356d4c57db0cd5bf414c0295
Reviewed-on: https://skia-review.googlesource.com/16501
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
1) Only store GrColors in GrTextUtils::Paint. We still store
premul and unpremul versions, but this is slightly clearer.
2) GrTextUtils::Paint also needs info from the render target
context to linearize and transform the color to dst space.
Bug: skia:6605
Change-Id: I6e12c55eafaecd2a090c82b4f56827401305bf3a
Reviewed-on: https://skia-review.googlesource.com/16486
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I8eb8cef5456c05a8e314d8404698893c7af82d13
Reviewed-on: https://skia-review.googlesource.com/16368
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We only are really interested in 8888 GMs for this bot.
Unit tests and other configs don't need to run.
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_FORCE_RASTER_PIPELINE_BLITTER
Change-Id: Iec4e5566cc27e82fea0d5832c514a5141ff80cfa
Reviewed-on: https://skia-review.googlesource.com/16499
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Eric Boren <borenet@google.com>
As we have factored things, we _do_ need to map y. This matrix maps us
back from dst to src space now, but not all the way to t.
We let the subclass inject its own logic for x,y -> t.
(Linear gradients do actually still do this by modifying the first
matrix rather than appending another matrix for x,y -> t. But in
general we cannot not map y here anymore.)
Change-Id: I2f9a87c7b510269a8b218a0247cbff416fe8d6c9
Reviewed-on: https://skia-review.googlesource.com/16495
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Bug: skia:
Change-Id: Id5e29b483c2b6f698219abfc5bbb2d858c4fc117
Reviewed-on: https://skia-review.googlesource.com/16427
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Enables debug output on iOS. Everything will work the
same except there will be more output for dm and nanobench.
This should help us flush out remaining flakiness and
will be removed once it's not necessary anymore.
Bug: skia:
Change-Id: Idfdc7cf829e93b905fdb0ac2bbab1e78250b7ae0
Reviewed-on: https://skia-review.googlesource.com/16491
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Stephan Altmueller <stephana@google.com>
Add a clamp value to indicate the percentage of the blurWidth to apply.
Change-Id: I962dc57ed786fa67ed1606b1148f1b2c568025e5
Reviewed-on: https://skia-review.googlesource.com/16424
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
When splitting the long edges for the ambient code, I wasn't adding
the corresponding triangle for the new point into the center region
for transparent occluders.
Change-Id: Ie2d1dcffbd701c0750d5da95e9d673b700a0e85a
Reviewed-on: https://skia-review.googlesource.com/16492
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Changing colons to parens permits
the error to be recognized, so that
clicking on it goes to the source
line with the assert.
R=reed@google.com
Change-Id: Ifec7fc0633e8ecf0f670418fefaf8ca87ee3d498
Reviewed-on: https://skia-review.googlesource.com/16485
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
And add some Test/Perf bots to try it out!
CQ_INCLUDE_TRYBOTS=skia.primary:Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_FORCE_RASTER_PIPELINE_BLITTER
Change-Id: I56ea2285f9fec2e468fae89673a545a717ab0f49
Reviewed-on: https://skia-review.googlesource.com/16423
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Bug: skia:
Change-Id: I9f5a5c1fda9cf26fc6479e1cd6d0e981e6991c8e
Reviewed-on: https://skia-review.googlesource.com/16426
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
When the clip mask is already A8, we don't need to convert explicitly.
Before:
792.72 clipmask_a8 8888
After:
560.06 clipmask_a8 8888
BUG=skia:6005
Change-Id: I9a319df9a82edfc9b412787a36f037bbe82c2825
Reviewed-on: https://skia-review.googlesource.com/16420
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Pixels no longer need to be locked.
TBR=reed@google.com
Bug: skia: 6481
Change-Id: I4b49f710add9134205d1520755b44bee308bd502
Reviewed-on: https://skia-review.googlesource.com/16113
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Mostly this is about extending the fallback in SkShader::appendStages()
to cover more cases, and making sure subclasses call appendStages() so
they can get the fallback, not onAppendStages() directly.
We still need to watch for SkShader::makeContext() failing in the
fallback itself, so sadly SkShader::appendStages() may still fail.
Change-Id: I2314b234a24bdcecac401a385ce050d7fdf0a83e
Reviewed-on: https://skia-review.googlesource.com/16369
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Bug: skia:
Change-Id: I116bec82783d297e91ef061217b5e61f7ff16a76
Reviewed-on: https://skia-review.googlesource.com/16371
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
We've been transforming the gamut after running the legacy shader,
but now that we have SkColorSpaceXformer, we can transform the
legacy shader into the dst color space instead.
This should be both more correct and faster.
Change-Id: If017048874e6cce46837d3ecbd88dfde503fd03a
Reviewed-on: https://skia-review.googlesource.com/16373
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Many SkShader subclasses are only friends to use makeColorSpace().
Our usual solution to this is to add a method on SkColorSpaceXformer
that calls makeColorSpace() for us, so that only SkColorSpaceXformer
needs to be a friend.
Just a refactor. No image diffs.
Change-Id: Icf952b739edf45f2fb8c0c35e353ef2866f4c5cc
Reviewed-on: https://skia-review.googlesource.com/16370
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Like three gray with alpha blends and taking the max alpha.
Change-Id: I104c84f784979030744127f8f66905ad9d1bdf0e
Reviewed-on: https://skia-review.googlesource.com/15898
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>