Commit Graph

45451 Commits

Author SHA1 Message Date
Ethan Nicholas
db80f6936c SkSL now supports functions defined in sksl_gpu.inc
Change-Id: Ib29f41f6e71b176fec1ead26259ad1945a41e634
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254677
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-11-22 19:39:44 +00:00
Mike Reed
30bc527fd6 Revert "Reland "Revert "Use flat version of path-direction enum"""
This reverts commit 7cda6f3743.

Reason for revert: legacy convexity code removed -- google3 should be ok

Original change's description:
> Reland "Revert "Use flat version of path-direction enum""
>
> This reverts commit 1792b19485.
>
> Reason for revert: need to update legacy_convexity, still used by google3
>
> Original change's description:
> > Revert "Revert "Use flat version of path-direction enum""
> >
> > This reverts commit 0dacc6b7d3.
> >
> > Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> > Auto-Submit: Mike Reed <reed@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=reed@google.com
>
> Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I3529139bb391c4f62ce5cd0744cdf38a13b71d78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255984
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-11-22 19:09:54 +00:00
Robert Phillips
34cea00bdf Add utility for creating test-only GrProgramInfos
This is complete overkill for what these GMs require but it will help centralize things.

Change-Id: If30cbd9a9cfc8fcc1fe96fc9ca1b4cb17cdeb4bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255824
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-22 19:01:14 +00:00
Kevin Lubick
241e81339b [skolo] Remove internal hardware 2
Bug: skia:7160, skia:9517
Change-Id: I5c00dca477de88bc46cbc12829a97fb36aed8f14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255979
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-11-22 19:00:20 +00:00
Mike Reed
8ee77d8f42 remove LEGACY_CONVEXITY code -- no more clients
Change-Id: Ifd33831b6a83a56685435ce8e4fbb218a147b34e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255981
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 18:31:44 +00:00
Michael Ludwig
189c98042f GrQuadPerEdgeAA::Tessellator owns GrVertexWriter
Change-Id: I3c8bf48dda061aa9d318b9f81f22608fdd68fcbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255786
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-22 17:31:34 +00:00
Michael Ludwig
fe13ca3e67 Move textureop fallback code out of GrRTC and into AddTextureSetOps
(also renames CreateTextureSetOps to AddTextureSetOps, to match naming of
GrFillRectOp::AddFillRectOps).

Now that GrTextureOp can add more than one op to the GrRTC, it can take
over ownership of its fallback code for the texture set. It already had
taken over the code for non src-over blends when drawing a single texture.

Besides consolidating where the logic of converting TextureSetEntries into
op data lives, this makes the fallback case more consistent in terms of
performance. Previously, it would go through GrRTC::drawTexturedQuad,
which attempts to merge the clip with the draw for correctness reasons.
A batch never attempted these optimizations, so now even when one op per
quad is required, there won't be the overhead of comparing clips.

Change-Id: I30883e3bd45ed4386f81584e3d68229c46b17e47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255781
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-11-22 16:13:03 +00:00
Ravi Mistry
68e470de86 [G3 compile bot] Add comment to CL when there is an interesting failure
Also, create and use new service account for the G3 compile bots.

Interesting failure here refers to when the bot fails only because of
test failures and not:
* merge failures
* unknown failure reasons (eg: some flaky timeouts from the script running in borg)
* when the bot is not owned or approved by a Googler

NoTry: true
Bug: skia:9631
Change-Id: I964fd7874269116cca0e25d1b516283a00d5133f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254278
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2019-11-22 16:08:03 +00:00
Mike Klein
fee0079e77 rough unit test support for FM
I've punted for now on GPU test support.

Change-Id: I2ebe54a6fc61e1ce92120a6a221d5bb936b047e4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255874
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-11-22 15:49:33 +00:00
Jim Van Verth
b1edfde279 Rename GLRTFBOIDIs0 to WrapsSwapchainSurface and use for Metal.
This provides a way to indicate that a Metal RenderTarget, and in
particular a RenderTargetProxy, is framebufferOnly, so it can be
restricted to certain operations.

