Commit Graph

48890 Commits

Author SHA1 Message Date
Ethan Nicholas
77968f0d32 Revert "fixed sample(..., matrix) with runtime effects"
This reverts commit fb5ede576d.

Reason for revert: major performance regression due to constant shader recompilation

Original change's description:
> fixed sample(..., matrix) with runtime effects
> 
> Change-Id: Id5b7f1b5e992c587be000e112706bedfe00c90fd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294697
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

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

Change-Id: Ica8322e0eab8f00bfc1d4f6d33778eb6493b278f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295835
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-06-11 22:25:53 +00:00
Mike Reed
9290d01c6f Add filter-quality to imageshader factory
The old factories (makeShader) will behave as before: they will inherit
the filter-quality from the paint.

The new factory takes an explicit filter setting, and will use that
regardless of the paint.

Big follow-ups:
- update callers to not rely on setting in SkPaint
- revise/enhance settings in imageshader
    - settings for scaling up and down
    - control over trilerp, etc.
    - other: 4x4 kernels? trilerp bias?
- move mipmaps to always be explicit requests a SkImage factory time


Bug: skia:10344
Change-Id: If87b06d4fd6eafd8b9cdecda7c00d69897066ef8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295086
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-06-11 22:15:33 +00:00
Chris Dalton
f26e596822 Duplicate ccpr/GrCCStrokeGeometry to tessellate/GrStrokeGeometry
CCPR stroking is not enabled by default and will eventually be
removed. This CL is a step toward migrating it to an MSAA version.

Change-Id: I565bea1c91c51bcd1ea3766aee6e4702adf3b09e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295608
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-06-11 21:59:23 +00:00
Mike Reed
e8685bc957 remove unneeded SK_LEGACY_BLITTER_CHOICE flag
Change-Id: If49be9fb6eac9b2af40898313e000855604be9f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295829
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-06-11 21:55:13 +00:00
Robert Phillips
de2bca28cb Add new GM to exercise Vulkan YCbCr images
This will also expose the Vulkan precompilation path to immutable samplers.

Change-Id: Ida31bd70455299fbcc8f4d728aa15179f7685311
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295799
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-11 20:58:16 +00:00
John Stiles
21bbfc6c2d Revert "Fetch clang-format automatically when compiling .fp files."
This reverts commit a25422faa4.

Reason for revert: breaks Windows build

Original change's description:
> Fetch clang-format automatically when compiling .fp files.
> 
> On a freshly fetched repo, setting `skia_compile_processors = true` will
> fail to compile because clang-format is missing from the bin directory.
> This CL automatically runs fetch-clang-format for you when clang-format
> is absent.
> 
> Change-Id: Ieeb359176072e92ca235316c820310333732f608
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295780
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

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

Change-Id: If6412e74a16aa515c223d5d4f326780c8a69766f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295832
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-11 20:36:05 +00:00
Jim Van Verth
2b98f160a6 Add Direct3D tests to the bots.
Bug: skia:9935
Change-Id: I52c7819e8a2899f6fe3e1a1f6551e84ac8c8d60a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295784
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2020-06-11 20:31:03 +00:00
John Stiles
a2d46a1f7d Optimize GrRRectBlurEffect by computing frag pos branchlessly.
This version computes X and Y in parallel and without branching.

Change-Id: I08dd7339f75c6cdd5b4130bf363cac1f527bf6ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295572
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-06-11 20:13:23 +00:00
Robert Phillips
85aa42820e Move VkYcbcrSamplerHelper's context functionality into VkTestHelper
This should make the YCbCr sampler helper usable in a GM (with a normal Vk context).

Change-Id: I75451f6ca934f7b59c48349c77234856d0946a12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295766
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-11 19:39:21 +00:00
Mike Klein
e5463e62b9 require c++14 public headers
It occurred to me that we try to guarantee this but don't test it.
Luckily this public_headers_warnings_check target is a perfect spot.

