Commit Graph

52370 Commits

Author SHA1 Message Date
Brian Salomon
0263bff0d2 Revert "Add GrSurfaceFillContext"
This reverts commit b339bbe9dc.


Revert "Make backend allocation tests avoid alphatype conversions"

This reverts commit 177af6f410.

Bug: skia:11019
Change-Id: Id80aa7df4a15c8530a609c49ca6264bce7831852
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344569
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-12-16 14:49:56 +00:00
Greg Daniel
fcd68167a2 Fix crash on windows viewer when starting in vulkan.
setRequestedDisplayParams is called when setting up viewer before we've
inited the Window. On windows this tries to attach the Window for a given
backend. However, we haven't set fBackend yet. Later on we will directly
call attach.

Change-Id: I4bd6586478f2b040e5913314c4e47e92fc893a60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344756
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-12-16 14:14:06 +00:00
Chris Dalton
15f51848df Reland "Disable HW tessellation shaders by default"
This is a reland of ad8b9fa2d7

Original change's description:
> Disable HW tessellation shaders by default
>
> The GLSL backdoor for tessellation shaders is only experimental at
> this point. In order to enable the tessellation path renderer, we need
> to turn off HW tessellation and let it use the indirect draw modes.
>
> Bug: skia:10419
> Change-Id: Ic979978a331c7ad016907cf42b2562b35caab8ab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344336
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com
Bug: skia:10419
Change-Id: I0bdf34da134a3a34a5c78b35cc0eb86d6e989bb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344796
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-12-16 05:08:25 +00:00
skia-autoroll
f3a61fc6c0 Roll SwiftShader from fa44979d90aa to 1ca6504eb7bb (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/fa44979d90aa..1ca6504eb7bb

2020-12-15 amaiorano@google.com Fix ReactorBenchmarks build failure

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 tdenniston@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:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: tdenniston@google.com
Change-Id: I6ecfde136ec27b810b900b2efed336b29ac52635
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344817
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-16 05:01:55 +00:00
skia-autoroll
21cb4768c9 Roll ANGLE from cb8903b14336 to 328f72ae21cb (15 revisions)
cb8903b143..328f72ae21

2020-12-16 jmadill@chromium.org Update VVL directories in Android build.
2020-12-16 m.maiya@samsung.com Vulkan: Accumulate internal cache stats in renderer
2020-12-15 timvp@google.com Vulkan: Ignore glFlush to reduce vkQueueSubmits in Asphalt 9
2020-12-15 paulthomson@google.com Tests: update WhatsApp trace
2020-12-15 cclao@google.com Vulkan: Reduce driver uniform data to minimum if specConst is used
2020-12-15 m.maiya@samsung.com Add EXT_clip_cull_distance extension autogen code
2020-12-15 m.maiya@samsung.com Vulkan: Add support for internal cache hit and miss counts
2020-12-15 m.maiya@samsung.com Add EXT_shader_framebuffer_fetch_non_coherent entry points
2020-12-15 m.maiya@samsung.com Vulkan: Add the tests for EXT_clip_cull_distance
2020-12-15 timvp@google.com Vulkan: flushCommandsAndEndRenderPass during glFenceSync()
2020-12-15 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from c16dc7107fd3 to fa44979d90aa (5 revisions)
2020-12-15 paulthomson@google.com Capture: Disable GL_NV_shader_noperspective_interpolation
2020-12-15 jmadill@chromium.org Mac: Remove stderr output from lib preload.
2020-12-15 jmadill@chromium.org Introduce GN variables for Vulkan repos.
2020-12-15 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 0c234289aa72 to 5a03bdd6e398 (963 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 tdenniston@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: tdenniston@google.com
Test: Test: Manual verification with angle_end2end_testsTest: Test: angle_perftests --gtest_filter="*whatsapp*"
Change-Id: I790af092ec42af17d35c33153ba4f33da234062b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344816
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-16 04:53:15 +00:00
skia-autoroll
de1dbe3bef Roll Chromium from 7d81a2685bc7 to cdbef3e3d304 (476 revisions)
7d81a2685b..cdbef3e3d3

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 tdenniston@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: tdenniston@google.com
Change-Id: I8845f234354b762e4f7b8961d26403caf7247340
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344794
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-16 04:47:45 +00:00
Brian Salomon
177af6f410 Make backend allocation tests avoid alphatype conversions
Also use GrColorTypes wherever possible.

As a consequence, some cases now go through GrSurfaceContext rather
than SkSurface (because it uses GrColorType and allows kUnpremul).

Both changes make it easier to add testing for GL_LUMINANCE8_ALPHA8,
which is required to update Flutter on iOS/GL to use new YUVA
texture image api.


Bug: skia:11019
Bug: skia:10632
Change-Id: I941d6272ca460f5b0355d11a90ac9edbc3233a2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344560
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-12-16 02:02:05 +00:00
Chris Dalton
b064334f82 Tessellation bug fixes
* Fix visitProxies when using DDL
* Handle when the GrClip is nullptr
* Use the same cropping/hw disable logic for onStencilClip as we do
  for onDrawClip.

Bug: skia:10419
Change-Id: I2ebd2b12ac9cc77cece6d3fbf6c16e246bafe544
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344479
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-12-16 01:58:25 +00:00
Chris Dalton
2078cbe3d4 Don't tessellate paths that have user stencil settings
This would require careful handling of the stencil that we have not
yet thought through.

Bug: skia:10419
Change-Id: I78a652309ae3469b64a28d6d96b06384e608695e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344376
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-12-16 01:54:05 +00:00
Brian Osman
f2876b0b9e SkSL: Only allow 'discard' in fragment shaders
Allowing this in runtime effects lets people break our contracts around
SkShaders on the color side of the paint altering coverage, etc.

Bug: skia:11085
Change-Id: I1ec8e71581c8d50f681cb0ca6ca8416375b3f43f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344760
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-12-15 21:34:15 +00:00
John Stiles
d059005b93 Avoid creating unnecessary scopes during inlining.
The additional scopes were harmless, but didn't really add any value.
Originally they were used to tightly scope inlined variables, but we now
mangle inlined variable names.

Change-Id: I7b35e737598036c0b6d3d9f71cbcd4a53d609ce9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344757
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-12-15 21:11:45 +00:00
Greg Daniel
2f7a7ad723 Refactor beginRenderPass in vulkan.
This CL is mostly just moving code into shared functions and moving the
renderpass granularity adjustments into GrVkOpsRenderPass. Future
changes for resolve loading will take more use of these new shared
functions.

Bug: skia:10979
Change-Id: I19928b403ac7a71be0a9588bce81db40496d3bb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344662
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-12-15 21:03:25 +00:00
Chris Dalton
1c2584d8cc Revert "Disable HW tessellation shaders by default"
This reverts commit ad8b9fa2d7.

Reason for revert: Benchmark failure

Original change's description:
> Disable HW tessellation shaders by default
>
> The GLSL backdoor for tessellation shaders is only experimental at
> this point. In order to enable the tessellation path renderer, we need
> to turn off HW tessellation and let it use the indirect draw modes.
>
> Bug: skia:10419
> Change-Id: Ic979978a331c7ad016907cf42b2562b35caab8ab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344336
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ia74dbcec582168870bd3ccc5e52b8dce0fb2bdfc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344698
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-15 20:45:46 +00:00
Michael Ludwig
9b1c960643 Top and base device are always non-null
Bug: skia:10987
Change-Id: Ic1bb363e82cc09e280be5cfe0a46748e11ebb69c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344663
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-12-15 20:27:25 +00:00
Mike Klein
9b0fc9c9c1 sketch Half in skvm
Key design points...

   A) Take care to not commit too much to Half's range or precision.
      In particular, don't offer operations whose result might not
      be representable in Half.  E.g., shy away from Half divide,
      not just because we might not be able to do a native divide,
      but even more so because division produces results that might
      not fit in Half, ±inf or NaN.

   B) No native Half loads, stores, uniforms or splats,
      instead converting from I32 or F32.  This keeps the entire
      front-end (user code, Builder, etc.) specified in terms of precise
      format and oblivious to the various backends' representations of
      Half.  Native Half splats would be less trouble than uniforms I
      think, and uniforms less trouble than loads and stores, but still
      enough a pain that we're better of deferring any of that for now.
      (Explicit fp16 uniforms do make sense to me though.)

   C) Keep the current F32-based Color and all the effect virtuals
      that use it around, introducing parallel Half-based HalfColors
      and entry points for those.  The key cool idea here is to have
      the default entry points for F32/Color and Half/HalfColor call
      each other, so that any given effect can implement one, the other,
      or both and always be compatble with however it's called.
      This is mostly about incremental rollout, but I suspect we'll
      have areas that stick to F32 forever.  (Think the IEEE 754 32-bit
      float specific bit hacks we used for approx_log/approx_exp.)

   D) (not done yet) allow implicit Half->F32 conversion, but not
      the other way around of course.  This makes it easier to lean
      on the body of F32 routines we already have, and again mostly
      helps enable incremental rollout.