Bug: skia:9573
TBR: bsalomon@google.com
Change-Id: I733fae2fce402c375534889346255afe28a57944
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255783
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-22 15:33:33 +00:00
Nigel Tao
6ec1b39f0c Optimize SkWuffsCodec's sk_bzero calls
The *previous* SkWuffsCodec.cpp commit, 39da10b5 "Optimize SkWuffsCodec
pixbuf zero-initialization", removed the need to *explicitly*
zero-initialize the fPixelBuffer on the first frame decode. Subsequent
frames, including the first frame of the animation again if the
animation is looped, still need to call sk_bzero.

Prior to *this* commit, each row of the pixel buffer was zeroed
separately. When it is necessary to memset to zero, it can be faster to
issue one big call instead of many small calls.

For example, the single-frame droids.gif file mentioned in the previous
commit (39da10b5) now skips the explicit sk_bzero calls, due to the
optimization in exactly that previous commit. But if it was a looped
animation, decoding subsequent (repeated) frames would need to memset
the re-used buffer to zero. The time taken for those sk_bzero calls
would be affected by this commit: from 2.900ms to 2.454ms (out of a
total decode time of 33.342ms as per 39da10b5's commit message).

Bug: skia:8235
Change-Id: I72ec3dc4230f06f358b5e8fee1b2799607d86615
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255358
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-11-22 14:49:33 +00:00
Robert Phillips
98f3fd97f4 Update bezier_*_effects GMs to not use rand
It was disconcerting to have these change radically when I changed the code flow in another CL.

Change-Id: Ifd4c1be454e3f9291fa05f040545c95fa20be58a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255822
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-22 14:48:33 +00:00
Hal Canary
b752a63d77 Documentation: Cq-Include-Trybots
Docs-Preview: https://skia.org/dev/contrib/cqkeywords?cl=255524
No-Try: true
Change-Id: Idb7248f5eac07474b2b079041c739c9ef9717c18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255524
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2019-11-22 14:36:13 +00:00
Ben Wagner
4d3ac513db Add Docker-based GCC Test tasks
Since we've moved compilation to a Debian10 Docker container, the
resulting binaries won't run on Debian9 unless we also run them in a
Debian10 Docker container.

Test-Debian10-GCC-GCE-CPU-AVX2-x86-Debug-All-Docker failures are
tracked in skia:9664.

Bug: skia:9632, skia:9664
Change-Id: I97edc142cf558e30d11bd7bc3b5d1b423ba2418b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255152
Auto-Submit: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-11-22 12:32:32 +00:00
Kevin Lubick
e59c167b0f [canvaskit] Add SkContourMeasure
Change-Id: Ied060a4de792d6372b8410bf8c7628b5fd1dfefb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255528
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-11-22 12:17:55 +00:00
Mike Reed
7cda6f3743 Reland "Revert "Use flat version of path-direction enum""
This reverts commit 1792b19485.

Reason for revert: need to update legacy_convexity, still used by google3

Original change's description:
> Revert "Revert "Use flat version of path-direction enum""
> 
> This reverts commit 0dacc6b7d3.
> 
> Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> Auto-Submit: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 11:03:34 +00:00
Brian Salomon
078e8faa26 Revert "Make FP optimizations helpers use SkAlphaType not GrColorType"
This reverts commit 7a538b1eec.

Reason for revert: ios failures

Original change's description:
> Make FP optimizations helpers use SkAlphaType not GrColorType
> 
> Change-Id: I3b7cde6e7f68192af5419fb09c7d59e7a803a4d5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255818
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Id41daa47fb3ccac434bb9d71a697f32e36c87367
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255835
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-11-22 04:10:34 +00:00
Brian Salomon
7a538b1eec Make FP optimizations helpers use SkAlphaType not GrColorType
Change-Id: I3b7cde6e7f68192af5419fb09c7d59e7a803a4d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255818
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-11-22 03:30:32 +00:00
Mike Reed
1792b19485 Revert "Revert "Use flat version of path-direction enum""
This reverts commit 0dacc6b7d3.

Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 00:51:22 +00:00
recipe-roller
aad4e6e19e Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).


More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
depot_tools:
  https://crrev.com/65f6b45d6d3fb1050a1f802969ef9ad2c0000428 gclient: Assert invokations of gclient succeed when running smoketests. (ehmaldonado@chromium.org)
  https://crrev.com/c50b0963e3f25f16e46a0029b1c1e939d0d4abd8 git_cache: don't lose options in upload_bootstrap. (tandrii@google.com)