Change-Id: Ie06732706ee80da798a9c3bda215d5a65f02b5bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295856
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2020-06-11 19:39:20 +00:00
Ben Wagner
32d5cfa1f3 Publicly depend on fontmgrs.
When a fontmgr is included in the Skia build any headers it provides
(like through public) are also public Skia headers.

Change-Id: Ibf18819a956e626a925f83a4f8ebab90978ff9a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295818
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-06-11 18:59:20 +00:00
Herb Derby
082232b142 simplify option flow
The GrTextContext::options would flow from the GrRecordingContext to
the GrDrawingManager to the GrTextContext, and finally to the
GrRenderTargetContext.

Just find them on the GrRecording context off the GrRenderTargetContext.

Change-Id: I902481d20072c2470905261ab81c2b6456f25343
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295559
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-11 18:05:36 +00:00
John Stiles
88183900a5 Honor return value of registerChildProcessor when creating child FPs.
The current implementation ignores return value from
`registerChildProcessor` and, surprisingly, assumes that a cloned FP
index will match the original FP index. This version honors the return
value.

(In practice, I have not seen any cases where the current implementation
has caused actual breakage.)

Updating common code-gen had large ripple effects in the SkSL unit
tests. While repairing the tests, I also took the opportunity to use
raw-strings to pass the source SkSL text, and annotated the `expectedH`
and `expectedCPP` blocks to make the tests easier to understand at a
glance.

Change-Id: I71be69d9e4620963b3ef49ad8e0dba3b40af7f4f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295452
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-11 17:46:54 +00:00
Greg Daniel
2559778f0f Fix calling finishedProcs that are null in backend surface APIs.
Change-Id: I05ef384bc3dc591e44934cbc0c53786e2c6c18da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295789
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-11 17:46:04 +00:00
Florin Malita
1da2556a09 [skrive] Initial binary reader plumbing
TBR=
Change-Id: Ib94516bfba881fd3fdd7b09631f14366f6ac98da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295573
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-06-11 17:24:25 +00:00
Ethan Nicholas
739e1caf35 Fixed SkSL optimization issue
When collapsing static switches down to a single statement, we detect
break statements and don't copy them. But the logic was broken; we
weren't copying the entire statement in which the break occurred, which
could be a block, causing some of the code to simply be omitted.

Change-Id: Ic5b59c11d12326c93d49080193a0a5297732bfb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295776
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-06-11 17:24:24 +00:00
Ben Wagner
ee2ffc3b43 Delete .a file before writing static library.
The ar utility only adds symbols. As a result removed symbols are
sometimes still present in later builds, leading to great confusion.
Delete the .a file before recreating it with ar.

This is similar to what Chromium currently does in gcc_toolchain.gni.
However, we cannot always just use 'rm' because of the build for Android
on Windows, so this introduces 'rm.py' which is just like 'cp.py' but
without the copy part.

Bug: skia:10363
Change-Id: Icc0c3d18dab1e48ccfec47386662c7b4d2dc8811
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295569
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-06-11 17:19:23 +00:00
John Stiles
a25422faa4 Fetch clang-format automatically when compiling .fp files.
On a freshly fetched repo, setting `skia_compile_processors = true` will
fail to compile because clang-format is missing from the bin directory.
This CL automatically runs fetch-clang-format for you when clang-format
is absent.

Change-Id: Ieeb359176072e92ca235316c820310333732f608
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295780
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-11 17:19:22 +00:00
Michael Ludwig
1c07aa7d8d Implement computeFastBounds in SkLocalMatrixImageFilter
This also adds a GM based on Jim's fiddle: https://fiddle.skia.org/c/781234e35c208ee03f79b90613117b91
I confirmed that it never flickers when animating in viewer.

Patchset 1 shows the GM being blank (with the computeFastBounds fix
disabled). Patchset 3 shows that with the fix enabled, the GM is not
blank.

