Commit Graph

51401 Commits

Author SHA1 Message Date
John Stiles
f4bda743ff Rename SkTArray::reserve to reserve_back.
The semantics of `vector::reserve` and `SkTArray::reserve` were not the
same. SkTArray::reserve takes a delta over the current array size,
whereas vector takes a total array size. This could lead to subtle
errors with over- or under-reservation, hurting performance.

This CL renames `SkTArray::reserve` to `SkTArray::reserve_back` to give
the SkTArray behavior a distinct (hopefully easily understandable) name,
leaving its functionality as-is.

Change-Id: Icbd3114bb317fd5f307f393c02ae6fb6f83764e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326956
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-10-14 21:42:11 +00:00
Michael Ludwig
6aaecfb7f7 Update image filter debug samples to use new APIs
For clarity, this renames skif::Mapping::Make to skif::Mapping::DecomposeCTM
to really emphasize when it should be used over just a constructor.

Renames SampleBackdropBounds to SampleFilterBounds since the operations and
coordinate spaces that it visualizes are the same for regular or backdrop
filtering (we just swap the notion of src and dst devices, really).
Technically, this is not quite true yet since regular filtering modifies the
DAG with a matrix transform right now, but that's going away soon (tm).

The "new" SampleFilterBounds example is updated to use the new bounds APIs
that use the coord-space safe types in the skif namespace. It also visualizes
a filter, and simplifies some of the bounds being drawn and reported to
only those most interesting.

The SampleImageFilterDAG has been updated to match the soon-to-be state
of how SkCanvas processes regular image filters for a saveLayer. All
implicit matrix-transform node code is removed. The bounds calculation
code is similarly updated to use the new 'skif' types and functions. To
simplify the visualization of each node, the 'isolated' versions of the
bounds were dropped.

Bug: skia:9282, skia:9283
Change-Id: If2ad2c302e5165ae009bba93cea52bf0566a543a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326718
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-10-14 20:45:41 +00:00
Mike Reed
c924a88e33 SkPath::shrinkToFit() needs to perform copy-on-write
When we shrink a path, we might relocate its underlying arrays.
Doing so would invalidate any outstanding Iterators. The caller must
handle this for its path object, but there may be copies elsewhere,
which have just ref'd the underlying arrays. To keep these copys'
iterators alive, we defensively "copy-on-write", so as to not relocate
their buffers.

Incidentally, update SkContourMeasureIter's constructor to clarify that
it is iterating through its copy of the path, and not the original.

Change-Id: I5c9331ab36ac8e156218532478f6d7105fd97cdc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326438
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-10-14 20:24:11 +00:00
Derek Sollenberger
acb63208ca Enable AHB Surfaces with protected context for OpenGL
Bug: b/168500121
Change-Id: Iecc92571a3bb72dcf296fc93d4a20909b8091b0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326949
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2020-10-14 20:19:21 +00:00
Mike Klein
7485ffc611 slightly more complex runtime color filter GM
This adds a runtime color filter with about the same control flow
complexity as Android's tone mapping.  As expected failing on 8888:

    error: 11: return not allowed inside conditional or loop

Incidentally, is there no `const` in sksl?  I made color and luma const
out of habit but got GL/Metal compilation errors (but not sksl ones as
far as I can tell).

Change-Id: Ic4370c068a27349a7f5ab64ecf5ddbb34e91d8f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326909
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-10-14 19:57:41 +00:00
Adlai Holler
3b12470379 Fix generated files
Cq-Include-Trybots: luci.skia.skia.primary:Housekeeper-PerCommit-CheckGeneratedFiles
Change-Id: Ic57247bd044c08140a8392645703e479fe1829ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326903
Commit-Queue: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-14 19:12:01 +00:00
Ethan Nicholas
0a5d096eeb moved SkSL FunctionDefinition data into IRNode
Change-Id: Ia828de0793ee66301ba315f4593b4d7d69222b4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326717
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-10-14 18:53:41 +00:00
Robert Phillips
3172208ad0 Revert "Remove GrContext"
This reverts commit 2edf18d818.

