Commit Graph

49400 Commits

Author SHA1 Message Date
Brian Osman
1298bc46ac Change SampleMatrix to SampleUsage
It now tracks all sample calls of a child (matrix, explicit coords,
pass through). There is now just one registerChild() call, and the
sampling pattern of that child is fully determined by the SampleUsage
parameter.

Change-Id: Iaadcd325fca64a59f24192aadd06923c66362181
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299875
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-07-01 16:37:43 +00:00
Robert Phillips
f8f45d91b2 Make asDirectContext public
External clients will eventually have to call this to get access
to a direct context from an SkCanvas or SkSurface (which will
only have 'recordingContext' accessors).

Bug: skia:10441
Change-Id: I10e34081277b685fa59d03e1fce1887f3524e0fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300178
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-01 16:30:03 +00:00
John Stiles
d2f870c911 Fix modifier key handling in OS X to allow command-keys to work.
A variety of modifier key handling issues are addressed in this CL:
- Added a skui::Key for the Super key (this is ImGui's name for command)
- Added OS X event handling for `flagsChanged` (sent when modifier keys
  are pressed)
- OS X manually tracks modifier key state and sends key-up and key-down
  events to the ImGuiLayer as necessary
- OS X does not send key-up events when hotkeys are pressed, so these
  are manually synthesized and sent to ImGui (otherwise hotkeys are
  repeated forever)
- Replaced hardcoded Virtual Key valus in OS X code with named constants
- Our custom bitmask type was lacking the ability to XOR

This CL does NOT enable the OS X clipboard; this uses the ImGui internal
clipboard.

Change-Id: I76b55215858bfb6441dbef18ad638426fa8bc073
Bug: skia:10338
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300182
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-07-01 16:07:03 +00:00
Jim Van Verth
e381036051 Fix D3D debug clang build.
Adds in the GR_D3D_CALL_ERRCHECK utility macro to avoid this in the
future.

Change-Id: I68112bcccbd8cb9d55ae02e99de954269d0ac4bd
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300176
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-07-01 14:39:53 +00:00
Zepeng Hu
ba7cbf76d4 Add SkSVGCanvas api Fuzzer
When manipulating svg file, the implementation of SkSVGCanvas will be used instead of the 
implementation of SkCanvas, so the api are tested against SkSVGCanvas. In addition, there are 
more api need to be covered in the function fuzz_canvas. As a result, the main changes are to 
add new DEF_FUZZ for SkSVGCanvas and to modify fuzz_canvas to increase the coverages of api.

Change-Id: Iaf6114bb0e2929c73549ff398c3db5592e736ea2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298977
Commit-Queue: Zepeng Hu <zepenghu@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-01 13:48:45 +00:00
skia-autoroll
16ee98dded Roll Chromium from 277fb4f3a407 to 13ebce234ed3 (489 revisions)
277fb4f3a4..13ebce234e

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 ethannicholas@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: ethannicholas@google.com
Change-Id: Idaa6ed3089a5ec38a4d12fe7d821dbff0bf1dc2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300097
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-01 05:04:52 +00:00
skia-autoroll
0fb9b4926f Roll ANGLE from 06462adde69b to 2761f01d68a7 (13 revisions)
06462adde6..2761f01d68

2020-06-30 etienneb@chromium.org Disable the use of chromium worker threads
2020-06-30 lexa.knyazev@gmail.com Fix blendable FP32 texture caps on ES2 contexts
2020-06-30 ianelliott@google.com Vulkan: Fix off-by-1 180/270-rotated CopyTexImage
2020-06-30 timvp@google.com Vulkan: Don't store transformed SPIR-V
2020-06-30 jmadill@chromium.org Tests: Add scripts/common.py to standalone data.
2020-06-30 cclao@google.com Vulkan: Skip repeated VkCmdClear call with the same value
2020-06-30 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from d8b1aa1c3830 to 7c1434b8ea35 (19 revisions)
2020-06-30 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 91c50e3fc993 to fc0dc3a9c734 (1 revision)
2020-06-30 xinghua.cao@intel.com Restrict member types for StructuredBuffer
2020-06-30 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Tools from ff825d988fe8 to abc9dff824c3 (1 revision)
2020-06-30 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from 27e915ed4f20 to dca47063ccd2 (2 revisions)
2020-06-30 timvp@google.com Vulkan: Only transform SPIR-V once
2020-06-30 syoussefi@chromium.org Skip failing test on NVIDIA Shield

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 ethannicholas@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
Bug: chromium:1091259,chromium:1100613
Tbr: ethannicholas@google.com
Test: Test: CQTest: Test: Test: angle_end2end_tests --gtest_filter=*CopyTexImageTestES3.2DArraySubImage*Vulkan*Test: Test: Test: angle_end2end_tests --gtest_filter=*WebGLReadOutsideFramebufferTest.CopyTexSubImage2D*Vulkan*
Change-Id: I64493b431b9ad784e5e8cc1bb9d70e7993b32e6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300100
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-01 04:41:52 +00:00
skia-autoroll
23e55c4b0c Roll SwiftShader from b3240d0c355a to 2d6b37bbda59 (2 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/b3240d0c355a..2d6b37bbda59

2020-07-01 pcc@google.com Start reserving x18 by default on Android targets.
2020-06-30 srisser@google.com Fix debug assert from happening in release build

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 ethannicholas@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: ethannicholas@google.com
Change-Id: I33c48232693576a0b22dabd49a2ff9781fde85d9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300099
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-01 04:41:22 +00:00
Mike Klein
5638f489af add windows skvm bots
These force SkVM blitters on Windows,
which has always been possible but now
tests the SkVM JIT too.

Change-Id: I11e8a8e2953873f2e4fee6644b6016104a0d2b8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299881
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-07-01 03:14:52 +00:00
Mike Klein
400ba22f45 save only xmm6-15 on windows
Just a little follow up, adding a mem->xmm vmovups
instruction to make it possible.  Nothing tricky.

Change-Id: I319e11839e44ccda46e664c82fb858a18499f9be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299883
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-07-01 02:58:22 +00:00
John Stiles
ab9578e9c6 Update ImGui to latest stable version (1.77).
Also added various sk_app headers to BUILD.gn for ease of access.

Change-Id: I99646c8f3906e00ca95f8e583319cb9b873c66ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300037
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-01 02:29:22 +00:00
Mike Klein
77d7d5ea92 with sanitizers, JIT but ignore it
This should let the sanitizers cover our JIT
itself, while still not running the JIT'd code.

Change-Id: I226f1077f99956f530ef85c9626aff15ae37bdea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299880
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-07-01 01:55:12 +00:00
Florin Malita
492558a10d [skottie] Fix wipe effects for images
Two issues:

1) mask shaders are ignored of drawImage; force application via a layer

2) visibility control clashes with layer controller; force a
   transparent shader for now