Bug: skia:9282
Change-Id: I206f7150c395b0a35ecf0455e4905f72ae057e6b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295558
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-11 16:45:33 +00:00
Herb Derby
4598fa1b1a move test op creation to GrTextAtlasOp
Change-Id: If6de2f7812ead2d3722d528805901e0f7e67a6b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295358
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-11 16:26:43 +00:00
Stephen White
36248741c2 Dawn: implement Dawn support for BackendAllocationTest in Gray8 mode.
Bug: skia:10362
Change-Id: I56d1f618dcdf96133f1932b7ac8d4602ddb93a59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295575
Commit-Queue: Stephen White <senorblanco@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-06-11 14:26:44 +00:00
Nathaniel Nifong
d05fd0c7d2 Accept Flat Uint32Array, Float32Array, or 2d Float32Array as the color argument to MakeLinearGradient
TODO:
  1. Accept a Color builder or a TypeArray from CanvasKit.Malloc
  2. Apply the same treatment to all other gradient functions, MakeSkVertices, and drawAtlas
Change-Id: I94fa67a3c00d7b1ecdc004af4ffd3193404c1a30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294707
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-06-11 13:51:53 +00:00
Robert Phillips
0d6ce7cc13 Split VulkanTestHelper out into its own files
The aim here is to unify VkTestHelper with the VkYcbcrSamplerHelper's context creation code. AFAICT they have a ~90% overlap.

Change-Id: Iba8d1482b8c1d7164682f90e19d2183d8cfe45d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295583
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-06-11 13:49:33 +00:00
Nathaniel Nifong
cd0df4f7cd Add a basic readme to help the uninitiated build and run skpbench
Change-Id: Ib276f960f385c88392bca90924a9a42752e585ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295603
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-06-11 13:27:03 +00:00
Ben Wagner
75626e4b1a Regularize selection of fontmgr.
Change-Id: Id7c51504450c1c7c9421eba3838bd6bc3440ca4f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295437
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-06-11 12:28:03 +00:00
Jim Van Verth
de175abede Lots of little D3D fixes.
* Add MSAA textures to the command list
* Implement scissor support for clear
* Fix GrBackendTexture::isSameTexture
* Fix deadlock in GrRingBuffer
* Disable DDL recordProgramInfo for D3D

Change-Id: I63140377a38f5a7b8b7e981d0484afb783533742
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295563
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-06-11 12:16:03 +00:00
skia-autoroll
0ad37b8754 Roll ANGLE from d80d9044857e to db3ef87243d0 (11 revisions)
d80d904485..db3ef87243

2020-06-11 timvp@google.com Move ProgramState::mDefaultUniformRange to ProgramExecutable
2020-06-10 nguyenmh@google.com Temporarily take out commit message format check
2020-06-10 nguyenmh@google.com Add 'Reland ' to whitelist and update error messages for clarity.
2020-06-10 cnorthrop@google.com Infra: Migrate to new Goma RBE service
2020-06-10 cnorthrop@google.com Perf: Add a trace of Angry Birds 2
2020-06-10 cnorthrop@google.com Capture/Replay: Fix default uniform matrix capture
2020-06-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Loader from 006586926ade to a09970273cd1 (1 revision)
2020-06-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from 236f1f090429 to 8b92af3fd83f (6 revisions)
2020-06-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from 08328fea5ab9 to 68b2e15ee016 (1 revision)
2020-06-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 7c213720bb46 to c01f826bc67f (1 revision)
2020-06-10 syoussefi@chromium.org Vulkan: Fix RTs attached to textures with non-0 mip

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 bungeman@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: None
Tbr: bungeman@google.com
Test: Test: Angry Birds 2 MECTest: Test: Build/CQTest: Test: angle_perftests --gtest_filter="*Trace*"
Change-Id: Ide43aa437178b77f72013e4d6813800c3c97a767
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295737
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-11 04:51:31 +00:00
skia-autoroll
24b5ac1b95 Roll dawn from 527080ff03ce to b6eff5acf06f (5 revisions)
https://dawn.googlesource.com/dawn.git/+log/527080ff03ce..b6eff5acf06f