Reason for revert: breaking wasm-debugger

Original change's description:
> Remove GrContext
>
> Woo!
>
> Change-Id: Ifa3ff7e79c7048c2f1d808cc9705593d72886f08
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326436
> Auto-Submit: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com

Change-Id: Ie05bda5dad7fb5d369ebe579d2e009fdb99c0729
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326941
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-14 18:30:13 +00:00
Chris Dalton
34ddcb84f3 Convert GrWangsFormula to skvx
Change-Id: Ibd26204033aa3f6a8ea13be23926b1541a41c621
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324737
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-10-14 17:57:42 +00:00
Adlai Holler
2edf18d818 Remove GrContext
Woo!

Change-Id: Ifa3ff7e79c7048c2f1d808cc9705593d72886f08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326436
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-10-14 17:47:31 +00:00
Robert Phillips
52ace08ef8 Fix special case in SkRRect::setOval where the oval devolves to a rect
Bug:1119593
Change-Id: I6c25c54840f44b5143e40b4ec5da403a737e9d1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326441
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-14 17:44:51 +00:00
Robert Phillips
6ffcb23435 Pull the triangulating path renderer's unique key creation into a sub-routine
We will need to be a bit more flexible wrt making this key if the
triangulated path is to be stored in the thread-safe cache.

Bug: 1108408
Change-Id: I5aeae60fb8e542152cc75ea5244b324f05c4fb04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326836
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-14 17:42:16 +00:00
Florin Malita
30f5f828bc Delete SkPEG
Not used.

TBR=
Change-Id: I0c545c23e04bd8c63fadc07023363e4978e87b1b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326838
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-10-14 17:37:12 +00:00
Ethan Nicholas
c51f33e784 moved SkSL VarDeclarations data into IRNode
Change-Id: I03bdef43c79bc3c997f9a9a6aa8fbb1a7194943a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326437
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-10-14 17:37:11 +00:00
Jiulong Wang
df5739ce3f Fix GrCCPerFlushResources error caused by cache eviction
By storing the cached atlas proxies in GrCCDrawPathsOp. This is
important because GrCCPathCache may evict an entry that is being used
in current flush, causing the op to lose the proxy it intended to draw
from.

Co-authored with Chris Dalton <csmartdalton@google.com>

Bug: chromium:1102117
Change-Id: I2e4b9360a84732269b6ce98f4d8adfc7e7b9735c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326576
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-10-14 17:24:41 +00:00
Adlai Holler
a069304560 Rename GrContextPriv to GrDirectContextPriv
Change-Id: I3fccadd8a2860dbee73f93f995738146373f8a39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326196
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-14 16:46:01 +00:00
Robert Phillips
27f283f250 Update error handling in DDL-averse GMs
This will allow local debug DDL dm runs to complete.

Change-Id: I47aa978c5e52fd1dcdba45c59318844bae871115
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326796
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-14 16:42:01 +00:00
Mike Klein
f4c6463695 refine SkPath::approximateBytesUsed()
Instead of looking at point/verb/weight counts, add an
SkPathRef::approximateBytesUsed() using their reserve counts.

This shows SkPathBuilder::snapshot() can return more memory-efficient
SkPaths than SkPathBuilder::detach(), at the cost of a copy.

Change-Id: I4e208c41643480d7682daba6ac674ffa63c74de2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326608
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-10-14 15:05:36 +00:00
Adlai Holler
53cf44cfaf Migrate GrContextPriv & ivars to GrDirectContext
After this, GrContextPriv gets renamed and GrContext gets removed.