TBR=borenet@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: Ie408dac677f6a1f38abe70978467c3012d87d599
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255880
Reviewed-by: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2019-11-21 23:34:02 +00:00
Ben Wagner
0788481c63 Remove Build-Ubuntu18-GCC job
This partially reverts
https://skia-review.googlesource.com/c/skia/+/254797. The Ubuntu18 GCC
job was added in anticipation of using it for Valgrind jobs; however,
https://skia-review.googlesource.com/c/skia/+/255537 switches Valgrind
to Clang, which makes this unnecessary.

Bug: skia:9632
Change-Id: I97d7e0d4e3be109ae48b386140117aac4279618f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255790
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-11-21 22:40:32 +00:00
Ben Wagner
bff12d60f6 [infra] Add service_account_json option to asset utils
Change-Id: If2686949009ba6fdf703ea794c0764c0e9966590
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252261
Auto-Submit: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-11-21 22:33:42 +00:00
John Rosasco
b41b3ce57f Slim down .far by ~45 MB.
Change-Id: Ib958e768f6293812e5a96589e6d3d672aae1dc7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255865
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-11-21 22:29:42 +00:00
Mike Reed
0dacc6b7d3 Revert "Use flat version of path-direction enum"
This reverts commit e0fbe94351.

Reason for revert: need to add guard flag to flutter

Original change's description:
> Use flat version of path-direction enum
> 
> Bug: skia:9663
> Change-Id: I00077d9f2b14b3e983e6a46ef6f560cabdb1678d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242557
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

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

Change-Id: If47173d9b203b2d3a175af290a15d986accb4703
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9663
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255831
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-21 22:10:32 +00:00
Hal Canary
b5c217b698 [reland] public.bzl: update to replace Gif with Wuffs
Original CL: https://review.skia.org/254578

Change-Id: I254e4e0d560f8772a6e2ca60209dca23384dadb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255819
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-11-21 22:05:01 +00:00
Mike Klein
1cb05993af all-constant peepholes
This adds a bunch of tests for ops that can all be evaluated directly in
skvm::Builder.  You can see the sort of effect this has by looking at
the diffs for SkVMTest.expected... lots of `v3 = sub_f32 v2 v2`
transformed to `v3 = splat 0 (0)` and that sort of thing.

My favorite part is handling many assert_true() calls at compile time!

While the old inter-Op code parallels aren't as clear now, these new
early-out tests kind of work like comments explaining each op.  I find
that nice.  I found it hard to parse so many uses of the word "splat" so
I did go back to isImm() from isSplat(), and added allImm() to test for
and read several immediates all at once.

Some of this is less C++17 than I'd like. :/

Change-Id: Ie8187d5d184195e3c0c92d613508fb708c28302f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255814
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-11-21 22:00:11 +00:00
Mike Reed
e0fbe94351 Use flat version of path-direction enum
Bug: skia:9663
Change-Id: I00077d9f2b14b3e983e6a46ef6f560cabdb1678d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242557
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-11-21 21:45:20 +00:00
Kevin Lubick
9c2b7cfe90 [canvaskit] Try some things to reduce GPU test flakiness
1) some flags that "The Internet" says may help
2) retry running the test script up to 3 times.

I wasn't able to reproduce the crashes with a non-Docker
Chrome, only in the Docker container, which was
very hard to debug.

Change-Id: I87f31c32f63b2770d8d5afa6a8e4b90c35dbf0bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255820
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2019-11-21 20:56:42 +00:00
Mike Klein
364506e999 build with Clang for Valgrind bots (take 2)
I had enough trouble merging that I've written a new CL.

This CL switches the Valgrind bots to Clang and resorts jobs.json.

Looks like we need to go back to limiting to SSE 4.1 when building with
Clang.  (We're much more aggressive about using AVX+ with Clang than we
were GCC.)

Change-Id: Ifbd3126a6ceb9b1c5ed0cf676d0f80d5457fce7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255537
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-11-21 17:50:28 +00:00
Mike Klein
260db43a77 add some missing bitfield initializers
OK this one is cool.