2020-06-11 hao.x.li@intel.com Query API: QuerySet
2020-06-10 jiawei.shao@intel.com Vulkan: Enable nonzero_clear_resources_on_creation_for_testing on buffer
2020-06-10 jiawei.shao@intel.com Enable CopyTests_T2T/CopyWithinSameTexture* tests on D3D12
2020-06-10 bryan.bernhart@intel.com D3D12: Fix pipeline layout overflow when using dynamic offsets.
2020-06-10 natlee@microsoft.com Unify TickImpl called during Device shutdown.

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: Id047b5f322e01e9ffea45d040c9a97b98ffb369f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295717
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-11 04:46:56 +00:00
skia-autoroll
553496b66f Roll Chromium from 82b62a7dc547 to 3f86fb2f52c2 (426 revisions)
82b62a7dc5..3f86fb2f52

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 bungeman@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: bungeman@google.com
Change-Id: I4efdec6d90e0f00d12a34a84c3e4bd40babf687d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295716
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-11 04:41:53 +00:00
skia-autoroll
d482889d21 Roll SwiftShader from e3eb327e8c3c to 45510ad8a778 (7 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/e3eb327e8c3c..45510ad8a778

2020-06-11 capn@google.com Validate the SPIR-V code in debug builds
2020-06-11 capn@google.com Add a triangle rendering benchmark
2020-06-11 capn@google.com Add glslang dependency to VulkanBenchmarks
2020-06-11 capn@google.com Add glslang as a submodule
2020-06-11 capn@google.com Move CMake build targets for PowerVR samples before unit tests
2020-06-11 capn@google.com Add microbenchmarks for vkCmdClear*Image
2020-06-11 capn@google.com Add back vulkan.hpp

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 bungeman@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: bungeman@google.com
Change-Id: Ic40467d85ffa4962a85b18e000e46f4a2920e3cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295736
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-06-11 04:41:52 +00:00
Mike Klein
f69e40841e move dummy onMakeFromFontData() into .cpp
It's borderline illegal to implement it there in the header with a
forward-declared SkFontData.  See also cl/314969840.

Change-Id: I81e981198014cce03fa9604aada5a383a847cfeb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295640
Reviewed-by: 🤓Vy Nguyen <vyng@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-06-11 00:13:15 +00:00
John Stiles
56bf90bf67 Update CircularRRectEffect to use a child FP.
We are updating FPs to receive their input via a child FP where
possible, instead of relying on the input color.

Additionally, fixed up "xyzw" swizzles on rectangle coordinates to
"LTRB" for clarity.

Change-Id: Ifc9107070b8664b7158961748f9727e0a3d58640
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295566
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-10 22:01:53 +00:00
Mike Klein
34f28691f0 add avx-512 swizzler opts
Originally https://skia-review.googlesource.com/c/skia/+/290076,
restructured like https://skia-review.googlesource.com/c/skia/+/295547.

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-Fast,Test-Debian10-Clang-GCE-CPU-AVX512-x86_64-Debug-All
Change-Id: Ibd36c493131bb2987cc386c4b747bab2e6e89375
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295598
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-06-10 21:34:59 +00:00
Stephen White
bd66cf6098 Dawn: fix GrDawnGpu::onUpdateBackendTexture() in Color mode.
Initialize the buffer to the given SkColor value, not to zero.

Bug: skia:10362
Change-Id: I78259ae5ed0a06b9b46e1fd220b13d2c2653fe1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295564
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-06-10 21:30:52 +00:00
Mike Reed
81063116fc move shader-specific checks out of blitter chooser
SkShader was already skipping legacy for perspective, so no need for
the chooser to do that.

There are slight diffs, because we *were* forcing ourselves onto
raster-pipeline whenever we saw kHigh_SkFilterQuality... even for
shaders that don't respect filtering! (like gradients).

I may be able to suppress those diffs, if I add filter-quality checks
in picture and gradient shaders... do we ant to do that?

Guarded with SK_LEGACY_BLITTER_CHOICE.

Change-Id: Ia9d2931651be79b5ee913e97e26f53b777a3a8e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295386
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-06-10 21:15:21 +00:00
Kevin Lubick
51891392d8 [canvaskit] Add benchmarks on SKPs
For each skp in the corpus, we start a fresh instance of
Chromium (via puppeteer), draw the skp and measure that time.
This process is repeated a fixed amount of repetitions
and the median, the average, and the std deviation is reported
to perf (as well as the individual datapoints as an FYI).

Importantly (and something we'll need to change about
SkottieFrames), we measure the average time between frames
after unlocking the framerate. This ensures we account for
the time needed by the GPU to actually draw (flush() returns
after the GPU has all the instructions, but not necessarily
has been able to draw).

This implementation is very similar to the SkottieFrames
code; a notable deviation is the repetitions are handled
outside of the html, i.e. a new chrome window per run.

I explored using content_shell, but noticed that requires
building Chromium, which our infrastructure is not set up
to do well.

Change-Id: I14fdbdc951604d3fdf06e81a4be7e614d0e53c03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295079
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2020-06-10 20:11:00 +00:00
Greg Daniel
e8d3ccadfe Remove GrPrepareForExternalIORequests from flush.
Now that we have the GrContext setBackendTextureState calls we no longer
need these to be on flush.

Bug: skia:10254
Change-Id: I7c44667a327de11dd853e3e71b114959a7bcee86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295447
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-10 20:00:20 +00:00
Brian Salomon
2577623202 Fix two different cases with multiple chained sample matrices
1) If two sample matrices had the same kind and expression (eg, an
identical literal matrix), we'd skip applying the second one because we
didn't examine fOwner in operator==, and decided it was irrelevant.