Change-Id: I8bb38efbe476ff89dd2591411e115c2ab3757854
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341800
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-15 19:39:14 +00:00
Brian Salomon
b339bbe9dc Add GrSurfaceFillContext
This is a new base class for GrSurfaceDrawContext. It allows any
alpha-type but is restricted to non-blending fills of irects using FPs,
clears,and discards.

Bug: skia:11019

Change-Id: I229ce5f452e66796e2fa5c0e7a6ddccbf23bef5c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341680
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-12-15 19:31:44 +00:00
Chris Dalton
ad8b9fa2d7 Disable HW tessellation shaders by default
The GLSL backdoor for tessellation shaders is only experimental at
this point. In order to enable the tessellation path renderer, we need
to turn off HW tessellation and let it use the indirect draw modes.

Bug: skia:10419
Change-Id: Ic979978a331c7ad016907cf42b2562b35caab8ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344336
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-12-15 18:36:44 +00:00
Brian Salomon
775cf0dd1a Remove SK_IGNORE_GPU_CLAMP_BLUR_FIX guard
Bug: chromium:1156804
Change-Id: I95af34415f334bfc3c7ccef48a2110aa499b427c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344557
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-12-15 18:29:24 +00:00
Brian Salomon
a298431a13 Extend scissor respecification workaround to apply to all FBOS.
Bug: chromium:1152831
Change-Id: I31eb9dfe9a69d6db8b733c7c2db316a361d98488
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344658
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-12-15 18:14:25 +00:00
John Stiles
bead7e324a Remove GrFragmentProcessor::usesExplicitReturn.
All fragment processors now use explicit returns; sk_OutColor no longer
exists at all.