TBR=
Change-Id: Ic9a86c87db043745fa9f829ef36706525570a3be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299874
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-06-30 23:16:52 +00:00
Elliot Evans
fe7e74b3a7 Add an experimental_simd build target to CanvasKit.
The `experimental_simd` build target builds
CanvasKit using the Emscripten `-msimd128` flag, to build CanvasKit
with SIMD instructions in the compiled WASM. This build of
CanvasKit works in Chrome Canary 86.0.4186.0
with chrome://flags#enable-webassembly-simd enabled.

Also add WebAssembly-specific intrinsics to SkVx.h to enable
support for almost all native SIMD operations in CanvasKit WebAssmebly.

Also add a Skia/modules/canvaskit/wasm_tools/SIMD folder which contains
build_simd_test.sh for testing whether WASM SIMD intrinsics operations
are actually being used by skvx, and for testing correctness of
WASM SIMD operations. Also contains simd_float_test.cpp and
simd_int_test.cpp which serve as documentation for which operations are
correctly turned into WASM SIMD operations by emscripten.

Bug: skia:10453
Change-Id: Icd312b4d189e8d8667d3ffe12a72bfa6febaab2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299705
Reviewed-by: Mike Klein <mtklein@google.com>
2020-06-30 22:52:31 +00:00
Jim Van Verth
1e6460d552 Implement GrFence in D3D.
Use this fence code to track command list completion.