2) If three constant sample matrices were in a chain, the outer-most
would call trigger a recursive call to setSampleMatrix, which would
update the inner-most fBase pointer a second time, causing us to skip
over the middle transform entirely.

Change-Id: I5671c6f49b627e38571a37db2bf78be9e43d0224
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295579
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-10 18:16:15 +00:00
Leon Scroggins III
11a52d3dfa Remove SK_LEGACY_WEBP_LOOP_COUNT
Bug: b/145995037
Bug: skia:5457

Android is switching to the new behavior with ag/10041691, so the
legacy flag is no longer needed.

TBR=djsollen@google.com

Change-Id: I786807e4cb8b4ed4cd41fd2776ae2915f8bc62cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263176
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-06-10 17:57:45 +00:00
John Stiles
e7b4d73bc8 Update GrRectBlurEffect to use a child FP.
We are updating FPs to receive their input via a child FP where
possible, instead of relying on the input color.

Additionally, rewrote the FP logic slightly to operate on half2s where
possible instead of operating on single half-values at a time.

Change-Id: I87ffa11cf723fab614729789556e76ba82b3c2f4
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295089
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-10 17:25:46 +00:00
Mike Klein
71e8590199 rearrange SkSwizzler_opts.h
We're seeing no benefit to AVX2 for these two functions, so rearrange to
use the SSSE3 implementations instead.  This time, create a new section
that just skips the AVX2 check.  The main structure of the file is now,

    #if NEON
        ... most everything ...
    #elif AVX2
        ... most everything ...
    #elif SSSE3
        ... most everything ...
    #else
        ... most everything ...
    #endif

    #if NEON
        ... these two ...
    #elif SSSE3
        ... these two ...
    #else
        ... these two ...
    #endif