Change-Id: Ic5cf566a916c1d616edcc56ba84b6780776f8515
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344300
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-15 18:06:12 +00:00
Chris Dalton
06b52ada19 Add first class hairline support to tessellated stroking
Bug: skia:10419
Change-Id: I63f000e7b3c5623c1e40c3ce6950c8f5565bc11c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343477
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-12-15 18:05:32 +00:00
Nigel Tao
977715763d Have SkWuffsCodec use one Wuffs decoder
This mostly undoes commit 2777cd37 "Have SkWuffsCodec use two Wuffs
decoders", also known as
https://skia-review.googlesource.com/c/skia/+/250937

Using two Wuffs decoders is more complicated, but was necessary to allow
getFrameCount() to update when part-way through an incremental decode
while more data comes in. Updating that count matches an existing
Chromium test (TestResumePartialDecodeAfterClearFrameBufferCache).

On further discussion (crbug.com/1132828), that behavior is unnecessary
(and that Chromium test will be removed), so having Skia use two Wuffs
decoders is unnecessary complexity.

Removing the now-redundant WhichDecoder enum (an enum with only one
possible value), a mechanical change, will be a follow-up commit.

Bug: chromium:1132828
Bug: skia:8235
Change-Id: I892e4790c7265597be1eee10e6364e76b6402cb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342836
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Chris Blume <cblume@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-12-15 17:42:32 +00:00
John Stiles
cc2c1f8c95 Remove EmitArgs::fOutputColor.
This was completely unreferenced, as it should be.