Change-Id: I32e24e217a2bbee6b593d412a209b353ae6e9e5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299776
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-06-30 21:37:32 +00:00
Joe Gregorio
1bb4d35110 The Pixel 4XLs are doing fine on Tests, so stop running the tests
on Pixel 4s.

Change-Id: I89a241d75499aad2832a8570901654a2deb2b8cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299873
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Auto-Submit: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2020-06-30 21:15:11 +00:00
Mike Klein
a68d933aff nullptr -> paint color
This feature was simply missing.

Bug: skia:10461
Change-Id: I45024e067247a8a262872882457439e2bbb957b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299882
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2020-06-30 21:07:11 +00:00
Jim Van Verth
dd3b401e5b Direct3D: Fix commandlist cleanup crash.
When checking for finished command lists and resetting them,
we call the finishedCallbacks. Some of those in turn can do a submit,
which will again call checkForFinishedCommandLists(). This could end up
trying to recycle the same command list twice as it iterates through
the deque. Clearing the entry from the deque and then recycling it
avoids this.

Change-Id: Iee01f1b80f99e1d6c00875b634c39789dc682d8e
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-06-30 20:02:16 +00:00
Robert Phillips
9eb0002b47 Double down on abandoned being publicly accessible on contexts
abandoned() is publicly accessible on GrContext. Since
GrRecordingContext is taking its place in many locations, make its
abandoned() call also publicly accessible.

This CL also removes abandoned() from GrContextPriv since it is
publicly accessible.

Change-Id: I72bdae369d06e34ec3f99a18a0feb72e2ae67666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299876
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-06-30 20:01:51 +00:00
Michael Ludwig
4e3cab7919 Reland "Simplify GrClip API"
This is a reland of 9716414e93

Original change's description:
> Simplify GrClip API
>
> Removes quickContains(SkRect), quickContains(SkRRect), and isRRect().
> Replaces these three functions with preApply() that conservatively
> determines the clip effect up to a single rrect intersection. The major
> motivation for this is the new GrClipStack implementation. preApply()
> and apply() will be able to reuse much more code compared to separating
> the preApply functionality across the older three functions that were
> removed. Additionally, preApply is able to convey more information for
> less work, since it can usually determine being skipped or unclipped while
> determining if the clip is a single rrect.
>
> As part of using this API, the attemptQuadOptimiziation and the equivalent
> rrect optimization are overhauled. Hopefully legibility is improved, and
> the rrect case is now applied outside of the android framework (but with
> tighter AA requirements).
>
> Bug: skia:10205
> Change-Id: I33249dd75a28a611495f87b211cb7ec74ebb7ba4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298506
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

Bug: skia:10205, 10456
Change-Id: I500eeda36ea50e95eb8cb658b36aa2373d5166c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298823
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-30 19:57:11 +00:00
Greg Daniel
ce9f016ed3 Remove unused GrFlushFlags.
This also adds back default flush() calls which simply do a flush
without any submit.

Change-Id: Ia8c92bbdecd515d871abfa6364592f502e98656b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298818
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-06-30 19:39:31 +00:00
Mike Klein
511cf4fca7 start on windows jit support
- Replacement for in-memory JIT mmap,mprotect,munmap.

  - dylib feature disabled (for now, but could be done
    with LoadLibrary/GetProcAddress)

  - Mostly share impl with __x86_64__, but with enter
    and exit updated for the MS ABI.

I "rediscovered" along the way that r12 has the same low three
bits as rsp, and that means the assembler needs to handle it
specially in at least one place it's not today.  No big deal;
we can easily avoid using r12.  GP registers are all statically
allocated.  Left a warning and a TODO.