Change-Id: I49b034e4669876becb50b93c5fe3af887481e1ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326158
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-10-14 14:32:49 +00:00
Mike Klein
9a6efa6be2 move scalar functions out of SkVx.h
Now that we have skvx::map(), anyone can write this sort of
scalar-to-vector code.  There are no vector instructions for these, so
they'll never going to be particularly interesting for SkVx to provide.

We did work out _approximate_ versions of each of these for SkVM, and
that's what we use to evaluate these programs there.  So if this stuff
really matters we could port that logic back over to SkVx.h.

But in terms of pure refactoring, I think this is where we want to sit
until we decide to use those approximations.  I don't really want to
invest much time in the SkSLByteCode interpreter any more.

Change-Id: I4e595dee5fd9e608905305e46b2aebcab986c561
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326277
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-14 14:24:46 +00:00
skia-autoroll
c5d2a2fe53 Roll ANGLE from df6b7298bb41 to bd0d3f9c4ff8 (15 revisions)
df6b7298bb..bd0d3f9c4f

2020-10-14 syoussefi@chromium.org Vulkan: Regression test for content defined of AHB images
2020-10-14 syoussefi@chromium.org Vulkan: Don't break the render pass on scissored clears
2020-10-14 syoussefi@chromium.org Vulkan: Regression test for content defined of external images
2020-10-14 jmadill@chromium.org Test Runner: Accept GTEST shard environment vars.
2020-10-14 ianelliott@google.com Vulkan: Remove Arm from perFrameWindowSizeQuery
2020-10-14 jmadill@chromium.org trigger.py: Remove GTest shard env when running one shard.
2020-10-13 jmadill@chromium.org Suppress multisample "max samples" tests on Win/NV/GL.
2020-10-13 jmadill@chromium.org Test Runner: List tests explicitly without GTest.
2020-10-13 syoussefi@chromium.org Vulkan: Fix command reordering on release to external
2020-10-13 Kyle.Griffiths@imgtec.com Add PowerVR Vendor ID & Vulkan GL Line Emulation Exclusion
2020-10-13 bsheedy@chromium.org Update IsARM64
2020-10-13 jmadill@chromium.org Broaden Clear test failure to all OSX.
2020-10-13 jmadill@chromium.org Capture/Replay: Embed ANGLE version in replay.
2020-10-13 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from 2067d1a93e6e to f4f1d8a352ca (2 revisions)
2020-10-13 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from efbcef254191 to a6b7134c40b1 (408 revisions)

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

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Tbr: robertphillips@google.com
Change-Id: I4b2829d5a55a7f35290be25a2fe71e2f6258003d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326662
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-14 05:02:06 +00:00
skia-autoroll
e00d6ecf7f Roll Chromium from c41005660bb2 to 7cb4c97a5eda (455 revisions)
c41005660b..7cb4c97a5e

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

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: robertphillips@google.com
Change-Id: I4088ef8df3229ad741fcb31e8ee4e0371518c8e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326660
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-14 04:55:15 +00:00
skia-autoroll
9944600118 Roll Dawn from d1bca09f4ab3 to cac0442277f7 (2 revisions)
https://dawn.googlesource.com/dawn.git/+log/d1bca09f4ab3..cac0442277f7

2020-10-13 enga@chromium.org dawn_wire: Support chunked commands
2020-10-13 rharrison@chromium.org Add running spirv-val on output of Tint

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dawn-skia-autoroll
Please CC enga@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: enga@google.com
Change-Id: I0fe16d010b78031627580152c4aa9afb26504343
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326661
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-14 04:48:06 +00:00
Mike Klein
6b8b2ea6be move cfi stifle post-refactor
Cq-Include-Trybots: luci.chromium.try:linux_chromium_cfi_rel_ng
Bug: chromium:1137652, chromium:1137958
Change-Id: I8575b588f9a1ba89740b95382b2462338e34bec5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326478
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-10-14 00:27:07 +00:00
Greg Daniel
e2893f2df8 Use the new GrMSAAAttachment class in vulkan.
Instead of creating internal msaa VkImages for vulkan render targets we
now get a GrMSAAAttachment from the resource provider to use instead.
As of now only one GrVkRenderTarget can hold a ref to an msaa attachment
at a time.

