Commit Graph

49708 Commits

Author SHA1 Message Date
Herb Derby
52ceaea51d prepare regenerate to move to SubRun
Move the only method into it's call site. The regenerate call will
be moved to SubRun in the next CL. The regenerate call will need
different implementations for the different types of SubRun.

Change-Id: I5396790211ea26cb96b23e823bd2c41c6c5cbaa5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302268
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-13 18:10:58 +00:00
Andy Weiss
25a1d4f2a0 Fix Mac GPU references
https://skia-review.googlesource.com/c/skia/+/301920 broke the macos
build by not including the gpu/gl references back in for macos. This
makes the same changes as that CL for the mac.

Change-Id: Iad75355f505ee2942724aa721d3a7753c10ba06e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302329
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Guruji Panda <guruji@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-07-13 18:04:28 +00:00
Dan Field
439709a97d Expose multi-frame methods for SkCodecImageGenerator
This will allow Flutter to avoid some usages of SkCodec
and have consistent EXIF handling for multi-frame formats
that support EXIF.

Change-Id: I80daee9b00777d88d0a960cc0f0d76da6680e257
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302270
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Dan Field <dnfield@google.com>
2020-07-13 17:54:28 +00:00
Brian Osman
3b5a4fac1e Use stable sort for Viewer's help screen
Fixes flickering help text

Change-Id: I61159e6946125e9e2ce7be3f8f8f6103473855be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302266
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-07-13 17:25:56 +00:00
Herb Derby
a5b9860871 improve the speed of empty GrTextBlobs
Empty text blobs can be the result of a singular matrix, or glyphs that
result in empty rects. If the initial matrix is singular, then we
need to regenerate, otherwise keep the cached empty GrTextBlob to
go fast.

We assume that if the text blob is empty, and the initial matrix is not
maps rect to rects, then the matrix is singular.

Bug: skia:10483

Change-Id: I3bea8abe667d3a2435437ad11198ce7553687133
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302296
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-07-13 17:01:06 +00:00
Herb Derby
c1583cba22 move drawTextPaths from RTC to SubRun
Move drawing text as paths to the SubRun in anticipation of producing
a virtual draw() interface.

Change-Id: Iba9f948a8036a955a0205a098279825a72dc95c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302261
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-13 16:49:50 +00:00
John Stiles
85894305bf Replace ModulateRGBA effect with Xfermode using modulate blend.
This reduces our code size by reusing existing components to perform
the same blend, and generates a shader that should be conceptually
equivalent (although it gives the inliner a bit more work to do).

Change-Id: Ie2203f7613503476fa9d045aba58d9ef39f3ea26
Bug: skia:10457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302264
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-13 16:16:50 +00:00
John Stiles
7bf2600475 Replace ModulateAlpha effect with Xfermode using src-in blend.
This reduces our code size by reusing existing components to perform
the same blend, and generates a shader that should be conceptually
equivalent (although it gives the inliner a bit more work to do).

Change-Id: Ie81e8b82d9b9c441533760d4e9f7e149bc0d969d
Bug: skia:10457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302262
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-07-13 16:12:50 +00:00
Brian Osman
06b78cf02b SkRuntimeEffect: Guard against programs with no "main"
Bug: oss-fuzz:24070
Change-Id: I310e3793e6099f23f93c5feed8dfcd596cecbda7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302257
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-13 15:37:50 +00:00
Adlai Holler
74470aec51 Make GrAsDirectContext public
As soon as I started migrating Chrome, this function showed its
public usefulness. It'll keep coming up over and over again.

Change-Id: Ic6fd08af9b64a4c3287e7fedc9cd0e29bbaf837d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302259
Commit-Queue: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-13 15:30:00 +00:00
John Stiles
7c1967700b Split GrConstColorProcessor into three separate .fp effects.
ConstColorProcessor contained three separate InputModes with their own
unique behaviors, but every (non-test) call site simply hardcoded one of
the InputModes.

This change also allows the actual const-color processor to remove the
inputFP entirely; it is never sampled.

The GM slide has been split into three separate slides as well.