Change-Id: I9ec99aa8f70e42618b3abc918a13dbb6e4fa1b1b
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344657
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-12-15 17:23:22 +00:00
John Stiles
02eb5dc371 Remove sk_OutColor built-in variable.
Change-Id: I41a5aea7b01efe8901498621197b9a5ff0f4fe5f
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344656
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>
2020-12-15 17:03:12 +00:00
Florin Malita
adc6889228 [svg] Refactor text rendering context plumbing
Instead of relying on RenderContext to pass text rendering options
downstack, introduce a dedicated virtual (onRenderText) and pass options
explicitly.

Root text nodes bridge from onRender() -> onRenderText().

This removes some complexity from RenderContext and incidentally fixes
xml:space = preserve (the value was being dropped during local ctx
copying).

Bug: skia:10840
Change-Id: Ic5fd9e0f9382f52f65108521574fcb2a422b97aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344559
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-15 16:54:42 +00:00
Martin Kustermann
b65d29919d Fix C API example, ensure the C API example is built in CI
Change-Id: I25529ec79bd53dcd475a959503d15b1be7d39970
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344616
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-15 16:38:42 +00:00
Mike Klein
f3009b23e5 more paint cleaning helpers
- rename to clean_paint_for_drawImage()
  - switch LatticePaint to clean_paint_for_lattice()
  - factor out clean_paint_for_drawVertices()

Change-Id: Icb31172dfcf4d20ca085a951b8239731441e5433
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344519
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-12-15 16:15:42 +00:00
Tyler Denniston
dcf288ba82 [svg] Fix filter region bounds
When the filter units are objectBoundingBox, values are fractions/pcts
of the object's bounding box, which we were miscomputing.

Also adding in a small tweak to return bounds for <polygon> elements
(will be needed for future filter tests).

Bug: skia:10841
Change-Id: I7fcac21258570d872672c42e99a9739a65c53e30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343520
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-15 16:15:19 +00:00
John Stiles
a16bdc1f66 Remove sk_OutColor usage from .fp unit tests.
Change-Id: Ief2a60fccdffcb8a0cf785a5adcca5d3e1172b49
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344298
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-15 16:06:13 +00:00
Michael Ludwig
887ac49f9e Always use AutoLayerForImageFilter
This definitely simplifies the drawing code, but always copies the input
SkPaint so that it can be modified if necessary. If we get perf hits, we
can just revert this. We could keep it using a copy-on-write, but with
this change, I believe we've removed the majority of instances of
SkCopyOnWrite<SkPaint> inside SkCanvas. There's just one LatticePaint
struct that's overly complex for what it does that I can clean up next.

A middle ground would be to keep the copy-on-write behavior, but drop
the branch on image-filter. Given the lack of perf needle movement on
some of the other simplifications that avoided technically unnecessary
paint copies, I doubt it's worth the complexity.

As part of this change, since the draw calls no longer branch based on
the presence of an image filter, the AutoLayerForImageFilter takes over
calling predrawNotify() in its various forms. We don't have to follow
through with that, if we'd rather have the notification be called out
explicitly within the draw call itself. I've found it easy to forget to
call predrawNotify(), or keep it in the right place while updating draws
so I may be biased.

Bug: skia:10987
Change-Id: I5204c175aae691f82cc45f3d9a04ef64dee5d80f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342920
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-12-15 15:38:19 +00:00
John Stiles
2bacaf973d Simplify Displacement fragment processor.
This had a hand-rolled version of unpremul() inside of it; it now
simply calls unpremul(). Also converted to return its result instead of
setting the sk_OutColor.