Still need to investigate 17 GMs that are triggering asserts.

Change-Id: I0f543b0efab968e805e89dcf1f068eac1cafea38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298530
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-06-30 19:07:19 +00:00
Greg Daniel
746460e25a Fix d3d backend texture uploads when used formats need swizzling.
This does a few things. First when we are trying to upload a color via
our updateBackendTexture API we use GrClearImage to fill out a cpu buffer
with that data. But we need to know how to swizzle this cpu data so that
it falls into the correct channels when we copy it to the GPU texture.
This requires adding a couple more color types to handle some of the odd
4444 cases which are swizzled differently and what seems every backend.
We then can get the correct swizzle for the GrClearImage call.

This change also fixes the DXGI_FORMAT_B4G4R4A4_UNORM read and write swizzles.

In follow on change I will update other APIs which use GrClearImage to make
sure they are using the correct GrColorType to represent their internal
formats memory layout.

Change-Id: I92d1d7728dc6e317553e04c1ecfcd872f95a5f99
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299865
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-30 18:56:57 +00:00
John Stiles
09dbeff19a Update SkModeColorFilter to support an input FP.
This change relies on the Xfermode updates in the prior CL
(http://review.skia.org/299703) to render properly, and requires
slightly different blending behavior in the compose FP which
necessitated a new ComposeBehavior enum.

Eventually we would like to settle on a universal ComposeBehavior which
works well for all call sites, but that will be its own fairly
disruptive change. This work will be tracked at skia:10457.

Change-Id: I3cc0ea5e016fbef82bc63d653d60d0505efaa66f
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298821
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-06-30 18:50:02 +00:00
Robert Phillips
44333c58f6 Make asDirectContext return a GrDirectContext
Change-Id: I373658d68582adc9728f3a75d84178a365f5b798
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299877
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-06-30 18:48:17 +00:00
John Stiles
5c57e88d8f Redesign GrXfermodeFragmentProcessor to use one FP instead of two.
Previously, we had separate "ComposeOne" and "ComposeTwo" fragment
processors. These performed extremely similar roles, but varied in
the number of child FPs used, and treatment of the input color's alpha
channel.

This CL combines these two FPs into a single unified "Compose" fragment
processor. To avoid breaking many existing GMs, the semantics of the
prior FPs have been preserved as closely as possible. (Specifically, the
FP treads very carefully to ensure that the alpha channel handling
matches the old code, as dozens of GMs fail otherwise.)

Change-Id: I7ab453f3313e70ae25e5e70f86373a64ff02072f
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299703
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-06-30 18:44:57 +00:00
Brian Salomon
3207fbeae2 Fix release build of viewer with Vulkan
Change-Id: I26c7b6030bb6be7e5005a05c593d1de40dda88db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299859
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-06-30 18:38:07 +00:00
Mike Klein
5e09432f4f careful constants map handling
Setting up the Windows JIT made me notice that we can
modify the constants SkTHashMap while using it, e.g.

   a->vfmaddps132(dst(x), reg(y), any(z))

if any() returns a Label* Operand pointing to a constant, and
reg() needs to load from a constant too, and the second to touch
the constants map causes a hash table resize, the other is left
with a Label* that's pointing into the old table.

The fix is to (mostly) never modify the constants table when
looking up constants, instead using the Op::splat to seed the
table.  A couple miscellaneous constants like 0xffff'ffff as
used by assert_true are not dangerous so I've left them alone.

This is the sort of bug ASAN would catch, except we turn off
the JIT when building for ASAN.  I think I can tighten that up
so that we still JIT under ASAN, but never use the JIT'd code.
That'd let us catch bugs like this in the JIT itself.

Change-Id: I91d8f6fda721a6e3c9e3629d694a73fd1b2bf8f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299879
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-06-30 18:15:07 +00:00
Jorge Betancourt
afaf5d56c5 performance increase by not drawing on do nothing frames
Change-Id: Ibcd4f0ed468563b22e29d23c7d72b474534d21f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299916
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2020-06-30 18:14:27 +00:00
Chris Dalton
2d7cf46c81 Use SkTPin instead of std::clamp
std::clamp is c++17 so using it causes some builds to fail.

Change-Id: I3e90ffc081e1f18ebab1c4f403826e94e58bf07d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299878
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-06-30 17:19:07 +00:00
Chris Dalton
1c62a7b034 Implement stroking with GPU tessellation
Bootstraps tessellated stroking using GrStrokeGeometry mostly as
written. Strokes get decomposed into tessellation patches that
represent either a "cubic" (single stroked bezier curve with butt
caps) or a "join". The patches get drawn directly to the canvas
without any intermediate stencil steps. For the first revision, only
opaque, constant-color strokes are supported.

Bug: skia:10419
Change-Id: I601289189b93ebdf2f1efecd08628a6e0d9acb01
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299142
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-06-30 16:19:36 +00:00
Brian Osman
b6b95739a5 SkSL: Rename isConstant to isCompileTimeConstant
This better reflects what the return value means, and eliminates
confusion with the SkSL concept of "const" variables, which are
not known at compile time.

Change-Id: I14973ceb36ae4ab6bad8a13bb93e1788a1b18bd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299863
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-30 16:14:36 +00:00
Brian Osman
711e73c099 SkSL: Variable references are never "isConstant"
isConstant really means "has a known value at compile time", but for
variables declared with "const", the two meanings had been conflated.
There were several ways for this to produce surprising error messages.
The included unit test crashed before removing the override, and now
passes.

Change-Id: I49b926e51c421db93240cbbf42231de0444358d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299860
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-30 15:59:26 +00:00
Weston Tracey
d681aa258a [infra] Add xcode-11.4.1 asset
Change-Id: I793975f11a5c1f71729d081c1ce59f8d2e2f58de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299857
Commit-Queue: Weston Tracey <westont@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Auto-Submit: Weston Tracey <westont@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2020-06-30 15:36:53 +00:00
Michael Ludwig
fc2fdf025e Support sample coords in .fp main()
This removes the code generation support for @coordTransform and sk_TransformedCoords2D
when processing .fp files. Instead, the main() function can optionally add a float2
parameter. This is marked as the SK_MAIN_COORDS builtin, just like the main function
for a runtime pipeline stage.

Bug: skia:10416
Change-Id: I0c192d890bb798a1167bc445003f6ddffe6118f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299687
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-30 15:18:03 +00:00
Robert Phillips
ad2484520d Make the GrDirectContext a thing and move it to include/private
This is somewhat of a departure from the original context refactoring
plan (i.e., keep GrLegacyDirectContext hidden and switch GrContext over
to be the GrDirectContext at some point). Having a GrDirectContext
earlier will allow us to change some important signatures earlier
(e.g., asDirectContext) and, hopefully, clarify some of the confusion
about the context class hierarchy.

Additionally, this will let us make onGpuSetup take a direct context -
clarifying its purpose vis a vis onDraw (which now takes a recording
context).

Change-Id: I8298a0649bc95843d20bee33ba7fe1d7e73bb839
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299768
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-30 14:57:24 +00:00
Ben Wagner
41abd4f5cc Remove SkWhitelistTypefaces.
This was originally added to reduce the size of the large skp set by
reducing the number of fonts fully serialized. At the time all fonts
were fully serialized into all skps. Oddly enough this was actually a
blacklist of fonts which should never be fully serialized. The list was
easy to get out of date (it needed to be regenerated whenever the
container the Chromium html to skp conversion ran in was updated) and
unclear how to use well (the user would need to replay the skps in said
container to get mostly correct playback).

Since that time, it is now possible for the user to specify how to
serialize typefaces. In addition, further flexibility is now provided
though serialization and deserialization procs provided to the recorder
so that the user can have even greater control over individual
recordings, so if this is needed again there are cleaner ways to write
it without globals. Also, Cluster Telemetry doesn't really capture skps
this way anymore so this code isn't really being used.

In the future should such a mechanism be required, it would probably be
best to first create a base image of fonts to use as system fonts and
then set up the container which captures the skps to use exactly those
system fonts. Then all system fonts can avoid serialization and the font
collection and setup (or possibly just base container) can be shared for
playback.

Change-Id: I27412a8fd35b89af293b4151ea8cecc2b1bc7226
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299838
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-06-30 14:54:53 +00:00
Michael Ludwig
8f3a83671a Write SkSL visitor pattern and consolidate sampling analysis
Besides moving the existing coord-overrides and sample matrix merging
logic on to a shared visitor pattern, this updates the sample coord
reference detection to actually look for references to that built-in.

Previously, we only had this behavior in the CPP code generator. The
.h generator just did a string search for sk_TransformedCoords2D, and
runtime effects just looked at the main signature. Now, the .h generator
is more robust, and runtime effects that declare the main coords parameter
but never use it will not be marked as using the sample coords directly.

Change-Id: I802d610dbda512cf3823c58f349307b3926aa58f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299458
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-30 14:04:23 +00:00
Robert Phillips
95c250c247 Downgrade GpuGMs to only receiving a GrRecordingContext
Most of this CL is just noise (i.e., all the header changes) due to the
signature change. The 'discard' GM has some substantive changes but
that's about it.

Change-Id: I72011a442c149b5db93cf8decade6779be4f63d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296704
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-30 13:02:33 +00:00
skia-autoroll
359d16da11 Roll Chromium from 2076810705d0 to 277fb4f3a407 (412 revisions)
2076810705..277fb4f3a4

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 ethannicholas@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: ethannicholas@google.com
Change-Id: I8f95b871447f845acc9f8b306df8303e4ebe3ec8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299799
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-30 04:47:43 +00:00
skia-autoroll
a2bb8c0957 Roll ANGLE from 69c011ef35f1 to 06462adde69b (13 revisions)
69c011ef35..06462adde6

2020-06-30 syoussefi@chromium.org Add a test for copying from one mip to another
2020-06-30 timvp@google.com Vulkan: Store transformed SPIR-V in ProgramExecutableVk
2020-06-29 jonahr@google.com Fix disable_native_parallel_compile workaround condition.
2020-06-29 nguyenmh@google.com Refactor frame_capture_utils.h to frame_capture_test_utils.h
2020-06-29 m.maiya@samsung.com Vulkan: Set new layout based on VkImageUsageFlags
2020-06-29 courtneygo@google.com Vulkan: Implement invalidate for color buffers
2020-06-29 syoussefi@chromium.org Vulkan: Remove superseded updates when flushing to image
2020-06-29 ianelliott@google.com Vulkan: Skip *functional.attribute_location.bind* tests
2020-06-29 syoussefi@chromium.org Vulkan: Remove suppression of fixed dEQP tests
2020-06-29 etienneb@chromium.org Fix delegate Worker Thread Pool creation
2020-06-29 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from eb0a25a189b7 to b3240d0c355a (2 revisions)
2020-06-29 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from fbb9dc2cf1af to 27e915ed4f20 (2 revisions)
2020-06-29 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from efaae24d0006 to 91c50e3fc993 (2 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 ethannicholas@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
Bug: chromium:1091259,chromium:1094869
Tbr: ethannicholas@google.com
Test: Test: CQ
Change-Id: I4f989c4c029c6e962c345a619d12904a79b2e3be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299801
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-30 04:39:23 +00:00
skia-autoroll
eb1a9106b4 Roll dawn from ff90599cdf60 to b231c7fb717d (5 revisions)
https://dawn.googlesource.com/dawn.git/+log/ff90599cdf60..b231c7fb717d

2020-06-29 cwallez@chromium.org Null: Make Increment/DecrementMemoryUsage use uint64_t.
2020-06-29 yunchao.he@intel.com Fix a bug in PassResourceUsageTracker.cpp
2020-06-29 tommek@google.com Caching empty bind group layouts
2020-06-29 bryan.bernhart@intel.com D3D12: Remove ComPtr from d3d12::Buffer::GetD3D12Resource
2020-06-29 jiawei.shao@intel.com Enable two cases in TextureZeroInitTests with swiftshader

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 cwallez@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: cwallez@google.com
Change-Id: I584bf523a7bee7da0309e6040feec65a57c2cb5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299800
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-30 04:31:53 +00:00
Brian Osman
10b7541a1e Add proj() intrinsic (XY / Z), fix bug with perspective matrix sampling
Previously, we'd declare a new temporary variable using the matrix
expression. For GrSkSLFP in particular, that would happen *before*
any other code had been emitted, so if the expression referred to
local variables, it would produce SkSL that used a not-yet-defined
variable, and not compile.

Change-Id: I1cdd8920b0c659b905809c126d10c01b996e6a55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299778
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-29 23:41:02 +00:00
Heather Miller
3a54b68cb4 release notes for 85 to web page
Bug: skia:
Change-Id: I5bf7b18605a6f487e558688ec90c81f27ad3ed8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299702
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2020-06-29 21:44:05 +00:00
Heather Miller
22c6aa126d Update Skia milestone to 86
Change-Id: Id81c58007f74816a8c2ac0831d61c041c5a7468c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298916
Reviewed-by: Heather Miller <hcm@google.com>
2020-06-29 21:18:16 +00:00
Ben Wagner
8c3daeb5d2 Allow fontmgr factory to depend on fontmgrs.
In 75626e4b1a "Regularize selection of fontmgr." a clever change was
made which allowed the skia_fontmgr_factory to be specified as a source
file to allow the user to specify which factory to use. Unfortunately
this implies that the Skia target which uses this source does not know
which other targets (like fontmgr targets) to depend on. A factory
target must generally depend on the target which provides the widget the
factory makes.

This change puts all the current factories into targets of their own so
that they can depend on whatever they need. The skia_fontmgr_factory is
now the name of a target which is the sole public member of the
:fontmgr_factory target. Users can now specify a particular fontmgr
target to build into Skia as the default instead of simply specifying a
source file.

The fontmgr_fontconfig target now also properly publicly depends on the
fontconfig target since it has a public header which includes
fontconfig.h.

Bug: b/160133836
Change-Id: I212d842b8e07c4e99ab53e32310642d18eeb7cb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299677
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-06-29 21:03:04 +00:00
Brian Osman
49b30f451e SkSL ByteCode: Remove specialized instructions for N up to 4
Nearly all instructions have one form, with a count byte after the
instruction. Simplifes the SkVM conversion logic, reduces code size.

Change-Id: I5ff7bb2991a09198c5c8f5bcaf2c1017c06be5d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299682
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-29 20:45:34 +00:00
Michael Ludwig
e7e25ac904 Remove workarounds to support legacy coord transforms
Bug: skia:10416
Change-Id: I2f1b87521174d18afc59f12832441010cb94ea3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299294
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-06-29 20:23:54 +00:00
John Stiles
9f2a333c01 Update SkColorFilterShader to use an inputFP instead of RunInSeries.
Change-Id: I22a6b110c414fe3d8942b2c890c1339de45c39e6
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298984
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-29 20:09:25 +00:00
Robert Phillips
c7ed7e6fde Revert "Add storage on the surface for its last render task"
This reverts commit ca5b36c474.

Reason for revert: This may be blocking the Chrome roll

Original change's description:
> Add storage on the surface for its last render task
> 
> Let's land this and see if it gets us back to baseline on the
> lastRenderTask regression from the bug. If it doesn't, we'll revert it
> since the extra complexity won't have been worth it.
> 
> Bug: skia:10372
> Change-Id: I9d5ae93435b833d575afdc7f219dc8e7c453c92b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297836
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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

Change-Id: Id418d042d1123d946cd99b7b1ba438211cb628ec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10372
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299763
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-29 20:05:06 +00:00