GrGLCaps::onSurfaceSupportsWritePixels() starts off like

    bool GrGLCaps::onSurfaceSupportsWritePixels(const GrSurface* surface) const {
        if (fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO) {
            ...

Clang compiles this into

    53e5:  cmpl   $0x0,0x94(%rdi)
    53ec:  js     5435 <GrGLCaps::onSurfaceSupportsWritePixels(GrSurface const*) const+0x5d>

I think what's going on is that
fDisallowTexSubImageForUnormConfigTexturesEverBoundToFBO is the 32nd of
a bunch of neighboring bitfields, and that makes it the top bit of the 4
bytes at a 0x94 byte offset from GrGLCaps (rdi == this).  The cmpl/js
combo is reading that whole 4-byte chunk of bitfields and asking "is
this negative", a fun and I'm sure efficient way to test that bit.

Now I bet Valgrind thinks all those bits need to be initialized to
answer that question, and I also bet GCC just slapped a big 4-byte 0
down onto all these bitfields, incidentally initializing the fields we
leave uninitialized.  In any case I think it's healthy to initialize
these fields.  Shame there aren't any bitfield initializers until C++20.
Think it's too early to upgrade?

Change-Id: I767515190cf1ed08cf1d6981e550a65ccaffdec5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255419
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-11-21 17:44:38 +00:00
Ethan Nicholas
fc671ad888 Reland "Fixed some GrSkSLFP limitations."
This is a reland of 190157bff2

Original change's description:
> Fixed some GrSkSLFP limitations.
> 
> This makes it possible to pass more types as uniforms / inputs and fixes an
> issue with non-main functions calling other non-main functions.
> 
> Change-Id: I6b5623b3c967d8219b992a455cc68bb0a29706b8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255300
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

Change-Id: Icc06cd54abb7acc83415915e16ca64c3eb6b943b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255779
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-11-21 17:40:38 +00:00
Michael Ludwig
119ac6d1b7 Normalize src coords and domain up front instead of at tessellation time
Change-Id: Ibdbd9b56e8848c4efd842fa658c6d76be4523043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255580
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-11-21 17:37:38 +00:00
Robert Phillips
8053c972b4 Add onPrePrepare to GrFillRRectOp
As the first real op to be updated this required the plumbing of the DstProxyView and the de-constification of the GrAppliedClip.

Bug: skia:9455
Change-Id: Ieaa16adfa1d114021b2ad60d0ef8ecbe31d9cc82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255136
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-21 17:30:08 +00:00
Herb Derby
a6c4a30deb Simplify makeOps API
The index API are no longer needed now that the Geometries
hold pointers instead of indexes.

Change-Id: I940520816ca58959f2c7c415a8f356ea5bf3d293
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255816
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-11-21 17:29:28 +00:00
Mike Klein
313b03ada0 one more stray Valgrind false positive
Still reasoning through that bitfield one, but this is unrelated, and
exactly like the other version.  Clang may decide to branch on `0 ==
strcmp(kChromium, suffix)` before it branches on the result of `3 ==
sscanf(..., suffix)` that only has initialized suffix when it is true.

Change-Id: If76e7b9087b59ddae4249d9f2828c881fa649c8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255418
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-11-21 17:13:40 +00:00
Hal Canary
389c8e9d2d [minor] mark scripts as executable
if a filename ends with `.py` and  the file begins with '#!.*python.*',
make it executable.

Change-Id: I41de516ff37343d3b0979bde9fd61813aec7365c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254439
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-11-21 17:06:27 +00:00
Hal Canary
1ec9a28a28 Replace third_party/gif with new DEPS entry.
- BUILD.gn `gif` optional source_set: use new skia_libgifcodec_path
    code, not third_party/gif code.

  - SkCodec.cpp: use third_party version of SkGifCodec.h.

  - rm src/codec/SkGifCodec.* third_party/gif/*

Original CL: https://review.skia.org/254582

Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian9-Clang-x86-devrel-Android_SKQP
Bug: skia:9654
Change-Id: Ia0379af70a5ec5656a7d123b8b6816b9fa24eaee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255780
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-11-21 16:57:57 +00:00
Mike Klein
19cb22e3d4 expand float peepholes
I started adding more _imm Ops like mul_f32_imm and noticed that there
was some low hanging peephole fruit here that we can harvest first.

Each of these peepholes I've added is sound in the way that I've
documented, and the div_f32 and mul_f32 peepholes are actively being
hit.  I think it's inevitable that the add_f32 and sub_f32 ones will be
hit eventually too as we expand how skvm is used.

The easiest place to see this in action is
when SkColorFilter_Matrix::program() is passed an opaque color:

    skvm::F32 invA = p->div(p->splat(1.0f), *a)

now leaves invA as splat(1.0f) directly, skipping the premul divide.
We still do the next part checking to see if invA is infinity; more
on that at the end of the CL description.

In this way I think we ought to never need to thread through a
shader_is_opaque parameter to color filters, instead letting the program
builder simply look and see if it is, among any number of other similar
optimizations.

Interestingly, though we may know sometimes the input to
SkColorFilter_Matrix::program() is opaque, as written today we'll never
know if the output is.  Since we don't specialize the code based on the
0/1 values of the matrix, we lose the knowledge that alpha is 1.0f as it
goes through the matrix.  There are two good ways to fix this:

   1) do specialize on 0/1 values of the matrix so that the program
      sees alpha is not changed when alpha is not changed;

   2) wrap today's virtual program() with a base-class non-virtual
      that queries getFlags() & kAlphaUnchanged_Flag to save and restore
      the input alpha, essentially marking any code that changes alpha
      as dead code.

2) is kind of the brute force, trusting version of 1), but does have
the advantage that the generated code need not change.  Still, in this
case of a matrix, I think we'll want to look at 0/1 values anyway...
they'll come up more often than just for the alpha channel.

You can see a mul_f32 peephole happen when the blitter goes to store any
known-opaque color to memory.  We go through some logic like

     alpha_as_byte = round(mul(alpha, splat(255.0f)))

and if alpha is known to be splat(1.0f), we'll now skip that mul(),

     alpha_as_byte = round(splat(255.0f))

I think this is all the strictly viable float peepholes where one
argument is a constant.  Obviously there are lots of peepholes we can
write for int32, int16, and bitwise instructions, and then there's a
whole untapped world of peepholes to explore when _all_ arguments are
constant.  These all-constant peepholes let our program notice that,
e.g., 1.0f < infinity and we can skip that part of the unpremul too, or
that round(splat(255.0f)) == 0xff and we can skip that work.

These all-constant peepholes may not be super important, as anywhere
they can trigger, the instruction must be hoistable: since all arguments
are constant, none depend on loop variables.  But still, nicer to run
once ever at compile time than once per invocation at runtime.  And it's
less code to analzye, less code to JIT, fewer instructions to interpret,
etc.

Change-Id: Ia2dc5af2cfff71a12693a2903f579a57c9302d12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255616
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-11-21 16:23:33 +00:00
Hal Canary
2dad99092c Replace third_party/gif: Preflight changes
Something is breaking client code in unexpected ways.  Let's try this
piecemeal.

  - skia_libgifcodec_path gn var. Default is
    third_party/externals/libgifcodec.  Anfroid framework uses
    third_party/libgifcodec.

  - skia_use_libgifcodec gn var; defaults to !skia_use_wuffs.  Allow
    disabling both codecs.

  - GN template("optional"): add public_include_dirs, similar to
    public_defines.

  - SK_USE_LIBGIFCODEC, ifdef for skia_use_libgifcodec.

  - SkCodec.cpp: use SK_USE_LIBGIFCODEC

Original CL:  https://review.skia.org/254582

Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian9-Clang-x86-devrel-Android_SKQP
Bug: skia:9654
Change-Id: I70561f5f945656065e4b318d5fff505961fb0b6b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255578
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-11-21 15:19:41 +00:00
Ethan Nicholas
056358a123 Revert "Fixed some GrSkSLFP limitations."
This reverts commit 190157bff2.

Reason for revert: regression in arithmode

Original change's description:
> Fixed some GrSkSLFP limitations.
> 
> This makes it possible to pass more types as uniforms / inputs and fixes an
> issue with non-main functions calling other non-main functions.
> 
> Change-Id: I6b5623b3c967d8219b992a455cc68bb0a29706b8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255300
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com

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

Change-Id: I85d1a10fab072b82f35c9caf2c27b07d380a7bf4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255776
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-11-21 15:12:01 +00:00
Greg Daniel
b184e9654d Update failure calls in GrVkMemory and shader creation.
Bug: skia:9603
Change-Id: I8571150bb7efe2f127c00d1a06e77ec8fa905d8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255526
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-11-21 14:44:11 +00:00
skia-autoroll
b4f8540803 Roll third_party/externals/angle2 99bd10b70422..b8e748be6b94 (17 commits)
99bd10b704..b8e748be6b

git log 99bd10b70422..b8e748be6b94 --date=short --no-merges --format='%ad %ae %s'
2019-11-21 b.schade@samsung.com Vulkan: Add an end2end test to log GLES capabilities
2019-11-20 jmadill@chromium.org Update dEQP KHR-GLES31 expectations.
2019-11-20 jmadill@chromium.org Work around dEQP KHR-GLES31 bug with tess/geom support.
2019-11-20 jmadill@chromium.org GN: Make dEQP import libEGL/libGLESv2 as data_deps.
2019-11-20 tobine@google.com Vulkan:Add Swiftshader configs
2019-11-20 jonahr@google.com Clean up dontUseLoopsToInitializeVariables condition
2019-11-20 b.schade@samsung.com Vulkan: Accelerate Texture PBO updates
2019-11-20 jonahr@google.com Add ability to disable all ANGLE features
2019-11-20 courtneygo@google.com Revert "Metal: Enable end2end tests."
2019-11-20 courtneygo@google.com Update expecatations for Program Pipeline tests
2019-11-20 lehoangq@gmail.com Mac: Add dsymutil to DEPS
2019-11-20 jiawei.shao@intel.com OpenGL: Port all Intel-related workaround conditions from gpu_driver_bug_list.json
2019-11-20 syoussefi@chromium.org Vulkan: Remove duplicate shader variation
2019-11-20 lehoangq@gmail.com Metal: Enable end2end tests.
2019-11-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/SwiftShader 79afb7620a69..2377845dd216 (6 commits)
2019-11-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/spirv-tools/src 57b4cb40b21d..2ee9aaa288d9 (3 commits)
2019-11-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll third_party/vulkan-validation-layers/src c2bd11586919..720c5deb0244 (11 commits)

Created with:
  gclient setdep -r third_party/externals/angle2@b8e748be6b94

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 robertphillips@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/+/master/autoroll/README.md

CQ_INCLUDE_TRYBOTS=skia.primary:Build-Debian9-Clang-x86_64-Release-ANGLE;skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: None
TBR=robertphillips@google.com
Change-Id: Ie82f5b417c56a6fe31e48190e16c22c05573ce5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255724
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2019-11-21 06:23:53 +00:00
skia-autoroll
b5fdb67fae Roll ../src 0db96f99f73d..137e8082047a (617 commits)
0db96f99f7..137e808204


Created with:
  gclient setdep -r ../src@137e808204

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-skia-autoroll
Please CC robertphillips@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/+/master/autoroll/README.md

CQ_INCLUDE_TRYBOTS=skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Bug: None
TBR=robertphillips@google.com
Change-Id: I7c29c6ea10916a0d0a06129df9f86f484fe24e3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255726
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2019-11-21 04:55:03 +00:00
skia-autoroll
2b3b17304b Roll third_party/externals/swiftshader 7e11f46ddf8e..f2c9ce1e08ed (9 commits)
https://swiftshader.googlesource.com/SwiftShader.git/+log/7e11f46ddf8e..f2c9ce1e08ed

git log 7e11f46ddf8e..f2c9ce1e08ed --date=short --no-merges --format='%ad %ae %s'
2019-11-20 awoloszyn@google.com Fix xcb library name.
2019-11-20 sugoi@google.com Remove unused depth buffer quad layout logic
2019-11-20 sugoi@google.com Fixed 3D image copy
2019-11-20 sugoi@google.com Remove depth+stencil formats from the Blitter
2019-11-20 bclayton@google.com Reactor: Move print apis out of core reactor header.
2019-11-20 bclayton@google.com Reactor: Remove the CallSupported capability.
2019-11-20 bclayton@google.com Reactor: Add ConstantData() and member function calling
2019-11-20 bclayton@google.com Reactor/Traits: Swap the naming of CToReactorPtr and CToReactorPtrT.
2019-11-20 bclayton@google.com Reactor/Traits: Fix brokenness with CToReactor::cast of pointers.

Created with:
  gclient setdep -r third_party/externals/swiftshader@f2c9ce1e08ed

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-skia-autoroll
Please CC robertphillips@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/+/master/autoroll/README.md

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
TBR=robertphillips@google.com
Change-Id: I40a47fb91b52489cd8e2e62a4b5bda0439eb502a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255725
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2019-11-21 04:51:53 +00:00
recipe-roller
4e02555087 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).


More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
depot_tools:
  https://crrev.com/2e2f58756d1c3a4f96271776279c99e85b4f3369 depot_tools: Run auth, cipd_bootstrap, git_number tests on python3. (ehmaldonado@chromium.org)
  https://crrev.com/589d4563baa8c6b5bfbcab884d9d56e8e37e981a depot_tools: Run watchlists tests on Python 3 (ehmaldonado@chromium.org)


TBR=borenet@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: Id94b87486f342a53b63206bb9445a2778758735f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255696
Reviewed-by: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2019-11-21 01:33:03 +00:00
Herb Derby
2984d2601e Remove device paths from SubRun
The ability to have device paths was removed a while ago.
Remove the code for device paths.

Change-Id: I09418eaa464b040c7bb13eac2e167997363e49d1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255530
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-11-21 01:09:53 +00:00
Mike Klein
2885ac3fe4 support 2 immediates
We support ops with up three arguments today, all three of which can be
registers, or one can be an immediate.  Extend this to allow up to two
immediates, fitting the uniform?? ops much better than my old 16-bit
hack.

(The next thing on my mind is adding Op::extract_imm where both the
shift and now too the mask are known to be immediates.)

This refactor lets me straighten out the kinks of some ops, mainly the
uniform?? ops and extract.  Things should generally now use x,y,z in
that order: most of the old immediates are now immy, and we use immz
only where we've already used the y register or immy immediate.

Small renaming isImm() -> isSplat().  I think this helps mutually
distinguish splat instructions, constants held by skvm instructions
(immy,immz), and constants as used by the JIT or assembler (still
generally `imm`).

Change-Id: I540a22a01459a39a499801362023ced7f2d6f49c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255538
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-11-20 23:26:03 +00:00
Mike Klein
69fd5e0101 fix SKVM_PERF_DUMPS
I broke this adding VTune support.

Change-Id: I53399a8717c86cce9864a0fe96decec828c75737
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255617
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-11-20 23:13:53 +00:00
Hal Canary
ce4693fb19 Revert "public.bzl: update to replace Gif with Wuffs"
This reverts commit 3e0aa84a55.

Reason for revert: try to fix g3 roll

Original change's description:
> public.bzl: update to replace Gif with Wuffs
> 
> Also, do away with complex exclude rules.  Explicit is often better.
> 
> Change-Id: I1d945c237a179f6db2552742fdf9e067d6d9eaf9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254578
> Commit-Queue: Hal Canary <halcanary@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Auto-Submit: Hal Canary <halcanary@google.com>

TBR=halcanary@google.com,scroggo@google.com

Change-Id: I7909840ef9d206718c3ac0483b555f5d2306a04f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255581
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-11-20 21:44:04 +00:00
Robert Phillips
7cd0bfe769 No longer ref count GrGeometryProcessors
This CL is 100% plumbing. We ultimately want all GrPrimitiveProcessor-derived objects to not be refCounted. This will make several helper objects POD and, by putting them into an arena, will make managing their lifetime easier (e.g., for DDL prePreparing).

Note: the CCPR GrGeometryProcessor-derived classes only ever appear on the stack so aren't forced into arenas.

Bug: skia:9455
Change-Id: Ib9be503d2fbf8c2578642df93fc301156629829d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255304
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-11-20 21:36:52 +00:00