Change-Id: I2b77f4eab4d655f06e3704fb6fde8d4f8c70a075
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301987
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-13 15:07:12 +00:00
John Stiles
d9800f8fda Redesign const-color unit test to leverage sk_gpu_test::test_ops.
The previous implementation invoked SkPaintToGrPaint to create a
base-layer GrFragmentProcessor, and then manually poked an extra
GrFragmentProcessor onto the GrPaint's color processor stack. This
approach is not compatible with a world where a GrPaint is only allowed
a single GrFragmentProcessor.

Redesigned the test to use a different approach. We now manually create
the base-layer processor, and then create a second ConstColorProcessor
which uses the base layer as an input processor. This composite FP is
then drawn using `sk_gpu_test::test_ops`.

Change-Id: I8a2781549ba3d5aee85a520b9b34a70c0e66093a
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301986
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-07-13 15:04:37 +00:00
Mike Klein
5cb47d6a88 refactor skvx::if_then_else()
First move if_then_else() specializations inline using a
quasi-constexpr-if approach, letting them operate on any types of the
right vector and lane size.  We can't use constexpr-if per se because
this header is sometimes used in C++14 contexts.

Then, add AVX specialization for 8x32-bit types.

SkVM's interpreter uses if_then_else() on three i32x16, and these
changes allow that to vectorize ideally, as two vblendvps instructions.

Change-Id: I8355c47975c736c1fbc32b1f8ceddb772978d271
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302080
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-07-13 15:02:07 +00:00
Adlai Holler
872a32c58d Add an arg to SkImage::makeSubset to take a direct context
This is part of a larger effort to force users to provide a context
when manipulating GPU images which may be shared, instead of having
images themselves retain powerful context pointers.

Chrome flag landed in Chrome CL 2292800

Bug: skia:10466
Change-Id: Ic530a2c5eb1f4399db899d243ea944760fdf2055
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300707
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-13 14:55:47 +00:00
Herb Derby
31bc350754 remove unused decl from SubRun
This is left over from the GrTextTarget removal.

Change-Id: I371031af5f51187f98aedc4de7dbe6a967d97798
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302256
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-13 14:38:07 +00:00
Robert Phillips
b27b38b089 Miscellaneous removal of GrContext usages
Change-Id: I558471002db93a09b8fd5dfa2f0929a0139295bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301976
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-13 14:10:54 +00:00
Robert Phillips
d1ce4cb2be Update some of the dox code to GrDirectContext
If we're to remove GrContext all uses must go!