Change-Id: I1061bd01bc416e8260a82f7ee0f2a44910116e5f
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344297
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-15 15:20:44 +00:00
John Stiles
d1eab8b52e Replace more instances of sk_OutColor with explicit returns.
Change-Id: Ie6abd063e8954c004c856f555a82937ff4e6c0a8
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344296
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-15 15:14:09 +00:00
Ethan Nicholas
1ad5445100 Revert "Add integer relational ops to sksl_public."
This reverts commit b476981949.

Reason for revert: https://logs.chromium.org/logs/skia/507fb79e5cf79811/+/steps/dm/0/stdout

Original change's description:
> Add integer relational ops to sksl_public.
>
> These aren't implemented yet in the software rasterizer, but work
> properly on GPU and serve as a good end-to-end test for skia:10999.
>
> Change-Id: I1dac66cd5762ebde828e819c1b6890016599672e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344036
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>

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

Change-Id: Ic9ace24c3f0ea764b2720bffa50792a136d452ef
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344558
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-12-15 15:07:31 +00:00
John Stiles
b476981949 Add integer relational ops to sksl_public.
These aren't implemented yet in the software rasterizer, but work
properly on GPU and serve as a good end-to-end test for skia:10999.

Change-Id: I1dac66cd5762ebde828e819c1b6890016599672e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344036
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-12-15 14:43:59 +00:00
John Stiles
4bdc12142a Use explicit return statements in more fragment processors.
Change-Id: I9c059ec562f981fdd5a2ac78d40aec204af2a5f9
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344160
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-15 14:03:59 +00:00
skia-autoroll
0765022c15 Roll Chromium from 2c493e0e0782 to 7d81a2685bc7 (9278 revisions)
2c493e0e07..7d81a2685b

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 tdenniston@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: tdenniston@google.com
Change-Id: Iec7a3d5f3b3f6d04ed4d4e111a7d54d41697ed9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344438
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-15 05:35:09 +00:00
skia-autoroll
4df3fea426 Roll SwiftShader from c16dc7107fd3 to fa44979d90aa (5 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/c16dc7107fd3..fa44979d90aa

2020-12-14 capn@google.com Regres: remove "risky" tests.
2020-12-14 natsu@google.com Handle suballocated AHB buffers
2020-12-14 srisser@google.com Implement VK_KHR_uniform_buffer_standard_layout
2020-12-14 capn@google.com Update README
2020-12-14 capn@google.com Check that MSan builds use Clang

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 tdenniston@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:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: tdenniston@google.com
Change-Id: Id5bab3359b2ece7699925ac8dfdf942808821e6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344457
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-15 04:53:49 +00:00
skia-autoroll
f01e6c8267 Roll ANGLE from 282fb4092b6c to cb8903b14336 (6 revisions)
282fb4092b..cb8903b143

2020-12-15 lehoangq@gmail.com Metal: Ignore OS's internal shader cache when testing.
2020-12-14 cwallez@chromium.org GeometryTest: Expand suppressions to AMD Intel OpenGL
2020-12-14 m.maiya@samsung.com Vulkan: Add test for Pixel bug with passthrough GLSL function
2020-12-14 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 0a64a9747555 to c16dc7107fd3 (8 revisions)
2020-12-14 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from c594de23cdd7 to c0bcfaf3bae9 (3 revisions)
2020-12-14 xiaoxuan.liu@arm.com Vulkan: Fix build issue in vulkan display/headless backend.

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 tdenniston@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: tdenniston@google.com
Change-Id: I401a45adae5af0cd7f1ef8058dd01cea13c1bf4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344456
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-15 04:53:39 +00:00
Mike Klein
f124108e23 how to use SkArenaAlloc with no friends
No more

    friend class ::SkArenaAlloc; // for access to ctor

Change-Id: I76fa3319498a965623e6865b75d1fb507ab845a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344236
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-12-15 01:23:18 +00:00
Chris Dalton
23096a33a8 Get CanvasKit viewer compiling again
This probably isn't ideal, but it's a step to keep it compiling while we
get this utility up and running in a more permanent way.

Change-Id: I98f56fe28b98862000a134f697bb441d87e47f30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344176
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-12-15 01:10:48 +00:00
Jorge Betancourt
f607dbbbe8 implement SkAudioPLayer for Android
move SkAudioPlayer for Android to proper module
refine playback features for the Android AudioPlayer

Change-Id: I1906c3b3ef91fa4173f66c2c068dc40a3cf824ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319037
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2020-12-15 00:12:48 +00:00
John Stiles
1c50643b3c Optimize Gaussian convolution fragment processor.
This FP now uses an explicit return statement instead of sk_OutColor.
Additionally, simplified the generated code by removing a temp variable
that did nothing (coordSampled), and by removing a needless addition at
the end of the loop.

It looks like coordSampled was useful when it was introduced at
http://review.skia.org/20465, but it was later rendered useless.

Change-Id: I8c549b16b4d422d7faeab48e2087f168ad5788b5
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344156
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-14 22:54:37 +00:00
Kevin Lubick
1d2b075ce0 [wasm-gms] Enable filesystem by default.
Some of the SVG libraries, there appear to be some SYScalls
(getStreamFromFD) that are no longer included in an emsdk 2.0.10 build.

Change-Id: Ib6ac4c20186e79316cd5b2566ed2deb2d3e3d0af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344076
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-14 20:40:40 +00:00
John Stiles
e28f50950f Remove sk_OutColor from a handful of fragment processors.
Change-Id: I842d04855a711481fae64bc1671a8c433eb27265
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344056
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-12-14 20:31:37 +00:00
Michael Ludwig
f79b298b9d Remove UPDATE_DEVICE_CLIP macro
Folds the update of fQuickRejectBounds into the destructor of the Auto
object. So it's still a little magical, but less so than a macro.

Bug: skia:10987
Change-Id: I275b21718291c353e889da77e1e56ee6a0dbb72c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342922
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-12-14 20:04:07 +00:00
Weston Tracey
9b395f55ea [infra] Use Mac10.15.7 and xcode 12.2 for CommandBuffer builds.
Bug: skia:11082
Change-Id: I5ba2f9ae85ce7e008c2fc656be605c022466720d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343938
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Weston Tracey <westont@google.com>
2020-12-14 19:57:27 +00:00
Chris Dalton
39ce12e0d4 Don't store tessellation tolerances on GrStrokeOp
Instead we calculate these values on the fly as needed. This is
necessary for hairlines because the tessellator will operate on them
in post-transform space, which requires different tolerances than the
setup code.

Bug: skia:10419
Change-Id: Ia8ffa8858b45949521c085ccbe5712b3842f785f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343499
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-12-14 18:16:47 +00:00
John Stiles
9685e524d3 Implement findMSB intrinsic in Metal.
findMSB has one special trick that Metal doesn't naturally have an
equivalent for, specifically in its treatment of negative numbers.
findMSB searches negative numbers for a zero bit, not a one bit!
We emulate this behavior in Metal using select(n, ~n, n<0).

Change-Id: I861c6b8fb3dc5427643cd8c68a39a53f1959bff3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343996
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-14 18:07:13 +00:00
Brian Salomon
bdbfcd2374 Revert "Revert "Add new SkCanvas methods for Android Framework WebView queries.""
This reverts commit f760258654.

This version doesn't assume SK_BUILD_FOR_ANDROID_FRAMEWORK implies SK_SUPPORT_GPU

Cq-Include-Trybots: luci.skia.skia.primary:Canary-Android
Change-Id: Ib1d983d76f3258ed84aa2d6ef4a5cddf7f342cf3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343578
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-12-14 17:54:13 +00:00
Robert Phillips
bc68832c2d Separate the playback and recording characterizations in the DDLTileHelper
When replaying DDLs w/ offsets it is no longer true that the
dimensions of the recording characterization must match those of
the playback characterization.

Change-Id: I3dba1a91af3d58aaf3619274303f8d2b10a76e24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344016
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-12-14 17:49:43 +00:00