Commit Graph

2232 Commits

Author SHA1 Message Date
Mike Reed
560e9178bd specialize drawAtlas for raster backend
2x faster than calling drawVertices as the impl.

Lots more to do in future CLs
- much of the time is spent in malloc, as we cons-up private shaders.
  we *could* create a private shader and wack its data for each draw
  (breaking the immutable contract, but that may be ok for a raster-only
  internal-use shader...)
- also spend time building the pipeline for each draw, even though
  all that has changed is a color payload (and the ctm). A custome
  stage(s) that exposed its private data could be reused with new
  data...

Bug: skia:
Change-Id: I0ff15155e37c0af7931abd34c0883701a47a048a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203168
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-05 21:01:47 +00:00
Michael Ludwig
2300318551 Update benchmarks to use new filter factories
Also refactors 3 duplicate functions that converted an SkTileMode to
a char*. This will rename the matrix convolution benchmarks that used
"clampToBlack" to the more modern "decal" terminology.

Bug: skia:9280
Change-Id: I43a4f9edeba36eb5af1243f7e4ab7647253b91f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230883
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-05 16:41:25 +00:00
Mike Reed
76c6ff07fb fix bench to scale up, so we don't skip high-qual-filter
Change-Id: I387ace8f7f4eb455144f9a4c590abe405a01cf18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231113
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-07-31 20:59:32 +00:00
Mike Reed
9dc0b9e2f8 remove code now that loopers are dead (w.r.t. canvas and paint)
We can't remove the loopers themselves, as they are still used
by android and chrome (they just don't ever pass them to skia).

Eventually each of those clients will resolve this, but for now
we just keep the classes (and tests) in skia.

Bug: skia:4783
Change-Id: I5f507e6bb82280f2bc7c0b21eebe59c287aa9265
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230579
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-30 12:49:28 +00:00
Ethan Nicholas
1386366e01 renamed SkSL texture() and process() to sample()
Bug: skia:
Change-Id: I2ae0caf08f8434302cae8151ae1ea0fda8d56928
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230397
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-07-29 17:37:38 +00:00
Mike Klein
52337de95c re-run tools/rewrite_includes.py
PS2 adds a rewrite for Skia #include <...> to #include "...", letting
them be otherwise rewritten and sorted too.  (We do need one exception
for the Vulkan headers, which will otherwise be rewritten to always
point to our own.)  I don't think it's particularly important to
favor "" or <>, but picking one keeps things consistent.

PS3 adds a missing SkMutex.h include.

PS4 fixes a terrible readability problem.

Change-Id: Id9fe752727ef30e802b1daf755ee2ed15e267577
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229742
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-07-25 15:40:33 +00:00
Julia Lavrova
5207f35f33 The current version...
Adding cache
Caching shaped results
Base+Index for referencing arrays
The very first and naive version of cache
Cache measurement, lines and picture
Added text blob cache for lines
Removed Run* from Cluster
Removed const char* from Cluster and Run
Few minor changes

Change-Id: I444a1defa950aed5999cfa1c3545fd83ccb54ce9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227840
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-23 13:31:39 +00:00
Mike Reed
b7dad44040 Reland "hide drawlooper from paint"
This reverts commit 6dc14ded91.

Reason for revert: add flag to google3

Original change's description:
> Revert "hide drawlooper from paint"
>
> This reverts commit 766b42b7ba.
>
> Reason for revert: afaict this is changing a lot of image filter GMs for the worse
>
> Original change's description:
> > hide drawlooper from paint
> >
> > Bug: skia: 4783
> >
> > Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=fmalita@chromium.org,reed@google.com
>
> Change-Id: I0bfd48ada3f8e48a774527caccf7abdb7a1cc470
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia: 4783
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229005
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Ib3cd8941a63cd323b8872dd7fec1c953ab81cbdc
Bug: skia: 4783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229010
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-22 20:03:36 +00:00
Robert Phillips
6dc14ded91 Revert "hide drawlooper from paint"
This reverts commit 766b42b7ba.

Reason for revert: afaict this is changing a lot of image filter GMs for the worse

Original change's description:
> hide drawlooper from paint
> 
> Bug: skia: 4783
> 
> Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I0bfd48ada3f8e48a774527caccf7abdb7a1cc470
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia: 4783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229005
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-22 17:27:17 +00:00
Mike Reed
766b42b7ba hide drawlooper from paint
Bug: skia: 4783

Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-22 16:25:41 +00:00
Brian Osman
869a3e81ea Reland "Interpreter: Bounds check array access, add bool return from run"
This is a reland of f42de9e1e5

Original change's description:
> Interpreter: Bounds check array access, add bool return from run
> 
> Out of bounds access with constant indices is a compile error.
> At runtime, causes the interpreter to fail. Made several other
> conditions trigger the same failure logic, and updated all
> uses of the interpreter to validate success.
> 
> Change-Id: I3720b3c83903220b010ec574121fc64dbe102378
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228256
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

Change-Id: I8849de815f7efb730ac9c55b6edd296cb9ca7599
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228353
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-07-18 21:38:20 +00:00
Brian Osman
3e6aa9f528 Revert "Interpreter: Bounds check array access, add bool return from run"
This reverts commit f42de9e1e5.

Reason for revert: All the SANs

Original change's description:
> Interpreter: Bounds check array access, add bool return from run
> 
> Out of bounds access with constant indices is a compile error.
> At runtime, causes the interpreter to fail. Made several other
> conditions trigger the same failure logic, and updated all
> uses of the interpreter to validate success.
> 
> Change-Id: I3720b3c83903220b010ec574121fc64dbe102378
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228256
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

TBR=mtklein@google.com,brianosman@google.com,ethannicholas@google.com,reed@google.com

Change-Id: I434601960d54fbd7d00e2af2dc6269a83a768c5b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228352
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-07-18 17:22:41 +00:00
Brian Osman
f42de9e1e5 Interpreter: Bounds check array access, add bool return from run
Out of bounds access with constant indices is a compile error.
At runtime, causes the interpreter to fail. Made several other
conditions trigger the same failure logic, and updated all
uses of the interpreter to validate success.

Change-Id: I3720b3c83903220b010ec574121fc64dbe102378
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228256
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-18 16:24:57 +00:00
Ben Wagner
acf98df7a1 Remove WallTimer class.
Only used in three somewhat dubious places.

Change-Id: I7ccd1aef41f826d0eb62606751f4d3f0ceda267d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227065
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-07-15 16:06:11 +00:00
Mike Klein
5b5dabcc56 make some SkVM benches uneven
N=15 and N=63 make for nice even looking profiles
on ARM and x86 respectively, with N=15 running 3
body loops and 3 tail loops on ARM, N=63 running
7 body loops and 7 tail loops on x86.

Change-Id: Ie7616bd99c949328bbb7d7048fc6f468ff1e3ad2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227220
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-15 02:38:26 +00:00
Brian Osman
4a47da7357 Interpreter: Disallow return statements inside loops or conditionals
These didn't work correctly, and they're extremely tricky to get right
in the vectorized execution model (vs. structured control flow). As a
side effect, determine the maximum stack depth used for the execution
masking - the same idea will be used for the primary stack in a later
CL. Add a unit test to verify the new restriction, and fix two places
that were relying on this feature before.

In addition, boolean external values need to be masks. I may implement
this in the code-gen at some point, but this is already a fringe
feature, so just fix the one unit test for now.

Change-Id: I9607ffaf67c7795dbf42e4009180aea8f3e65c44
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226849
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-07-12 16:07:16 +00:00
Mike Reed
21ba586f32 create outer forloop to support loops=-1
Change-Id: I1f76a798f3f95afb82ab739ab5343bf52b233c7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226079
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-07-09 14:41:07 +00:00
Herb Derby
55a85fc1a6 Bulkify SkGlyphCacheBench
+ fix bug in SkBulkGlyphMetricsAndImages where the underlying SkAutoSTArray
  was not reset.

Change-Id: I94882da30e858d012aa02f79c5fdfe4bc7d2e8aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225541
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-07-03 19:45:54 +00:00
Brian Salomon
27ae52c6f4 Make deferred render target context without config or format
config is completely redundant. No caller really cares what the backend
format is.

Change-Id: I93f1feb3ee61db6c21b7915bab3ee3fba5656f92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225194
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-03 16:53:48 +00:00
Mike Klein
ac8f443f92 auto-tune nanobench in all builds
I'm kind of getting bored of having to pass --loops 0
in optimized+asserts builds.

We'd been defaulting to 1 loop in Debug and ASAN builds,
and manually setting Valgrind builds to 1 loop with 1
sample.  Remove the default so all builds auto-tune,
but set Debug and ASAN bots like Valgrind bots.

Change-Id: Ifedd98a11ea74a2c222fe59bd50b96683d12b98c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224816
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-01 16:07:22 +00:00
Chris Dalton
6b98280469 Track if we need stencil on GrRenderTargetContext
There are a few places that have been checking whether the *proxy*
needs stencil, in order to determine if the current render target
context needs stencil. This is problematic since a render target
context can not require stencil itself, but wrap an existing proxy
that already has stencil.

Bug: skia:
Change-Id: I2719dd3a9df15fef3d64f991cda4fadea23266bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223970
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-06-27 20:29:03 +00:00
Herb Derby
a4eecd8041 findImage(const SkGlyph&) -> prepareImage(SkGlyph*)
Because it mutates the glyph.

Change-Id: Ic7ce320350764454d7a76335828d398f19b149d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223797
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-25 19:36:53 +00:00
Brian Salomon
d628747dfb Make GrColorSpaceInfo store GrColorType.
This is largely redundant with GrPixelConfig. However, we intend to
remove GrPixelConfig.

Bug: skia:7580

Change-Id: I03d92303be832711f7821f8a97d36387c9b04a9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222883
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-25 14:29:09 +00:00
Mike Klein
1ae6ac81e6 add RP comparison for SkVM_Overhead
Looks like ~50ns overhead for RP vs ~14,000ns for SkVM.

Change-Id: I85ef73d3387657b14615fcfa5cfd9df5c2325343
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223302
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-25 02:52:19 +00:00
Herb Derby
511dcfc339 Remove getGlyphIDMatrics type calls.
Converting to glyph() style calls that return SkGlyph*. This is mainly preparation
for removing converting findImage(const SkGlyph&) to prepareImage(SkGlyph*).

+ Misc cleanups mainly fWidth -> width() type things.

Change-Id: Id5c9b0ba5856b3ea54353ece4d05fa495cc5a640
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223187
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-24 19:35:01 +00:00
Chris Dalton
6ce447a4ec Eliminate mixed samples as an FBO type or AA type
From now on, sample counts always refer to the number of actual color
samples, and render targets don't have separate color and stencil
sample counts.

If mixed samples support is available when making a
"GrAAType::kCoverage" draw, then an op may attach and use a mixed
sampled stencil buffer internally. But this will all be invisible to
the client.

After this CL, we temporarily won't have a mode to use nvpr with mixed
samples. That will soon be fixed by a follow-on CL that enables nvpr
with mixed samples in the normal "gl" and "gles" configs.

Bug: skia:
Change-Id: I1cb8277f0d2d0d371f24bb9f39cd473ed5c5c83b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221878
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-24 04:08:45 +00:00
Mike Klein
8b5cf82dca add SkVM_Overhead bench, simple improvements
This new bench lets us measure the overhead of program building,
optimization, and JITting.  Surprisingly, at head the optimization in
Builder::done() takes longer than the JIT.

The new bench clocks in around 40µs on my laptop at head,
  then 32µs after switching val_to_reg to be an std::vector,
  then 27µs after switching deaths to be an std::vector too,
  then 22µs after switching fIndex to be an SkTHashMap,
  then 20µs after calling program.reserve(fProgram.size()),
  then 19µs after switching JIT data maps to SkTHashMap too.

I tried swapping some std::vector for SkTDArray to no benefit, actually
a little detriment.  So I think this is roughly all the low-hanging
fruit, with time split now roughly equally between Builder::Done(),
JITting in Program::eval(), and the original calls to Builder
themselves.

Also disable perf dumps on Mac.  No real value there until I can dump a
dylib, and it's just one more thing I have to remember to disable before
running this sort of benchmark.

Change-Id: I1c6e58ed00ac94ad622c7d740712634f60787102
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222984
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-22 18:36:49 +00:00
Mike Klein
244ba5550b rearrange who mprotects
This moves the responsibility for allocating executable code out of
Assembler.  The pages Xbyak uses are obviously executable, so this is
redundant right now, but it'll let us switch to something simple like
std::vector<uint8_t> as we continue to cut out Xbyak.

Make how Program holds its cached JIT program slightly less of a mess.

Change-Id: I38d6f01006da1da60f4aed675e9ddf97de9aec52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222575
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-21 18:40:47 +00:00
Mike Klein
397fc88fc0 first VEX ymm vector ops
- 32x8 i32 add,sub,mul
   - add I32_Naive bench/test builder to get better i32 mul coverage
   - minor refactoring all over

Change-Id: I13cc19ff37a2da0bcff289ba51baac08f456d6c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222485
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-20 18:20:00 +00:00
Mike Reed
3fd3cc94c3 runtime shaders
This extends the runStriped to all for return data.
GPU impl not done yet, will be done in a follow-on CL.

Change-Id: Ib107d2945f6fdb34ce1b5405a6c88a5ae7e9f7ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221539
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-06-20 17:11:05 +00:00
Brian Osman
2b1a544fa0 Reland "Reland "Reland "Interpreter: Support striped inputs for less overhead"""
This reverts commit 01c9b89a85.

Change-Id: Ibe2184043f5aee1a252e9a693eb88dab3ed6ca65
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222100
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-19 20:24:50 +00:00
Brian Osman
01c9b89a85 Revert "Reland "Reland "Interpreter: Support striped inputs for less overhead"""
This reverts commit 59b22f9297.

Reason for revert: ios

Original change's description:
> Reland "Reland "Interpreter: Support striped inputs for less overhead""
> 
> This reverts commit 2c59b4e9ea.
> 
> Change-Id: I2b06936994430722b8fc3890ff9b4a6f4710db04
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221998
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=mtklein@google.com,brianosman@google.com,reed@google.com

Change-Id: I321d257e400f5df3c6115dfe9aa18a2794a95910
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222099
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-19 15:37:17 +00:00
Brian Osman
59b22f9297 Reland "Reland "Interpreter: Support striped inputs for less overhead""
This reverts commit 2c59b4e9ea.

Change-Id: I2b06936994430722b8fc3890ff9b4a6f4710db04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221998
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-19 13:47:12 +00:00
Brian Osman
2c59b4e9ea Reland "Revert "Interpreter: Support striped inputs for less overhead""
This reverts commit edc42b9971.

Reason for revert: Sigh

Original change's description:
> Revert "Revert "Interpreter: Support striped inputs for less overhead""
> 
> This reverts commit 645fe10313.
> 
> Change-Id: If74a15479f89f49ac33c0b6241bb0db92bc11083
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221721
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=mtklein@google.com,brianosman@google.com,reed@google.com

Change-Id: I651d56821bbde8b91887aa885bcf2cb202707388
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221897
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-19 00:19:37 +00:00
Brian Osman
edc42b9971 Revert "Revert "Interpreter: Support striped inputs for less overhead""
This reverts commit 645fe10313.

Change-Id: If74a15479f89f49ac33c0b6241bb0db92bc11083
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221721
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-18 22:30:11 +00:00
Brian Osman
645fe10313 Revert "Interpreter: Support striped inputs for less overhead"
This reverts commit 5d89b66ff6.

Reason for revert: Chrome roll

Original change's description:
> Interpreter: Support striped inputs for less overhead
> 
> Change-Id: I8c7bd5ed3fb6aebbfb1c5c224acfd73862252621
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220778
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

TBR=mtklein@google.com,brianosman@google.com,ethannicholas@google.com,reed@google.com

Change-Id: I2275e7ed12031e58e59b6618d0ea59bec2ee2815
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221716
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-18 18:43:47 +00:00
Brian Osman
5d89b66ff6 Interpreter: Support striped inputs for less overhead
Change-Id: I8c7bd5ed3fb6aebbfb1c5c224acfd73862252621
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220778
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-06-18 15:53:05 +00:00
Greg Daniel
f91aeb259e Move a bunch of gpu files out of include/private and into src/gpu.
In GrRecordingContext I moved the auditTrail onto the heap and only there
when compiling for tests. This allowed us to move a lot of files out of
include private.

Change-Id: Ib76ac211c0c6fd10bacaccf0c5f93f21a59f35d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221344
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2019-06-18 14:24:42 +00:00
Brian Osman
08a8496135 Interpreter: Simplify interface quite a bit.
Slightly sharper, but far easier to hold:

- Remove Value union from interface, everything is a 32-bit
  value type, or a collection thereof.
- Collapse to one version of Run (that takes count), and make
  it a member on ByteCode.
- Similarly, move disassemble to ByteCodeFunction.

Change-Id: I07c85e65991178b3f52e20e815c25f36bc9c4257
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220753
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-14 16:04:58 +00:00
Brian Osman
569f12f0e5 Interpreter: Vectorized interpreter
This converts the SkSL interpreter to operate in SIMT fashion. It handles
all the same features as the previous scalar implementation, but operates
on N lanes at a time. (Currently 8).

It's modeled after GPU and other parallel architectures, using execution
masks to handle control flow, including divergent control-flow.

Change-Id: Ieb38ffe2f55a10f72bdab844c297126fe9bedb6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217122
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-13 15:50:55 +00:00
Julia Lavrova
a3552c5e6d Reland "SkParagraph"
This is a reland of 10ad0b9b01

Original change's description:
> SkParagraph
>
> Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: I46cf43eae693edf68e45345acd0eb39e04e02bfc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219863
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-06-11 17:20:36 +00:00
Herb Derby
07cd38dc13 Revert "SkParagraph"
This reverts commit 10ad0b9b01.

Reason for revert: Breaks google3 build

Original change's description:
> SkParagraph
> 
> Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=borenet@google.com,djsollen@google.com,halcanary@google.com,bungeman@google.com,kjlubick@google.com,reed@google.com,drott@chromium.org,jlavrova@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I3f4ef2f34b7489d008c2fe92527d39fba0e16ff7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219858
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-10 13:16:53 +00:00
Julia Lavrova
10ad0b9b01 SkParagraph
Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-06-07 17:23:23 +00:00
Herb Derby
ac7182773e Make FindOrCreateStrikeWithNoDeviceExclusive analog for SkStrikeSpec
Add MakeWithNoDevice to avoid the threshold of converting to
paths when using MakeCanonicalized.

Change-Id: I73b49dd35ffb2f4fa3b70ba3324bfcb348ca913b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218960
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-07 01:29:21 +00:00
Herb Derby
36a54c1b1a Rename SkStrikeSpecStorage -> SkStrikeSpec
SkStrikeSpecStorage was a temporary name until all uses of
SkStrikeSpec were cleaned up. Do the final rename.

Change-Id: Iaba987ecdfe46ca9eee8d530d5095840cdca300d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219209
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-06 18:01:02 +00:00
Ethan Nicholas
fc9941665b Major rearchitecture of SkSL parsing, focused on improving performance.
Bug: skia:
Change-Id: I83e3a094d26085fc4d586e5d2581e0d61c55634e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/145080
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-06-06 14:33:32 +00:00
Mike Klein
7b7077cc36 centralize test/bench SkVM builders
Eliminate the duplicate functionality,
and better testing for the bench builders.

Change-Id: If20e52107738903f854aec431416e573d7a7d640
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218041
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-04 16:55:59 +00:00
Herb Derby
baf64786ba Convert over more sites to SkStrikeSpecStorage, and remove unused calls
Convert over remaining callsights for strike lookup, and reduce the SkStrikeCache
API.

- one friend decl.

Change-Id: I109a747061030f26ff908472ea55a4424d5c10f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209109
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-04 14:11:45 +00:00
Michael Ludwig
663afe501a Move GrPathUtils, GrRect, and GrShape into src/gpu/geometry/
Change-Id: I864d3c2452f3affdc744bf8b11ed3b3e37d6d922
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216602
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-04 13:36:05 +00:00
Mike Klein
03ce675b5f fix SKVM_ benches
Things were running suspiciously well...

_I32 had a typo that cut out 3/4 of its multiplies...

_I32_SWAR was missing a mask operation needed to drop
the junk low byte of the high half after the multiply.

The bench times now make a bit more sense and are in line
with how much work we're actually doing: F32's the slowest,
I32 a little faster, and I32_SWAR fastest:

    curr/maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
      35/36  MB	58	2.03ns	2.04ns	2.04ns	2.04ns	0%	▂▂▂▂▁▁█▁▂▁	nonrendering	SkVM_4096_I32_SWAR
      35/36  MB	42	3.44ns	3.48ns	3.49ns	3.59ns	1%	▂▆▅█▃▃▁▂▂▄	nonrendering	SkVM_4096_I32
      35/36  MB	30	4.9ns	5.21ns	5.11ns	5.33ns	3%	▆▇█▆▆▁▂▁▁▅	nonrendering	SkVM_4096_F32
      35/36  MB	203	0.696ns	0.697ns	0.705ns	0.758ns	3%	█▂▂▁▁▁▁▁▁▂	nonrendering	SkVM_4096_RP
      35/36  MB	942	0.188ns	0.188ns	0.188ns	0.189ns	0%	▂▁▂▁▃█▂▁▁▁	nonrendering	SkVM_4096_Opts

Change-Id: I2850dc3f9df1828f03499eb278b8231f48eaae63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217982
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-06-03 20:35:24 +00:00