Bug: skia:10830
Change-Id: I361a1687f10e047a5b61228f861326f2b1418f06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320272
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-10-13 20:12:41 +00:00
Adlai Holler
6d0745b338 Migrate last public API to GrDirectContext
Cut & paste with some reorganization of includes & forward-decls.

Next up is GrContextPriv.

Change-Id: I72d2d95c62692e3b37608517b796c0041ffedea3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326157
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-10-13 20:10:01 +00:00
Julia Lavrova
87cb9a4a10 Select a position on an empty line
Bugs: skia:10821
Change-Id: I26746e7baa143a6be7afdc91c994e4b8731d07f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324879
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-10-13 18:59:01 +00:00
John Stiles
7bbdde0596 Convert extraRepeatCoord to a float2.
This allows us to clamp the X and Y axis at the same time.
This is a partial reland of http://review.skia.org/318436.

Change-Id: I711076e434d10d4d83593922ec31f0a75a300f9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324126
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-13 18:28:31 +00:00
Brian Salomon
68b245cc98 Remove resize-on-gpu variation from wacky_yuv GMs
Was more of a demo than a test. Complicates coming refactor to move
SkImage creation for this test into LazyYUVImage.

Bug: skia:10632
Change-Id: I6e2303acdd38724417bb51d11aca29c100a6f3ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326356
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-10-13 17:57:20 +00:00
Michael Ludwig
278263d6ef Reland "SkDevice::drawSpecial accepts arbitrary matrix v2"
This reverts commit 7563a48787.

Reason for revert: safe to reland once cc_unittest is suppressed: https://chromium-review.googlesource.com/c/chromium/src/+/2464093

Original change's description:
> Revert "SkDevice::drawSpecial accepts arbitrary matrix v2"
>
> 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>

TBR=mtklein@google.com,robertphillips@google.com,reed@google.com,michaelludwig@google.com

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

Bug: skia:9545
Change-Id: I5784b3b49f9e3a32a52782fe683b8f85aaa6b88a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325856
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-10-13 17:56:10 +00:00
Florin Malita
367ed49661 Fix skottie2movie post https://skia-review.googlesource.com/c/skia/+/325618
TBR=

