Change-Id: I6097f50e7be1fa2f7772f6c454410ecbf3470eea
Bug: skia:10722
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316977
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
The following conditions lead to the error:
- A pair of nested functions, both of which must be inlined.
- Both inlined functions create a variable with the same name.
- The outer function passes its variable to the inner function.
- The initialization of the inner variable uses the value from the outer
variable.
- The inner function does not mutate the variable, use it as an out-
parameter, or otherwise cause it to receive a temporary copy.
When all these conditions are met, both variable declarations are
inlined as-is without performing any name salting, because it's
seemingly safe to do so. The name overlap issue is not considered in the
safety checks. Inlined variable declarations are not subject to name
salting but they should be; I suspect other adversarial examples could
be crafted as well where unhandled name overlap leads to errors.
Change-Id: Ia754bee8e45c8a5c7548436594bbf04abc7a8396
Bug: skia:10722
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316945
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
I have been hacking around on Bazel more today,
and while I think it was a day well spent, I've
got intentionally nothing to commit except notes.
Change-Id: I711eaf403e447aff5b19830d3ed8c5132c98c469
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316910
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
The new test files are intended to be identical to the unit tests in
every meaningful way. (Comments and formatting are not preserved
exactly.) In cases where a unit-test method contained more than one
test, multiple test files were created; in these cases, new names were
invented to match the apparent intent of each invocation.
Followup CLs will continue to migrate additional tests.
Change-Id: I785c6761ba7ee2b25b5ddc0108321734be23b77c
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316678
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: I56e19153597e2c4393c5821314b82937828c0d50
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316569
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This can be re-enabled once the Metal bug with fp_sample_chaining is
diagnosed and fixed.
A pure rollback led to a merge conflict; just commenting out the line
that invokes the inliner serves the same purpose.
Change-Id: I4df556ea8cd44349cbca2ea0ec9995dfffeb8aec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316937
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This is also the final wire to connect, so with this CL we will try
using input attachments for dst blends in available.
Bug: skia:10409
Change-Id: I8bd953ea5eb056a55d8bf36d91008a9d7298d84d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315650
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
We always reset the entire command pool so we don't need to create the
pool with support for resetting individual command buffers. This may
or may not give us perf and/or memory wins.
Change-Id: I172362b49444a80f4e91958120d165c130598a98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316656
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Fixes a use-after-free where switch statements were replaced by the
statically-determined case, but there were other (later) blocks in the
list that still had pointers into the no-longer-valid cases.
Bug: oss-fuzz:25554
Change-Id: I23b80d66d49a251b59ce02d74f31996858c04395
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316876
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:10679
Change-Id: If464c48b7c31d0d8440d1231d1983829d54ce598
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315281
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This should fix the chrome roll.
Change-Id: I2de68f972996bf6124cf5cc27dfd538aa1161057
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316877
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This change is in response to the perf regessions we saw when we started
using less dedicated allocations.
Bug: chromium:1127358
Change-Id: Ie0cbf546b92d344712e32b5fc8e56837f49fed67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316836
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
We still occasionally downcast, so this is not airtight,
but it (1) allows us to know where we are downcasting and
(2) lets us move away from GrContext (and hopefully remove
it sooner than later.)
All three canaries are currently broken =( so here we go!
Bug: skia:104662
Change-Id: I84efe132574690b62ea512e194e4f9e318e9c050
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316218
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
separate step.
This ended up uncovering an optimization bug. SkSLNonConstantCase
started failing; it turns out that the optimizer was never being run on
this test, and so we hadn't noticed that it didn't actually work in the
presence of optimization.
Change-Id: Iff1d330be7534113b86f86b00c39f91282903ae3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316568
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This partially unblocks Chrome from migrating from
SkCanvas-getGrContext to SkCanvas-recordingContext.
Change-Id: I1100387497ba8b482005bb1d147e9768590afe95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316449
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Bug: skia:10409
Change-Id: I90c83e03616b76adb887c087f7f22941bd776d8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316356
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
A few first steps toward a Bazel build.
To try it out, I think just
$ bazel test ...
I added third_party to .bazelignore to prevent Bazel from looking there.
It can handle external dependencies itself, so no need to poke into what
we sync from DEPS. Some of those have Bazel configs and we don't want
to be building them yet.
I've started by with libpng using new_git_repository(), mostly because
it's small, with a mildly complex build, and needs dependencies of its
own, zlib. Mysteriously zlib is built-in to Bazel, so that was easy.
Next up is probably a dependency that does support Bazel, using
git_repository(). That should make sure we can handle the full mix.
Change-Id: I5775a1b254d341b9a90630aa1cc433a24167f2fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316636
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Golden SkSL outputs are intended to eventually replace the majority of
our unit tests, since they can automatically update themselves when we
change implementation details of the compiler.
If you change the compiler output without updating the Golden files, the
CheckGeneratedFiles housekeeper will be triggered. Set
`skia_compile_processors` or `skia_compile_sksl_tests` to true in your
GN args to regenerate them.
Almost all of the tests from SkSLFPTests.cpp and SkSLGLSLTests.cpp can
be migrated into separate unit-test .fp/.sksl files in a followup CL.
hcm@ has signed off on removing the copyright boilerplate preamble from
our unit test files.
Change-Id: I9e24a944bbac8f8efd62c92481b022a0b1ecdd0b
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316336
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
In this CL, the IR generator still performs inlining as well; this will
be removed in a followup CL. However, the optimization pass is able to
find more inlining opportunities because it allows itself to exceed
the 50-IRNode limit when a function is only used once. In our test code
this is uncommon, but in SkSL generated from trees of fragment
processors, it is very common; any FP that is only sampled once tends
to qualify.
Change-Id: I8b2f653b2dd05d4de18bb15f3a4c1f034b8252ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315639
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
We had several defines around the code base that were not
very descriptive. Additionally, we had a patch of extra
runtime restrictions living in oss-fuzz that were applied
when fuzzing over there for some fuzzers.
This has all be consolidated and controlled via the defines
documented in site/dev/testing/fuzz.md
As such, we can remove one of the patches that is in oss-fuzz,
taking us closer to being able to fuzz in the CI/CQ.
PS 1 renames existing fuzz defines to the new schema.
PS 2-3 backports skia.diff from oss-fuzz and changes those
definitions to have the _GREATLY modifier.
PS 5+ further condenses the defines so that there is one
define for gating the runtime checks.
Change-Id: Ia4ad96f30c1e9620a2123b510e97c6f501a2e257
Docs-Preview: https://skia.org/?cl=316443
Bug: skia:10713
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316443
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Disambiguates Switch from SwitchCase, and makes is() and as() work.
Change-Id: I9b9b71dabd730247b20ec9b6df02b87e4978d534
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316577
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Allows the user to limit the stream to a subset of the entire file.
SkFILEStream uses the current FILE position as the base position for the
stream; this allows the user to further limit the length of the stream
to a range of bytes in the file.
Change-Id: I36131ff19e75b65d501eabdfd9368f8fbb2e177f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316357
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Rename fSize to fEnd (since it is actually the offset of the end
underlying file, not the size of the file), fOriginalOffset to
fStart, and fOffset to fCurrent. Also initialize in the order fEnd,
fStart, then fCurrent to maintain the invariant that fCurrent should
always be kept within the range of fStart and fEnd, inclusive.
Change-Id: I8801288320cf82b071e4621c0e770ce16016953a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316453
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Bug: oss-fuzz:25584
Change-Id: I3d6007e373f2b3b684065cad276695fb78c0bd8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316537
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This improves perf on ANGLE D3D11 ES3. Will make conditional
if any other config regresses.
Also makes the varyings passed to append_index_uv_varyings be
purely output params.
Change-Id: I332940d9d55be854d3bba72286ca89840ab43d50
Bug: skia:10644
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316226
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This change doesn't accomplish anything by itself, but is a necessary
prerequisite for followup changes to node handling. Eventually all data
is going to be stored within IRNode itself, and the subclasses will not
add any fields; this is just the first step in that process.
Change-Id: If2bea4c62bd8f680e9d9f39248bb9679332b245b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315867
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
This is a reland of ff9dc8240e
ASAN errors were resolved at http://review.skia.org/316451
Original change's description:
> Add InlineCandidateAnalyzer to locate candidate functions for inlining.
>
> The analyzer will be enabled in followup CLs. At present, if the
> commented-out code is enabled, it will properly identify candidate
> functions that should be inlined.
>
> Change-Id: Icb6e7c2394a3828df81f75b855c69a25bf297842
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315217
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: I851bde66c5e490c237b88606f23fb3c5077a2393
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316452
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This removes the always use dedicated allocations for newer Mali's
and removes the "small image" check in GrVkMemory. The later is not
needed since the allocators we use have their own heuristics for using
dedicated memory which includes querying the driver itself to see if
it is recommended or not. We can also add a limit back here if we find
it necessary.
Bug: chromium:1127358
Change-Id: Ia7fa6281abb058293805c9c1c3dba9b79e7e12fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314320
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:7647
Change-Id: Ic4709817804610783de8ff3d9eaa32f57fb72729
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313316
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit ff9dc8240e.
Reason for revert: tree on fire
Original change's description:
> Add InlineCandidateAnalyzer to locate candidate functions for inlining.
>
> The analyzer will be enabled in followup CLs. At present, if the
> commented-out code is enabled, it will properly identify candidate
> functions that should be inlined.
>
> Change-Id: Icb6e7c2394a3828df81f75b855c69a25bf297842
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315217
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Change-Id: I1f07b406c4d56f2fdb6d3c5360f15397fc26d783
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316448
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
We don't expect raw literals to ever appear here; this is a defensive
maneuver. See http://review.skia.org/316440 for an example case where
raw literals accidentally made it all the way to the inlining pass, due
to a missing `coerce`.
Change-Id: I80198f2f135791931aa53e0d6d92f1edfe4fb3b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315970
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This CL adds a new type GrDstSampleType to say how we will sample the dst.
We add tracking of the GrDstSampleType in the recording of GrOps and
then during execution passing the information along to the GrPipeline.
In general the tracking of GrDstSampleType is a global state of a GrOpsTask
so it is kept separate fro the DstProxyView which is more specific to a
single Op on the GrOpsTask.
Bug: skia:10409
Change-Id: Ie843c31f2e48a887daf96cee99ed159b196cb545
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315645
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Plumb layer size information and add machinery for retrieving layer
content as an SkPicture.
Implement the effect in SkSL.
Current limitations:
* displacement source layer must be above (on top in stacking order)
of the target layer
* if animated, the displacement layer timeline (in/out points) must
fully cover the target layer timeline
* Hue/Sat/Lightness selectors are not supported at the moment
These will be addressed in follow-up CLs.
Note: Bodymovin does not export hidden layers by default; if the
displacement source layer is hidden, one should select the "Hidden"
export option.
Change-Id: I11a5c760a9df1e75835a51371f60d5b798e7e38a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314798
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Constant propagation wasn't performing type coercions, so we'd end up
propagating a constant into its final location and using the constant's
type rather than the destination type. This allowed things like
$floatLiteral to sneak into final output.
Change-Id: I5b63c70370095e291dea6374e139329b695fa0b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316440
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>