Change-Id: I487a973004c4f080fc5802128770b417d54628e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301981
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-13 13:57:12 +00:00
Brian Osman
31890e2c37 Viewer: Don't steal focus when the shader error window appears
Makes editing shaders (in the SkSL or Particles slides) tolerable.
Previously, every intermediate state (that didn't compile) would force
you to stop and click back in the code window.

Change-Id: Ibc12b8d697a6b5073e24020daa143a4047a5da31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301984
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
2020-07-13 13:56:52 +00:00
skia-autoroll
041796e603 Roll Chromium from 79b4d6eb39c8 to b39fabb9a3ae (542 revisions)
79b4d6eb39..b39fabb9a3

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 nifong@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: nifong@google.com
Change-Id: Ie60516fd0601361bc075768457f8e3fbe018c3ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302173
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-13 04:55:51 +00:00
skia-autoroll
0a4f8de800 Roll dawn from 479689912ee2 to b9285f69ba2c (11 revisions)
https://dawn.googlesource.com/dawn.git/+log/479689912ee2..b9285f69ba2c

2020-07-12 enrico.galli@intel.com Rename Buffer::IsMapWritable to Buffer::IsMappableAtCreation
2020-07-12 kainino@chromium.org Fix platform.system check in clang-format presubmit
2020-07-12 kainino@chromium.org InsertDebugMarker: fix groupLabel -> markerLabel
2020-07-11 kainino@chromium.org Add occlusionQuerySet for compatibility with upstream webgpu.h
2020-07-10 yunchao.he@intel.com Remove a unnecessary validation test in bind group
2020-07-10 brandon1.jones@intel.com Implement Validation For DepthStencilAttachment ReadOnly
2020-07-10 bryan.bernhart@intel.com Add GPU detection for WARP
2020-07-10 kainino@chromium.org Autoformat all tests and examples
2020-07-10 kainino@chromium.org lint_clang_format.sh: Un-skip tests and examples
2020-07-10 kainino@chromium.org Autoformat everything except tests/examples
2020-07-10 kainino@chromium.org Use buildtools clang-format

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: I1bb4b3ab434eca12c7a5fe1d854149b3184e76eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302175
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-13 04:51:31 +00:00
skia-autoroll
6349c0ba16 Roll SwiftShader from 6cd27bab06f4 to ad65826a2ab1 (7 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/6cd27bab06f4..ad65826a2ab1

2020-07-11 capn@google.com Fix copying of multiple image layers
2020-07-11 capn@google.com Fix copying of multisample images
2020-07-11 capn@google.com Fix image slice / plane name usage
2020-07-10 amaiorano@google.com Android: add llvm-10 build file and fix build
2020-07-10 amaiorano@google.com Add llvm-10 configs for Android
2020-07-10 amaiorano@google.com Add arm64 support for Darwin to llvm-10 configs
2020-07-10 amaiorano@google.com Add validation and platform restrictions to LLVM-10 update script

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 nifong@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: nifong@google.com
Change-Id: I417c09527670b4c0c53f3ee8ab43ba91ddb44bf8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302196
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-13 04:45:31 +00:00
skia-autoroll
f64be13cbf Roll ANGLE from fe36a64765c5 to 7d82d29398cc (8 revisions)
fe36a64765..7d82d29398

2020-07-13 jiajia.qin@intel.com Refactor DisplayGbm::generateConfigs
2020-07-11 syoussefi@chromium.org Vulkan: Set the wideLines features when available
2020-07-10 ianelliott@google.com Vulkan: Fully enable pre-rotation for Android
2020-07-10 m.maiya@samsung.com Vulkan: Force flush staged updates for external textures
2020-07-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from 3bae90706d26 to 94f1ce331e85 (10 revisions)
2020-07-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from 29c9135d06f1 to 5aaa0c2bc821 (1 revision)
2020-07-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 7afbc0c8be3f to 94667fbf66ee (6 revisions)
2020-07-10 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 28159ee9c8e3 to 6cd27bab06f4 (7 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 nifong@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: nifong@google.com
Change-Id: Ib23916b183c9b84cc07db8cfad37d991a776f2ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302174
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-13 04:42:21 +00:00
Mike Reed
609ea210e2 more cleanup after removing volatile from bitmap
Change-Id: I3d7b2f59a5657640c3d60f5a2f6e1277d7593096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302038
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-12 19:37:29 +00:00
Mike Reed
1434ce1aa9 Can we remove volatile from skbitmap?
Change-Id: I0faa324b91f2c291be56f5126361ffe7fd54eb65
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302037
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-12 17:48:59 +00:00
Yuqian Li
ed15b1c39b Add Flutter as a Skia customer
Change-Id: Ida222fcd4fafc7fc6259f5f5943eff8d0475236f
No-Try: true
Docs-Preview: https://skia.org/?cl=302081
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302081
Auto-Submit: Yuqian Li <liyuqian@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
2020-07-12 15:05:43 +00:00
skia-recreate-skps
e4f36d7ac8 Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=rmistry@google.com
NO_MERGE_BUILDS

Change-Id: If732dd6bdad4cc5b9fc9053980b58f8fd5a0dc95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302160
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-07-12 08:51:29 +00:00
Herb Derby
4a1f5fc942 move makeAtlasTextOp to SubRun
When SubRun is sub classable, makeAtlasTextOp will be part of
the virtual API.

Change-Id: Ib316bca200de38c5aba64e0bef5fa43966e6f13a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301983
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-07-10 21:17:33 +00:00
Mike Klein
4284f75ed7 remove intermediate lambdas in skvm interpreter
I was poking through the skvm interpreter and happened to be in Debug
-O1 mode, and noticed that the assembly was filled with the asserts that
these lambdas exist to introduce.

First, I noticed they could be cut down to one condition to check,

    SkASSERT((unsigned)thing < (unsigned)limit);

but then I realized, hey, this is what ASAN is for... just drop them!

This cleans up the assembly and emphasizes the more important asserts.

Change-Id: I1e0e69035775887bbf6fb62ca78b4a5721c24504
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302032
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-07-10 20:57:33 +00:00
John Stiles
8c7c709aaa Convert GLHighContrastFilterEffect to an .fp file.
The fuzzer detected a bug in our handling of null child processors.
Rather than attempt to further tweak a hand-rolled effect, it seemed
more productive to convert it into a full-fledged .fp file. This
provides a very high degree of confidence that the basics are done
properly, for a relatively low amount of effort.

Contrast calculation has also been optimized slightly. The original
shader calculated (1+c/1-c) separately for every pixel. This is now done
once, in Make(). Also, if contrast adjustment is set to zero, the
contrast block is fully omitted.

Change-Id: I2af4708536b249e03c3ebede9b10fc1125eadb7b
Bug: oss-fuzz:24039
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301942
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-07-10 20:54:33 +00:00
Herb Derby
411e7aa8b1 move GrAtlasTextOp creation to GrRenderTargetContext
The op creation is no self contained, which means that it handles
taking the clip. For random op testing, this means that some times
no op is created for blobs that are entirely off screen. This
results in a nullptr op. The random op test has been adjust accordingly.

Change-Id: I619ffb315b7ad7c834b3e85d7120fe2cdb90c56a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301583
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-10 20:01:29 +00:00
Brian Osman
54867de4bf Make GrFP::registerChild just return -1 for null children
Null children are becoming more common, so this centralizes the logic
that's currently handled via code-gen and manual checks.

Change-Id: Id8f4f4219b02690c2071ac29b36926dd50da23e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301979
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-10 19:54:49 +00:00
Mike Klein
2b54e8352a add vtune support back
I spent a little time working on adding the --dylib JIT
mode to Windows where we'd shell out to Clang to make a .dll,
but then I remembered this VTune JIT API.

That dylib approach is nice for working with a wide range
of tools (perf, Instruments, gdb, etc.), but when your only
need is Vtune, this API is actually the best option.  You
get your profiler aware of your JIT'd code with way less
overhead than the shell-then-dlopen approach.

If we need to expand to more tools I'll go make the dylib
mode work, but I think this is good enough to make me happy
on Windows for now.

This should look really similar to
https://skia-review.googlesource.com/c/skia/+/255124.

Change-Id: I9e283cdf9bdfeb11c647a2315a7916dc68ef73c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301935
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-07-10 19:14:49 +00:00
Jim Van Verth
41ef2aedef Simplify some Vulkan compressed texture setup.
onWrapCompressedBackendTexture and onCreateCompressedBackendTexture can
use their non-compressed equivalents, with the addition of a read-only
parameter.

Change-Id: Ia9955fb378597e9460b0a439036154f3952e2057
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301977
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-07-10 19:14:09 +00:00
Mike Klein
67db194bdc Revert "Enable effects deserialization except for npm build"
This reverts commit 73923522fd.

Reason for revert: breaks Perf-Debian10-EMCC-GCE-CPU-AVX2-wasm-Release-All-Puppeteer_RenderSKP perhaps?

Original change's description:
> Enable effects deserialization except for npm build
> 
> Enable skia picture effect deserialization in all flavours of build
> except for "npm" variant. If you don't have effect deserialzation enabled
> then when you try to deserialize a skp into SkPicture using canavskit
> it will simply ignore all the shaders/ effects.
> 
> On npm build effects are still being dropped if you use skia picture
> this is being done intentially to not increase the size of canvaskit wasm and
> js files.
> 
> https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!searchin/skia-discuss/gradient$20canvaskit%7Csort:date/skia-discuss/hiCxK-VkK4o/i9zO-tm7AQAJ
> 
> Change-Id: Iff27f829cd72d23cafaddeade5c37de412f9ce19
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301676
> Reviewed-by: Kevin Lubick <kjlubick@google.com>

TBR=kjlubick@google.com,sunilmur@amazon.com

Change-Id: Ic14bcdbe16761971d685fc088666d02af99b31fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302021
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-10 19:03:14 +00:00
John Stiles
a9c9b53007 Convert the arithmetic runtime effect to a regular .fp effect.
The .fp effect has support for passing values to a child processor.
Runtime effects do not support passing a color to a processor, which is
needed to properly implement `ArithmeticImageFilterImpl` without relying
on multiple `addColorFragmentProcesor` calls and/or `RunInSeries`.

Change-Id: I47446897f857ce849a8e734ab81ee7aec80734e7
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301657
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-07-10 18:42:39 +00:00
Herb Derby
35c42b97f5 pullout text path drawing from drawGlyphRunList
Change-Id: Icca951e2ce727a79b7973ab37ffc93b5e8cddf43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301859
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-07-10 18:39:09 +00:00
Robert Phillips
ed65339084 Update the sk_app WindowContext to hold a GrDirectContext
This CL is working towards replacing GrContext with the GrDirectContext/
GrRecordingContext pair.

Change-Id: Id4488e1280d76a16c37d58bd8d29fb7f8dde6b1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301940
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-10 18:27:03 +00:00
Florin Malita
71dc916852 [skottie] Pucker & Bloat shape layer vector effect
Observed semantics:

  -- operates on cubic Bezier path representation
  -- moves vertices towards the shape center, and control points in the
     opposite direction, based on the specified amount
  -- the center is determined as the vertex average
  -- the amount is specified as a fraction of the transition to center
     (0 -> noop, 1 -> fully collapesed to center)
  -- negative and extranormal amount values are allowed
     (invert direction/extrapolate)

TBR=
Change-Id: I7da81a5fe5cffd0e50bd94e6b448565b0b04ed86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301582
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-07-10 18:09:53 +00:00
Robert Phillips
4a3ebc2d22 Switch SkImage's & SkImageGenerator's isValid call over to GrRecordingContext
This is another step towards replacing GrContext with the
GrDirectContext/GrRecordingContext pair.

Change-Id: I9336799a299e181fd56759f37dfed3da5da5d022
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301856
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-10 18:08:13 +00:00
Guruji Panda
9ae4020433 Exclude gl files for Fuchsia platform.
Fuchsia platform supports only vulkan. So exclude all gl files and
add vulkan files for building Skia on Fuchsia.

(relanding with build fix)

Change-Id: Id2ba6cb2d25f6a8c52515ef11b88d830a610903d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301920
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-07-10 17:25:03 +00:00
Sunil Murthy
73923522fd Enable effects deserialization except for npm build
Enable skia picture effect deserialization in all flavours of build
except for "npm" variant. If you don't have effect deserialzation enabled
then when you try to deserialize a skp into SkPicture using canavskit
it will simply ignore all the shaders/ effects.

On npm build effects are still being dropped if you use skia picture
this is being done intentially to not increase the size of canvaskit wasm and
js files.

https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!searchin/skia-discuss/gradient$20canvaskit%7Csort:date/skia-discuss/hiCxK-VkK4o/i9zO-tm7AQAJ

Change-Id: Iff27f829cd72d23cafaddeade5c37de412f9ce19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301676
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-10 17:14:20 +00:00
Mike Klein
77482cb335 add Sk- prefix to SkOSLibrary functions
Just refactored names.  Looking at adding SkCloseDynamicLibrary too.

Change-Id: Ibc3ad556386dad3e80bf91bd9ee46e9b9fe68c4a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301900
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-10 16:55:03 +00:00
Jim Van Verth
f79a7a54bc Remove invalid assert when setting D3D buffers.
It's valid to have both the current vertex and instance buffer be null.

Change-Id: I95266bf38c00403da9193fbb9c8b4ead30ab19e0
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301658
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-07-10 16:48:53 +00:00
Chris Dalton
b490eb2c51 Add ANGLE's glMultiDraw*BaseInstance functions to the GL interface
This is how we will implement indirect draws in ANGLE and WebGL.
Emscripten will expose WEBGL_multi_draw through this extension.

Bug: skia:10419
Change-Id: I3fc56b130b06cdcc05a25be69878b398b8820f50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301736
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-07-10 16:39:53 +00:00
Robert Phillips
d436b78ad4 Switch a few GMs over to GrDirectContext
Change-Id: I96684e0c3a36e194c0ce68b32f09aab2b6e5b625
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301860
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-10 16:23:03 +00:00
Nigel Tao
c91db040ad Use Wuffs v0.3 by default, not v0.2
This is roll-forward of
https://skia-review.googlesource.com/c/skia/+/298616/

Change-Id: I44d65dcb67555fd76075e2d415d96db82c376cae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301756
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-07-10 16:10:43 +00:00
Zepeng Hu
a5783f3858 Add SkRuntimeEffect Fuzzer
The major improvement is that now the fuzzer is able to execute
the sksl code (before it just compiled it). The fuzzer will
reserve 256 bytes for providing uniforms to the shader;
meanwhile, the fuzzer will read the remaining bytes as sksl code
to create SkRuntimeEffect. It then creates a shader and executes
it by painting the shader on a canvas.

The code was tested locally with afl-fuzz, and the execution 
speed was around 700/sec.

An alternative implementation would have been using Fuzz.h to
read bytes; I decided to go with sk_sp<SkData> since it has a
comparable format to other binary fuzzer and meets all the
functionality in this fuzzer.

For future changes, there are 2 important improvements to the
implementation:

1) Current shader does not have children shaders; thus,
makeShader() will fail if the SkSL ever tries to use an 'in shader'.

As pointed out in patchset 11, after creating the runtime effect,
effect->children().count() will tell you how many children it's
expecting (how many 'in shader' variables were declared). When you
call makeShader(), the second and third arguments are a
(C-style) array of shader pointers, and
a count (which must match children().count()).

Some helpful examples can be SkRTShader::CreateProc in
SkRuntimeEffect.cpp, make_fuzz_shader in FuzzCanvas.cpp.

2)

In this fuzzer, after creating the paint from a shader, the paint
can be drawn on either GPU canvas or CPU, so a possible way is to
use SkSurface::MakeRenderTarget to create GPU canvas and use a byte
to determine which canvas it will be drawn on.

Change-Id: Ib0385edd0f5ec2f23744aa517135a6955c53ba38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300618
Commit-Queue: Zepeng Hu <zepenghu@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-10 15:54:23 +00:00
Mike Klein
5160e8caa2 Revert "Exclude gl files for Fuchsia platform."
This reverts commit c1f3f8cda4.

Reason for revert:  duplicate symbols on other platforms

ld.lld: error: duplicate symbol: GrGLCreateNativeInterface()
>>> defined at GrGLMakeNativeInterface_none.cpp:12 (third_party/skia/HEAD/src/gpu/gl/GrGLMakeNativeInterface_none.cpp:12)
>>>            blaze-out/arm64-v8a-fastbuild/bin/third_party/skia/HEAD/_objs/skia/GrGLMakeNativeInterface_none.pic.o:(GrGLCreateNativeInterface())
>>> defined at GrGLMakeNativeInterface_egl.cpp:137 (third_party/skia/HEAD/src/gpu/gl/android/../egl/GrGLMakeNativeInterface_egl.cpp:137)
>>>            blaze-out/arm64-v8a-fastbuild/bin/third_party/skia/HEAD/_objs/skia/GrGLMakeNativeInterface_android.pic.o:(.text._Z25GrGLCreateNativeInterfacev+0x0)

I even ran the G3 trybot and forgot to see if it was green...

Original change's description:
> Exclude gl files for Fuchsia platform.
> 
> Fuchsia platform supports only vulkan. So exclude all gl files and
> add vulkan files for building Skia on Fuchsia.
> 
> Change-Id: I2593a14926747b1154a1134bfdd43772627110a4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301739
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,bsalomon@google.com,guruji@google.com

Change-Id: If2623c600c5b3fc43bf896b4da02dc7cf61d8a27
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301896
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-07-10 15:07:35 +00:00
Florin Malita
082323b57d [skottie] Fill-over-stroke support for text
AE allows selecting the paint order when both fill & stroke are present.

The CL also fixes some text stroke issues: stroke width not parsed
correctly and not actually used on the paint.

Change-Id: Iec27bb65d09f689365e43b801d3844106780572b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301857
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-07-10 14:44:23 +00:00
Guruji Panda
c1f3f8cda4 Exclude gl files for Fuchsia platform.
Fuchsia platform supports only vulkan. So exclude all gl files and
add vulkan files for building Skia on Fuchsia.

Change-Id: I2593a14926747b1154a1134bfdd43772627110a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301739
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-07-10 14:09:58 +00:00