Change-Id: Iec74270e135d1ad5a5be6ea51ceeb802e101e4d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326358
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2020-10-13 17:35:30 +00:00
John Stiles
87ae34eb94 Replace remaining vector<Expression>s with ExpressionArray.
This fixes up a handful of places which weren't caught in the initial
work (at http://review.skia.org/325861) because they haven't been
converted to the new IRNode structure yet.

Change-Id: I86b61fe3c601711b5802fe35218ca2e6378634da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326357
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-13 17:32:00 +00:00
Adlai Holler
64e138367e Migrate compressed texture methods to GrDirectContext
Cut and paste job.

Change-Id: I36ba9ae0854a3a8578555ba3d6fe48db2fc755b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326156
Auto-Submit: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-13 17:24:40 +00:00
Mike Klein
311b648013 Reland "pack SkTArray"
This is a reland of b3c42efd25
with a few more signed/unsigned mismatches fixed up.

Original change's description:
> pack SkTArray
>
> Same idea as http://review.skia.org/325857; I just wanted to feel out
> the options myself. A couple key ideas:
>
>     Prefer SkTo32() to separate range assertions and casts.
>
>     Keep using int indices, counting to this->count() where
>     fCount would have warned about signed/unsigned mismatch.
>
> I've kept new comments and assertions to minimum.  In the end we won't
> change the max size of SkTArray, and I don't see much need to call out
> how much it hasn't changed.  Reading back over the accumulated changes,
> I don't really see much that's newly error-prone.
>
> Change-Id: I86a8a161b9ae44f24fc25093741945b75fbfa770
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326106
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>

Change-Id: I04d928ecc185fb5c7b9d32f60e94df9f8d137898
Cq-Include-Trybots: luci.skia.skia.primary:Build-Win-MSVC-x86_64-Debug-Vulkan,Build-Win-MSVC-x86-Debug
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326297
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-13 17:16:03 +00:00
Brian Osman
5bf3e20f3a Remove setModifiersHandle, restore const-ness to Symbols
Change-Id: I40ceb5cab0473c08c92fbb6aa9afad6173c0fb37
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325624
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-10-13 17:06:10 +00:00
John Stiles
8f2a0cfdf8 Convert statement arrays from std::vector to SkSTArray.
This will help us avoid allocations for arrays of statements.

Currently, this is a wash in Nanobench (~0% change). In the near
future, we expect to collapse the expression array and statement array
into a single hybrid array, and this helps bring us closer to that end
goal.

Change-Id: Id146907352799c41b568090ab65e454247b294c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325625
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-13 17:06:01 +00:00
Brian Osman
68c1d4069c Declare sk_InvocationID programmatically
This lets us declare it correctly depending on caps, rather than editing
the modifiers of a (shared) global variable.

Change-Id: Ifcdc5e0a8e9b852685ee03a46b537b986b5d35de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325623
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-10-13 16:41:41 +00:00
Adlai Holler
2e0c70dc9c Migrate texture update methods to GrDirectContext
Cut & paste job, but I did replace some cases of just calling
inherited implementations with using-statements. There are
other methods on this class that are using-statements and
that pattern is cleaner.

Change-Id: Ie369c643e44bdb8f82dfffcf45c1f65d48606899
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-10-13 16:01:42 +00:00
Mike Klein
43a2d428eb Revert "pack SkTArray"
This reverts commit b3c42efd25.

Reason for revert: Build-Win-MSVC-x86_64-Debug-Vulkan


Original change's description:
> pack SkTArray
>
> Same idea as http://review.skia.org/325857; I just wanted to feel out
> the options myself. A couple key ideas:
>
>     Prefer SkTo32() to separate range assertions and casts.
>
>     Keep using int indices, counting to this->count() where
>     fCount would have warned about signed/unsigned mismatch.
>
> I've kept new comments and assertions to minimum.  In the end we won't
> change the max size of SkTArray, and I don't see much need to call out
> how much it hasn't changed.  Reading back over the accumulated changes,
> I don't really see much that's newly error-prone.
>
> Change-Id: I86a8a161b9ae44f24fc25093741945b75fbfa770
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326106
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>

TBR=mtklein@google.com,johnstiles@google.com

Change-Id: I8267a05e1ce075bfa7893c60f7c77dbf4f8cf061
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326296
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-10-13 16:01:10 +00:00
John Stiles
8e3b6be33d Convert expression arrays from std::vector to SkSTArray.
This will help us avoid allocations for simple expressions.

Nanobench shows ~5% improvement with an array size of 2:
http://screen/8oDEY7hjrhY8C6k

Other array sizes will show different levels of improvement, but I
haven't done an exhaustive trial. (2 was noticeably better than 1.)

Change-Id: I005a7896a0db83df4e3c2d3c0fa3321203f8a0b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325861
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-13 15:56:41 +00:00
Mike Klein
a221f1c36d remove skvx::{rsqrt,rcp}
These don't return reliable portable results, so I don't want to promote
them as good ideas to use.  You can get at least 5 different results
from these across the four main architectures we support, and they've
been the root cause of bugs uncovered only in production on undertested
platforms.

Luckily, unused outside of tests.

Change-Id: I532731fe4cddf127253341e5ace8d9c5c9ebb0f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326108
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-10-13 15:52:56 +00:00
Mike Klein
b3c42efd25 pack SkTArray
Same idea as http://review.skia.org/325857; I just wanted to feel out
the options myself. A couple key ideas:

    Prefer SkTo32() to separate range assertions and casts.

    Keep using int indices, counting to this->count() where
    fCount would have warned about signed/unsigned mismatch.

I've kept new comments and assertions to minimum.  In the end we won't
change the max size of SkTArray, and I don't see much need to call out
how much it hasn't changed.  Reading back over the accumulated changes,
I don't really see much that's newly error-prone.

Change-Id: I86a8a161b9ae44f24fc25093741945b75fbfa770
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326106
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-13 15:51:06 +00:00
Adlai Holler
98dd004e7e Migrate texture creation methods to GrDirectContext
Cut and paste job. Getting close!

Change-Id: Ifd1673a92a44dac1e8aab578a3e41b2a2b5e3325

Cq-Include-Trybots: luci.skia.skia.primary:Perf-Debian10-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit,Perf-Debian10-EMCC-GCE-CPU-AVX2-wasm-Release-All-Puppeteer_RenderSKP
Change-Id: Ifd1673a92a44dac1e8aab578a3e41b2a2b5e3325
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325659
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-10-13 15:38:37 +00:00
Ethan Nicholas
077050b019 moved SkSL ModifiersDeclaration data into IRNode
Change-Id: Iebe59b32a965e383d2b032258d7731645e0bd1a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325622
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-13 15:22:26 +00:00
John Stiles
4c412bce4c Revert "Reland "Remove inliner from IR generation stage.""
This reverts commit e497a08065.

Reason for revert: Pinpoint disagrees

Original change's description:
> Reland "Remove inliner from IR generation stage."
>
> 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>

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

Change-Id: I79149467565f22f53b8c28868dd53b80f3421137
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325626
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-13 15:20:28 +00:00
John Stiles
1c03d336d7 Revert "Clean up SkSL inliner and allow it to be disabled."
This reverts commit d34d56e279.

Reason for revert: Pinpoint

This is not a pure rollback (we keep the early-out checks for
fInlineThreshold to avoid breaking tests).

Original change's description:
> Clean up SkSL inliner and allow it to be disabled.
>
> - 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>

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

Change-Id: I288d82273abfc2587859cc92d5a4c663694c38a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325621
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-13 15:13:26 +00:00
Brian Osman
f1319c3756 Add GLSL type aliases for SkRuntimeEffect SkSL
Adds vec[N], mat[N], and mat[NxM] aliases when building runtime effect
code. Also moves the "shader" alias for fragmentProcessor so it's only
usable in that context.

Bug: skia:10679
Change-Id: Ia337bb680c50da32639bb1d4ffc3bc01df306b0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325620
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-10-13 14:57:06 +00:00
Michael Ludwig
01b93eabe2 Add SkImageFilters::Blend rename for Xfermode filter
This better matches SkShaders::Blend and SkColorFilters::Blend factories.

Bug: skia:9310
Change-Id: I02a3fe488a446b803df96518caacff1fdf536e9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324623
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-10-13 14:28:26 +00:00
Brian Osman
8dbdf23f31 Remove two uses of setModifiersHandle
As a prelude to going back to sharing global data (safely), we want to
eliminate as much mutation of shared state as possible. The special
cases for global variable declaration were unnecessary, so just remove
them. The editing of main's parameters immediately after they were
created is also unnecessary - just hoist the logic up so we create the
variables correctly in the first place.

There is still one use, related to invocation ID. That's more
complicated (?), so leaving it as a separate CL.

Change-Id: Ia3dad78dd5a634273b2e2239368be7adaff65f38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325661
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
2020-10-13 14:15:18 +00:00
Adlai Holler
3acc69a908 Migrate flush & misc methods to GrDirectContext
More cut and paste work.

Change-Id: I0dfc822ae168e15c6734a6c079bb930fc0fa9e60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325618
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-13 13:45:35 +00:00