GrStrokeHardwareTessellator is the only user that needs to simply
check if a cusp exists at all. Making the check local speeds up the
microbench from 502us -> 392.
Bug: chromium:1172543
Change-Id: I52adf9ef0a66e1267435e6ce41f01ee1eda17d7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373744
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
The Viewer status box 's' is quite small on high resolution displays.
The 'u' key doubles its size and has been used as a work-around, but
let the status box scale take the backing scale into account.
Change-Id: I98db37a4ed86698ba7c02666478dff248ff6daae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374377
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This was added to Ganesh briefly in 2016 for an experiment, then
reverted, and never used.
Change-Id: I65849aff53acc14f9adc7585398fd09363a4ed65
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374376
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:11230
Change-Id: I509a20b1b1ffa17b125289f9619692638a13a621
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371964
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Cloned from http://review.skia.org/369716
Re-running the experiment now that @switch is supported when
optimizations are disabled.
Change-Id: I428051d9c679a8084589fba428a637f36587be16
Bug: skia:11341
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374516
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Also split out the rect test cases from convex_poly_effect into their
own GM that uses GrAARectEffect directly.
Make GrAARectEffect assert that the rect used is sorted and don't copy
inverted rect test cases to the new GM
Change-Id: Ida9847390af27ac2317d324a98bd11cc904f0e6b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374121
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
At IR generation time, this CL limits our optimizations to only
@switch statements. A regular switch statement will only be optimized
during the optimization phase even if the switch-value is a known
compile-time constant. This is done to avoid upsetting our reachability
analysis.
Most of this CL is moving existing logic from SkSLCompiler into
SkSLAnalysis and SkSLSwitchStatement. Although the diffs look large, the
actual changes are very small.
Change-Id: I90920f41bc386dfa7a980ae7510f6681231a5120
Bug: skia:11340, skia:11342, skia:11319
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372679
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This helps us find any issues with the promise image sharing.
Bug: skia:10286
Change-Id: I393655c2de76f896d9f376765894f84c015b2760
Cq-Include-Trybots: luci.skia.skia.primary:Fuzz-Debian10-Clang
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374317
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Bug: skia:10837
Change-Id: I33da2eb1e723ed04ab62d65c21e54306dd362bed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372677
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Rewrite as one cacheable runtime effect with uniforms paralleling
SkHighContrastConfig. This is mostly for style, in the sense of
readability but also how I'd recommend writing these effects generally:
one program body controlled by uniforms. Callers needing specialization
can write their own effect (or use our TBD uniform->constant facility).
Test isAlphaUnchanged(), and make it so by not saturating c.a.
MaliT880 was producing seriously bad results until I switched to mix().
Change-Id: Ia4cfef25fe26643f6832a5fa0843b28dafc5b284
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372295
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Change-Id: I10d561eec456a7917681d7bdf0b1bd2f5ee5ad5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374217
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This is the only place we provide a proxy from a SkImage other than
asView() and is only used in one place in the library. Add a utility
function to replace uses in tests based on asView().
Bug: skia:11208
Change-Id: Ica6eae6e5f153f208523331566acc0360925a20e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373617
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Rename factory function from createGLSLInstance() to makeProgramImpl()
Bug: b/180759848
Bug: skia:11358
Change-Id: I095bdf1f26db5a8192fa8ab59000db4a1d561d96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373738
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
The test inputs were removed at http://review.skia.org/360778
Change-Id: Ib2918f3f984cd80463bacb822ef510ee9feb1e77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373916
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This splits switch() construction into two stages.
- One version of Make takes an array of case-values and case-statement
lists, and is responsible for reporting errors if the case-values are
not unique or are improperly typed. This is what the IR generator or DSL
will start with on its first encounter with the switch statement.
- The other version of Make takes an array of already-processed
SwitchCases and can assume the invariant that they're all correctly-
typed with unique values. This is what we will have when a statement
is inlined or otherwise cloned. (We still assert this invariant, for
correctness' sake, but in release mode we assume it.)
This CL doesn't perform any optimizations at Make time yet; it does work
equivalent to how `switch` works in the IR generator today. It does
improve duplicate case-label checking slightly; duplicate case labels
are now reported, and duplicate `default:` labels are detected.
(Multiple `default` labels won't pass the parser, but they can be
constructed in DSL.)
Change-Id: I537ce2c8236152d58641fb1793619d66a62c01a8
Bug: skia:11342
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372616
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This will allow us to disable dead-code elimination and run performance
tests.
Change-Id: Ia98aa88e8db511e77ad2fb669af128f4510285ae
Bug: skia:11361
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374316
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
These were unused - we always enable the advanced blend equation
extension using "blend_support_all_equations" (if enabling the
extension is required at all).
Change-Id: I95fd6483ec54dfaf983290de95629fe0e86c22e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373877
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Constant propagation might be going away, but static-switches are likely
here to stay. Avoid conflating the two in this test.
Change-Id: If4b6c99c85f124d3bbc20da858693f09f5e4fd59
Bug: skia:11319
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374117
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
The optimizer now properly recognizes all types of exits from a switch
statement. Break, continue and return are all potential exits and need
to be considered when determining the exit path from the switch.
Previously, dead code elimination was hiding the effects of this bug
from us, but it meant that an optimized switch had the potential to
generate lots of worthless IR nodes which then needed to be detected and
eliminated by the CFG. In particular, this affected the enum form of
blend, causing a catastrophic amount of extra work to be done.
Change-Id: If857e38cadfc016884624ea4db25a273ad3dce5b
Bug: skia:11352
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372958
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Also rename //modules/canvaskit/canvaskit to //modules/canvaskit/npm_build
to make it more clear the purpose of that folder (what we ship to
npm and stage our builds for local testing).
Bug: skia:11203
Change-Id: I4299ded97d14f4155c36798d60e88a660ce6fe6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372392
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This allows the optimizer to remove it when the switch value is known,
instead of waiting for the dead-code-elimination pass to find it.
(If we decide to remove the dead-code-elimination pass entirely, this
will generate better code overall.)
Change-Id: I79a40eb3cfbc7e5d2f4879e1f98323248446483b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373876
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This had been previously deprecated.
Bug: skia:10717
Change-Id: Ic57ed835c13cfa7812099a3ef20ed7ff5aa62f7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371339
Reviewed-by: Nathaniel Nifong <nifong@google.com>
The Paragraph API is what should be used.
Bug: skia:10717
Change-Id: I135aff09bffae0718045b5c744f8e774e2ee1bce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371338
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
This intended to let us experiment w/ threaded compilation before having
to worry about upstreaming features.
Change-Id: Id9d1807de0fa16475184203d293e00bfaf5fcc01
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373736
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2be2469278..1a70e5a045
2021-02-22 syoussefi@chromium.org Add const to optional parameters of SPIR-V instruction builders
2021-02-22 syoussefi@chromium.org Vulkan: Refactor prerotation out of SPIR-V transformer
2021-02-22 syoussefi@chromium.org Vulkan: Refactor xfb codegen out of SPIR-V transformer
2021-02-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 3ab17bd731f6 to d85a7a27b272 (10 revisions)
2021-02-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from db0c2c83776b to fa63f1264116 (548 revisions)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC fmalita@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md
Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Tbr: fmalita@google.com
Change-Id: I285387c03db7fee8746978bbce990be75bdc54cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373902
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
This speeds up the microbench by ~20% (620us -> 502).
Bug: chromium:1172543
Change-Id: I926db1d8eec9bbf053cc3379053424f79aea3445
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373763
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This paves the way for promise image sharing among direct & recording
contexts, and untethers promise images from DDL recorder.
Followup CLs will migrate us to actually use this entry point,
and then migrate Chrome to do same.
Bug: skia:10286
Change-Id: I0ad46e8e4b91d8bc03cb039b304d2ea6d8a65c35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373716
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit 4a281dc8ee.
Reason for revert: may need to only do outsetting when no all aaflags are on.
Original change's description:
> Fix issues with insetting and outsetting quads.
>
> Need more degrees of freedom when moving 3D points to project to 2D
> points that don't fall on the projected quad edges.
>
> Need to check geometry subset in shader to avoid positive coverage in
> outset quads with nearly parallel edges.
>
> Bug: chromium:1177833
> Change-Id: I0759382d9221ba44aacd537254e08d9f2716a6af
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372196
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,michaelludwig@google.com
Change-Id: Idaddbdd767600a95405c028839eac4bf80a1361c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1177833
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373878
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This allows things to align better between the IR and DSL sides
and gives us equivalent error handling on both sides.
Change-Id: I6d5569e29df51a4d1a6cb0ad1e6611d419dfe30c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373737
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:11230
Change-Id: I7e065bfe1ba567396e242b45076b520f1aa3e414
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371963
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Need more degrees of freedom when moving 3D points to project to 2D
points that don't fall on the projected quad edges.
Need to check geometry subset in shader to avoid positive coverage in
outset quads with nearly parallel edges.
Bug: chromium:1177833
Change-Id: I0759382d9221ba44aacd537254e08d9f2716a6af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372196
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I672345116e3b5538c0f7e8c5f2f74aa56bb81e6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372676
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Adds quick accepts to the switch statement in
GrStrokeHardwareTessellator::prepare() that allow us to write out most
tessellation patches immediately. This avoids making function calls
into recursive methods as well as avoiding some of their checks that
aren't necessary the first time around.
Also adds a microbench that mimics the MotionMark "paths" benchmark
and measures our CPU-side prepare() time.
This shaves up to 30% off the microbenchmarks.
Bug: chromium:1172543
Change-Id: Idc93bebb79db9898a4ec241b1f6c8b9eb9ba7da3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372602
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>