A change made in the spirit of not being weird. C++ containers typically
expose their capacities to non-test code, with a function "capacity."
Change-Id: Icc7e175a20aff53ef9e144ac9620ced29ef5e95a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325657
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
The call order here is a little weird – it could use some refactoring
but for now it's just a cut-and-paste job.
Change-Id: I931493a421f7fd1df69f0c47055b90a2996c7dc3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325459
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
This golden verifies that when the inline threshold is zero, inlining is
not performed.
Change-Id: Icad6e1faed569dd1b2469874be3b9e635ad0b9ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325656
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
- When fInlineThreshold is zero, the inliner doesn't need to run at all.
- Inlining functionality outside of `analyze` can be made private now;
it's not referenced by the IRGenerator any more.
Change-Id: If61fd8998bc024201bf4489b7aa48ac4d117e449
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325617
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This reverts commit 941fc7174f.
Reason for revert: performance now seems to be roughly equal or better
(~1%) over several trials.
Nanobench: http://screen/A8e8sojaXBgbMgF
Original change's description:
> Revert "Remove inliner from IR generation stage."
>
> This reverts commit 21d7778cb5.
>
> Reason for revert: Pinpoint absolutely hates this change
>
> Original change's description:
> > Remove inliner from IR generation stage.
> >
> > There is no need to inline code during IR generation, as the optimizer
> > can now handle this.
> >
> > Change-Id: If272bfb98e945a75ec91fb4aa026e5631ac51b5b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315971
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
>
> Change-Id: I62c235415bcdc92a088e2a7f9c3d7dbf7e1bf669
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317976
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Change-Id: I6189806c678283188f4b67ee61e5886f88c2d6fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324891
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
The atlas is not compatible with DDL. This is a temporary fix that will
allow us to finally enable tessellation. In the near future we plan to
remove the atlas entirely by implementing SkRegion batching and
reordering instead.
Bug: skia:10419
Change-Id: Ie2d1bda31c12cda8ecd4889004483f679f5ba7e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324976
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit 5ee0556048.
Reason for revert: breaking bots
Original change's description:
> Use ManagedBackendTexture in place of TestUtils backend texture helpers.
>
> Unify on a single family of helpers for making backend textures.
>
> Stresses callback systems in more tests by avoiding artificial
> flush/submit/syncs.
>
> some misc test cleanup along the way.
>
> Change-Id: Ia692e8927ba97b391ee77ea06ebf437a555617b2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324710
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com
Change-Id: I7d4fc9412c870ae13f7498671379b871dbf5a6c4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325619
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This CL is conceptually a revert of http://review.skia.org/320258,
although the code has changed shape a bit since that CL was landed.
This fix was too aggressive, and can lead to functions being dead-
stripped while they still have an active reference.
Change-Id: I6ce8b0ad9cc2a42e8be8cb10d3a8219149eca6aa
Bug: skia:10776
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325462
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Unify on a single family of helpers for making backend textures.
Stresses callback systems in more tests by avoiding artificial
flush/submit/syncs.
some misc test cleanup along the way.
Change-Id: Ia692e8927ba97b391ee77ea06ebf437a555617b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324710
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Change-Id: I9666a2358489cf2492515ea2dab5cc8dcf475bb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324884
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Change-Id: I05b940c69b7756d41277626fc3eef06003d133c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324886
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Orientation information is sometimes stored in
the SubIFD section of EXIF, so read that. This is
just a matter of searching for the SubIFD offset
value in the EXIF tags and then parsing the
values from there onwards. The data format is
the same as the EXIF data.
The images are not under any copyright as I made
them up locally specifically for these tests.
Bug: skia:10799
Change-Id: I5384ffc1c4a9a0c7d3fc8510ef4da2f278cb8b97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323217
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
These aren't allowed in GLSL, and typically don't make sense.
Change-Id: I0afca0df638590466922a809e91ef0be35b13ca8
Bug: skia:10765
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324816
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
MSAA now requires this.
Removes last use of SkSurface::MakeFromBackendTextureAsRenderTarget.
Bug: skia:9832
Change-Id: I2837aa0dd9e2cc999c5aac194816777bca477abe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324889
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Next step is to add the following task:
Test-Ubuntu18-EMCC-Golo-GPU-QuadroP400-wasm-Release-All-WasmGMTests_WebGL2
Bug: skia:10812
Change-Id: Ibe45b7205cebd30f0e7904ea6d93a01ea3df87fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324617
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
* Sets the cap and uses it for verifying vertex/fragmentBytes size instead
of a magic number.
* Also makes maxPushConstantsSize unsigned to avoid warnings and
unnecessary casting.
Change-Id: I2aaea853604eb3c652ddbae3adb0168a4e41799a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324880
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
- Move all of IR generator's fields private (except for fContext, which
is used ~everywhere).
- Eliminate start() and finish(), fold this logic into convertProgram.
The division of what was set/reset in different places was pretty
arbitrary. Now, convertProgram does everything. Along that line, have
it actually return the "outputs" as an IRBundle (a small collection of
the things that the compiler needs). This seems better than the
compiler ripping out IR generator's internals.
- IR generator's POD field initialization was a mix of in-class and
constructor. Move all the constant initialization to declarations.
- No need to look up sk_PerVertex at start (or convertProgram) time, so
remove fSkPerVertex, and just do the lookup when we're about to use
it.
- IRGenerator::convertProgram is fairly long now, but all the code is in
one place. You don't have to think about the order that three
different member functions are called (along with the caller mutating
the internal state between those three calls).
- In the compiler, add an AutoSource helper to manage changing and
restoring the fSource pointer everywhere.
- Rename the loadXXXIntrinsics functions to loadXXXModule, have them
return the module, and wrap the whole thing up in a single
moduleForProgramKind() helper.
Change-Id: I0c9b6702f8786792963e3d9408d6619e5ab393e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324696
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This appeases a validation layer error. Its unclear if the validation
is correct saying this was an error before (since sampler param isn't
used when we have immutable samplers), but this isn't wrong either and
makes the layers not complain.
Change-Id: I88e8017df203965af0030b153ff933384a6215d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324698
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Not an official release, but no noticeable differences.
We can point it to the next stable release when it incorporates the fix.
b02a12d1dd
Change-Id: I7c93eb50d3ee87ea4c1180be4cbab81a94449197
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324676
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
We were passing in the IR generator's which had already been reset, so
technically belonged to the *next* Program to be compiled.
Change-Id: Ib68c283591f02d1642bb7c2d9658f5caa76b0f15
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324700
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>
Bug: skia:10419
Change-Id: I7754a1f19eea8630db3ede29e1ee7c79a53091bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322041
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This reverts commit 7c4aca04cc.
Reason for revert: cc unit tests need to be rebased
Original change's description:
> SkDevice::drawSpecial accepts arbitrary matrix v2
>
> This opens up the door to render image filter results with an arbitrary
> matrix, so we can skip the matrix filter DAG hack. It should also let
> me simplify the handling of backdrop image filters and correctly apply
> perspective to image filters.
>
> This is essentially the same as
> https://skia-review.googlesource.com/c/skia/+/317862
> but not parented to the CL that experimented with SkImagePaint.
>
> Some of the function declaration re-org that was done in its prior CL
> has been directly integrated into this CL.
>
> Bug: skia:9545
> Change-Id: Iad882bd306f3a4064fe60cfc0526226287ea7e29
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323597
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,robertphillips@google.com,reed@google.com,michaelludwig@google.com
Change-Id: I6a248fe9e02d71fa340ed3227e77fff097b7b08e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9545
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324704
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Automatically handles cleanup of backend objects.
Removes use case of MakeFromBackendTextureAsRenderTarget.
Bug: skia:9832
Change-Id: I27c2b4cae713bd605a662d38b797fd25c1add98e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324119
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
These were uncovered during the recent documentation fiesta.
This also adds a test for the previously untested
CanvasKit.Path.MakeFromOp API.
Bug: skia:10717
Change-Id: Icd3d31ec0f8d61bd399e76abdbf7b5c6395c4d85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324626
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This CL introduces two significant changes:
- unordered_map is replaced by SkTHashMap.
- The StringFragment key is replaced by a SymbolKey class, which caches
the hash of the string.
The second change is responsible for the lion's share of the measured
performance improvement. SymbolTable::operator[] was previously re-
hashing the string every time it recursed into the parent symbol table.
Nanobench shows a fairly consistent ~8% speed improvement in both
sksl_medium and sksl_large: http://screen/3KTc27gt85HS4wK
Change-Id: Ia1010dcd40d7f7ecdce1aa5bb10c6cf6f6f11a80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324628
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Replacing `sk_OutColor = x` with `return x` in single-exit FP functions
results in fewer scratch variables in the final post-inliner output.
Change-Id: I81c081a78d0fb7dfad5230e3044027901673236c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324377
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>
Need the indexed version of the draw as well
Change-Id: I0b11687be1bb6126d963eb6ce99879525df2603f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324697
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Change-Id: Ib2fd8c246799a1bde566395080fe6617754644f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324635
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This is pretty much just cutting & pasting the code naïvely,
but it's the safe way to go so that we don't impact the
order of events during this housekeeping.
Change-Id: I8d9f2ffb560b34fd1a8d9603174ff1f17803e447
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324619
Commit-Queue: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Changed a couple of SkSL enums to enum classes and rearranged things to
make their storage within IRNode type safe.
Change-Id: I6509d027d79161c1a09473e90943aae061583f20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324624
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This is a bug in the layers related to input attachments.
Change-Id: I1e44c45ce44bea79e7078836150237a6c63cbb36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324625
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Prefix, Postfix, and ExternalFunctionCall nodes this time around.
Change-Id: I56bc06d73274f01b67f043a6ebd23dd4c80d16e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324621
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Currently the entire GrVkPipeline does handle correctly keying if the
pipeline is using an input attachment since it is part of the render
pass key. However, using an input attachment does change the shader
and this was not getting reflected in the GrProgramDesc which is what is
used for caching spirv in the persistent cache. Thus we were having
errors switching msaa on and off since without msaa we use input
attachment but with msaa we used a copy. They were finding eachothers
spirv in the persistent cache.
Change-Id: I3200d6f640761ec1b1cd32e563b7c8be8e6a8481
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324477
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This opens up the door to render image filter results with an arbitrary
matrix, so we can skip the matrix filter DAG hack. It should also let
me simplify the handling of backdrop image filters and correctly apply
perspective to image filters.
This is essentially the same as
https://skia-review.googlesource.com/c/skia/+/317862
but not parented to the CL that experimented with SkImagePaint.
Some of the function declaration re-org that was done in its prior CL
has been directly integrated into this CL.
Bug: skia:9545
Change-Id: Iad882bd306f3a4064fe60cfc0526226287ea7e29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323597
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This binds together the IntrinsicMap and SymbolTable for each include to
a single entity, with helper functions that create and return them. Used
a little bit of macro trickery to move all of the standalone/runtime
logic into loadIncludeFile, which drastically reduces boilerplate.
Change-Id: Ic70c0d67967cc614daeab5c50412ab69dcdf2fea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324124
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>