And I'll be following up on this shortly with AVX-512,
with its own set of complications.

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-Fast
Change-Id: I893844e82f457bca6fab7673a41b584d70d2ce63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295547
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-06-10 17:09:16 +00:00
Kevin Lubick
9c401e7e1a [canvaskit] Make docs more clear
Change-Id: Idf32068929ad2f46d05dd556a8fa1a6cb4e48c57
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295317
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-06-10 17:00:39 +00:00
Brian Osman
ff7bee9817 Remove SkReader32, and some API from SkWriter32
After removing all unused API from SkReader32, it only had a handful
of functions, and it was (rightly) only used by SkReadBuffer. Remove
the temptation to use it by just folding it into SkReadBuffer.

SkWriter32 had some unnecessary functions as well (only used in unit
tests), so those are gone. There is still a strange relationship:
SkWriteBuffer is just an interface - SkReadBuffer is actually the
complement of SkBinaryWriteBuffer/SkWriter32. Those two classes produce
data in the exact same format, but with slightly different interfaces.
(The choice about which one is used is mostly about high-level
serialization vs. low-level helpers).

Change-Id: I1e823755febecd2e053ea732b21295d8f4d9d832
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295557
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-10 16:45:56 +00:00
Robert Phillips
ae413d8b81 Move VkYcbcrSamplerHelper to its own files
The intent is to reuse this helper to create a YCbCr GM.

Change-Id: I4d6af42745dbf845e28753bec670ad4a75c393b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295443
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-10 16:39:17 +00:00
Jim Van Verth
c88d9c6ae3 Clean up GrD3DCommandList interface
Change-Id: I6a2c209fde3d5e8130cd23d2db0d68c894d6c9b4
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295556
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-06-10 16:21:45 +00:00
John Stiles
4ca8884a02 Update GrRRectBlurEffect to use a child FP.
We are updating FPs to receive their input via a child FP where
possible, instead of relying on the input color.

Change-Id: I753b90d0564c62f678b03ab9c8e26030f021d615
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295096
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-06-10 15:19:15 +00:00
John Stiles
f6af9749d0 Reland "Update GrCircleBlurFragmentProcessor to use a child FP."
This is a reland of 88c6539a3f

Compared to the first attempt, the FP has been tweaked slightly to
avoid losing precision when casting between float2 and half2.

Original change's description:
> Update GrCircleBlurFragmentProcessor to use a child FP.
>
> We are updating FPs to receive their input via a child FP where
> possible, instead of relying on the input color.
>
> Change-Id: If7c42e556aff3464ec0392f362c97c2e8c6ff91d
> Bug: skia:10217
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294258
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Bug: skia:10217
Change-Id: If75ca3822d5550bd1aeb9f9d8c52c1419b1645d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295467
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-10 15:09:08 +00:00
Brian Osman
9e4e4c7e97 Reland "Switch persistent cache to use SkReadBuffer/SkWriteBuffer"
These are much safer than SkReader32/SkWriter32 (they do validation and
ensure we never read past the end of the buffer).

Where we used to just assert that the contents of the cache were valid,
we now validate everything, and fail gracefully by discarding the cache
contents if it's corrupted or invalid.

Reland includes a new skipByteArray API. The previous technique for
reading into an std::string relied on data(), which doesn't return a
writeable pointer until the C++17 standard library.

Bug: skia:9402
Change-Id: I3b88efbf8ca590c8ad4f8164f7c07eee12696ec6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295441
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-10 14:55:37 +00:00
Julia Lavrova
f7005498d4 Keeping run metrics rather than calculating them every time
Change-Id: Ic0257859317cf46dbb90277573f184d565fdb58d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295322
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-06-10 14:05:26 +00:00
Ethan Nicholas
fb5ede576d fixed sample(..., matrix) with runtime effects
Change-Id: Id5b7f1b5e992c587be000e112706bedfe00c90fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294697
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-06-10 13:59:15 +00:00