Commit Graph

49701 Commits

Author SHA1 Message Date
Brian Salomon
69100f05bb Rename GrCaps fields and methods from MipMap to Mipmap
Change-Id: I44d151dc80aca8fc6426735ee17224cb5b8aa576
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304603
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-21 15:56:21 +00:00
Chris Dalton
5bae1b83ff Always return the full remaining buffer capacity from makeSpaceAtLeast
In the case where the blocks were empty we used to return the
fallbackSize as opposed to the actual size of the block.

Bug: skia:10419
Change-Id: Ie36c81f3b98bf8e95a2881356489ac54a842b787
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304437
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-21 15:50:04 +00:00
Greg Daniel
373d7dd0ed Add new GrContext::updateBackendTexture call that takes an SkColorType.
Change-Id: Iba71698f52eba3e7a99e0712a51ce48953b995db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304601
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-21 15:47:27 +00:00
Brian Salomon
40a40623c8 Rename GrBackendTexture::fMipMapped -> fMipmapped
Also mipMapped params to GrBackendTexture functions to mipmapped
GrBackendTexture::hasMipMaps -> GrBackendTexture::hasMipmaps

Misc test vars fMipMapped -> fMipmapped

Change-Id: Ic0651d14fc106c21b0ab45529875b95ed8dc2dfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304598
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-07-21 15:29:06 +00:00
Michael Ludwig
423dd689df Revert "Support moving blocks from one allocator to another"
This reverts commit 0f064041bf.

Reason for revert: unit test failures on some windows bots

Original change's description:
> Support moving blocks from one allocator to another
> 
> Uses this new capability and the previously implemented reserve()
> feature to implement efficient concatenation of GrTAllocators.
> 
> Change-Id: I2aff42eaf75e74e3b595d3069b6a271fa7329465
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303665
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: I931f2462ecf6e04d40a671336d0de7d80efd313d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304604
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-07-21 15:23:02 +00:00
Brian Salomon
a6db510563 Rename GrMipMapsStatus GrMipmapStatus
For consistency with other enums and public APIs.

Change-Id: I026da5529f11051693cae5691c7ad92fad5ed446
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304597
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-07-21 15:12:30 +00:00
Michael Ludwig
0f064041bf Support moving blocks from one allocator to another
Uses this new capability and the previously implemented reserve()
feature to implement efficient concatenation of GrTAllocators.

Change-Id: I2aff42eaf75e74e3b595d3069b6a271fa7329465
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303665
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-21 15:04:05 +00:00
Kevin Lubick
ce4587d430 [canvaskit] Update to 0.17.1
These changes were supposed to land yesterday, but I forgot.

Change-Id: I46aca428482f9812c1b025f9735ebe2c0ac02bf1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304602
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-21 14:48:20 +00:00
Herb Derby
09357ccfa8 split out GrDirectMaskSubRun from GrMaskSubRun
I kept the data structures the same for both DirectMaskSubRun and
MaskSubRun to simplify the CL. Later CLs will specialize the
DirectMaskSubRun. I removed duplication in code where the code will not
be specialized in the future.

Change-Id: I231cf21412b09f1e442afdc515d7cb726d3d25e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304061
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-21 14:24:05 +00:00
Kevin Lubick
12281c56fb [skottiekit] Initial npm files
As per convention, skottiekit/skottiekit is the folder that
will be published to npm. It has a bin directory that has the
full skottiekit build.

Change-Id: I95cbb80158bc8e6dbe3b0d8ae4ffcadd59a7bf9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303925
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-07-21 14:23:07 +00:00
Brian Salomon
7e67dcaea6 Rename GrMipMapped GrMipmapped
Change-Id: Ia2cfbca8982b57399b6681cbb4501c2933ab4df7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304576
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-07-21 14:06:35 +00:00
Florin Malita
a524ea266d [skottie] More masking fixes
Assorted bugfixes for the non-analytical mask code path.

1) SkSG modulatePaint() should only override the blend mode when
   one is specified (!= kSrcOver).

2) Some modes (notably intersect) require touching pixels outside the
   mask draw geometry.  These modes must be applied as a layer.
   Introduce an explicit layer node in SkSG, and inject for masks which
   require it.

Also refactor Subtract to use more natural blend and pathops modes,
instead of always inverting geometry.

TBR=
Change-Id: I412168d1ff61eb8e59907babe8f0e091f6fffacf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303997
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-07-21 13:58:45 +00:00
Florin Malita
a09b05c27a [skottie] Add RenderFlag::kDisableTopLevelClipping
TBR=

Change-Id: If63d27eb13176697665f0d081542eae0f7afea9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304476
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-07-21 13:15:45 +00:00
Mike Reed
c1eb58de32 MallocPixelRef should always allocate as large as computeByteSize() says
Bug: 1103827
Change-Id: I837f92cf10a1a389fe1b0ba55ae1323e7e68f741
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304416
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-21 12:59:25 +00:00
Robert Phillips
effd13f945 Convert more tests to GrRecordingContext/GrDirectContext
Change-Id: I30388793e1b9e14026a587cd248832abc283a301
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304093
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-21 12:28:25 +00:00
Adlai Holler
2940538ecd Reland "Remove more GrContext imports & usage"
This reverts commit 75c5168b41.

Reason for revert: Reverted image-cacherator test, for now

Original change's description:
> Revert "Remove more GrContext imports & usage"
>
> This reverts commit dd1395526d.
>
> Reason for revert: Broke chrome roll
>
> Original change's description:
> > Remove more GrContext imports & usage
> >
> > Sanity is coming soon!
> >
> > Change-Id: I109ebeef9efd7dbf4d76a13e1c05df36d59affbc
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303661
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,adlai@google.com
>
> Change-Id: I20d770058d4b54193b6cd2fdc9ca5a1e09f84309
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304056
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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


Change-Id: I940b9f74f7caaa8b4201c241f2a6242b7a24d2a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304062
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-07-21 11:36:05 +00:00
Ravi Mistry
e875f72dc6 Add documentation link for canary bots
Bug: skia:10477
Change-Id: Ie3a68dc718ef17d7e185638757903ee480910639
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304063
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2020-07-21 11:27:05 +00:00
skia-autoroll
e687db2bbe Roll ANGLE from 08c4d09493bf to 20eb9be55299 (17 revisions)
08c4d09493..20eb9be552

2020-07-21 timvp@google.com Generate Android.bp from multiple gn descriptions
2020-07-21 timvp@google.com Use Subject/Observer pattern for Programs/Executables in PPOs
2020-07-21 syoussefi@chromium.org Vulkan: Make room in RenderPassDesc for resolve attachments
2020-07-21 ianelliott@google.com Vulkan: Make explicitly-[non-]rotated get methods
2020-07-21 cclao@google.com Vulkan: No need to add current buffer into mResourceUseList
2020-07-20 syoussefi@chromium.org Vulkan: Faster FramebufferDesc compare
2020-07-20 cclao@google.com Vulkan: Move mEmptyBuffer from program to ContextVk
2020-07-20 ianelliott@google.com Vulkan: Optimize changing texture max level
2020-07-20 geofflang@chromium.org Support BGRA_1010102 IOSurfaces in CGL and Vulkan.
2020-07-20 cnorthrop@google.com Capture/Replay: Fix vertex array objects for MEC
2020-07-20 jmadill@chromium.org Lift warning from trace tests.
2020-07-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from 412b1b7dd18c to b1346703979e (3 revisions)
2020-07-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Headers from 858b13a1220a to 83825d55c7d5 (1 revision)
2020-07-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 0a8f44c514ce to ea6f21a052c9 (9 revisions)
2020-07-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Tools from d093d9723b7c to 50e737c82347 (1 revision)
2020-07-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 680c77fa6c81 to 717e7877cac1 (6 revisions)
2020-07-20 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from f3cb1896971f to 9eef54b2513c (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 robertphillips@google.com on the revert to ensure that a human
is aware of the problem.

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

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

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: chromium:1100599
Tbr: robertphillips@google.com
Test: Test: CQTest: Test: Manual script execution and building in AOSPTest: Test: NBA 2K20 game playTest: Test: NBA2K20 MEC
Change-Id: Icf80289ca85fdda725ad3aef9a41b432a7a502b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304469
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-21 05:42:05 +00:00
skia-autoroll
6a420088dd Roll dawn from d0dd661f1805 to c4cebc7efae1 (3 revisions)
https://dawn.googlesource.com/dawn.git/+log/d0dd661f1805..c4cebc7efae1

2020-07-20 rharrison@chromium.org Roll 5 dependencies
2020-07-20 cwallez@chromium.org dawn.json: Noop argument rename for mapAsync
2020-07-20 xinghua.cao@intel.com Vulkan: Set apiVersion dawn targets

Also rolling transitive DEPS:
  https://chromium.googlesource.com/external/github.com/KhronosGroup/glslang from b481744aea1e to 9eef54b2513c
  https://chromium.googlesource.com/external/github.com/google/shaderc from 5515d2a0c20c to 6af6e625573f

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: I17d4bae7c210af75c89dd64d4e52f6a2aaa2cb8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304496
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-21 04:57:35 +00:00
skia-autoroll
91ccfe3902 Roll SwiftShader from ea6f21a052c9 to 97f9923235cf (4 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/ea6f21a052c9..97f9923235cf

2020-07-20 mark@chromium.org Fix macOS arm64 GN build by building llvm RWMutex.cpp
2020-07-20 ddorwin@google.com Update tests/presubmit.sh with modern syntax for Fuchsia bugs
2020-07-20 amaiorano@google.com Update to latest PowerVR to keep cmake source clean
2020-07-20 capn@google.com Support _PACK32 storage image formats and fix asserts

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 robertphillips@google.com on the revert to ensure that a human
is aware of the problem.

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

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

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: robertphillips@google.com
Change-Id: Ia3475191e4c067b7e618f623e2aa489991875042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304463
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-07-21 04:54:55 +00:00
Michael Ludwig
68e5f29d84 Keep a scratch block around for reuse in GrBlockAllocator
This can optimize cases in a allocate-release loop that moves back
and forth across the end of one block and the start of another. Before
this would malloc a new block and then delete it.

It also enables reserve() in higher-level data collections w/o blocking
bytes left in the current tail block.

Change-Id: Ide16e9038384fcb188164fc9620a8295f6880b9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303268
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-07-20 21:41:44 +00:00
Jim Van Verth
dc945ea077 Avoid some unnecessary D3D state changes.
* Add check to make sure we're not setting the same constant buffer
* Add check to make sure we're not setting the same pipeline state
* Cache descriptor tables to avoid unnecessary descriptor copies
  and GPU descriptor table heap entries.

Change-Id: Ia68dacb347736287c24862c74fd3e231288f5c94
Bug: skia:10508
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303663
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-07-20 21:35:24 +00:00
Mike Klein
5333784c8c remove stray weakref include
Change-Id: I016de62543b5ba16a7193262cea343a77a71ba3b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304201
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-07-20 21:05:54 +00:00
Brian Osman
182c92ebb3 Catch SkRuntimeEffects w/o "main" earlier
Previously, these would produce a "valid" effect object, but it wouldn't
draw anything.

Bug: oss-fuzz:24070
Change-Id: I17d0ed1710196853da0694cac9f4c260312700a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304064
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-07-20 20:48:04 +00:00
Mike Reed
6d0ab954e9 read/write m44
Inspired by https://skia-review.googlesource.com/c/skia/+/303271

Change-Id: I64816f8db1742d263c8f668a7b44a08f20d82f5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304065
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-20 20:45:04 +00:00
Greg Daniel
0927dd65c4 Make sure we free secondary command buffers we don't cache.
We weren't leaking previously cause when we free the command pool it
frees all the buffers, but this allows us to reclaim the memory earlier.

Bug: skia:10438
Change-Id: I1364f3dc123aa89ebb2280f3b9691cffbd67aa78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304156
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-07-20 20:05:43 +00:00
John Stiles
fe7aed63ea Reduce number of trials needed by ProcessorOptimizationValidationTest.
The current algorithm runs an exponentially-increasing number of trials
based on the number of children supported by the fragment processor and
has become a large drag on test times. This version runs a fixed number
of trials to determine which optimization bits are able to appear, and
then continues running trials until each potential optimization has been
demonstrated successfully five times.

The algorithm doesn't attempt to check interactions between the various
optimization bits (e.g. a hypothetical bug that might only occur when
two optimizations interact with one another) but hopefully the minimum
of 100 successful trials is enough to shake out most issues.

Change-Id: I4eba7ace84739027a5aea8f8f895b44c4532b816
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304059
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-07-20 19:42:53 +00:00
Brian Osman
e64ae86d27 Rearrange logic in SkRuntimeEffect::Make
To extract metadata and validate the shader, we've added several
iterations over all program elements. This CL rearranges things
to iterate once (*). Variable conversion is moved to a separate
loop later, to help with nesting and readability.

Removes hard-to-read asserts. These were validating things enforced
by both the IR generator and unit tests.

*: Technically, there are additional implicit iterations when we call
   SkSL::Analysis functions. Folding all of this into a single pass
   would be even better, but much more complicated.

Change-Id: I4f5aa649e74094e94c365ad20ef2ac96082285cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303924
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-07-20 19:33:33 +00:00
Zepeng Hu
c86c5239ca update markdown files
Change-Id: I26cb33017f4d808c87d2dab09078a5222db826f8
No-Try: true
Docs-Preview: https://skia.org/?cl=303956
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303956
Commit-Queue: Zepeng Hu <zepenghu@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-20 18:52:55 +00:00
Greg Daniel
426274b880 Add support for holding onto refs for input buffers from bindBuffer calls.
Mostly this is a lot of plumbing of sk_sp around instead of const*.

This does allow the d3d and vk backends to hold refs to the GrBuffers that
are bound on a command buffer. This means that our buffer alloc pools will
not try to reuse this buffers until the gpu is done with them. Previously
vk and d3d will sniff out if one of these buffers was being used again
while still active on the gpu and rip out the internal backend buffer and
allocate a new one which is not cheap. We see a lot of perf wins from
not doing this.

Change-Id: I9ffe649151ee43066dce620bd3e2763b029a9811
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303583
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-07-20 18:29:43 +00:00
Robert Phillips
c8ae494401 Clean up more tests wrt GrContext
Change-Id: I70189e316be19f28d70c2fae832a868101fd3329
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303998
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-20 17:52:33 +00:00
Joe Gregorio
daa5859e49 Fix swiftshader Dockerfile.
Change-Id: I2e7ecd5f6a6891c32b9a65931592b80e2d52afea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304004
Auto-Submit: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2020-07-20 17:17:53 +00:00
John Stiles
0dee9b0c41 Use input FPs as the base layer for processor tests.
Previously, this test layered its paints by calling
`addColorFragmentProcessor` multiple times. We intend to remove support
for multiple color FPs on a GrPaint in the near future, so we use input
fragment processors instead to generate the same result.

Change-Id: I33e82ce0067183189e69b2af0fe0c228d1d60f14
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303479
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-20 16:44:08 +00:00
Robert Phillips
e36a466723 Revert "Reland "ICU API: only in SkParagraph, simplified (relanding reverted).""
This reverts commit 16fbc24772.

Reason for revert: Checking to see if this is blocking the G3 roll

Original change's description:
> Reland "ICU API: only in SkParagraph, simplified (relanding reverted)."
> 
> This reverts commit a30095d17c.
> 
> Reason for revert: Fixing the build
> 
> Original change's description:
> > Revert "ICU API: only in SkParagraph, simplified (relanding reverted)."
> >
> > This reverts commit 7479eda3b6.
> >
> > Reason for revert: Breaking build
> >
> > Original change's description:
> > > ICU API: only in SkParagraph, simplified (relanding reverted).
> > >
> > > Reverted commit: https://skia-review.googlesource.com/c/skia/+/296128/
> > >
> > > Change-Id: Iaf793bff94a6060579c7d6176d477e598c047be6
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303261
> > > Reviewed-by: Mike Reed <reed@google.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > TBR=reed@google.com,jlavrova@google.com
> >
> > Change-Id: Idd4c41e22aa59e24bdbd07f2fa5e9258c1bbb7a7
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303358
> > Reviewed-by: Julia Lavrova <jlavrova@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> 
> TBR=reed@google.com,jlavrova@google.com
> 
> Change-Id: Iea5da4535ea2e388e8e632e6c556b66c8781631a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303377
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=bungeman@google.com,reed@google.com,jlavrova@google.com

Change-Id: I1edfecc56add670b251adf44892265088fd32c42
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304058
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-20 16:39:15 +00:00
Jim Van Verth
aace25e473 Create shared method for creating D3D MSAA textures.
Both D3DTextureRenderTarget and D3DRenderTarget can create MSAA
resources, and each had its own method. This consolidates everything
into one.

Also sets the default clear values for D3DTRT to be transparent black,
as often they're used to generate masks.

Change-Id: I3a573776d9445c6c73c0192e1ad56a70bc9c682b
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303270
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-07-20 16:39:03 +00:00
Brian Osman
48a643daac SkRuntimeEffect: Always include GrTypesPriv, clean up variable type code
GrTypesPriv seems safe to include even without the GPU backend, which
lets us remove the condition from the struct layout. Hoisting and
reformatting the type conversion code just to make the core of the
factory easier to read. (More of this is coming).

Change-Id: I6e36b92789debc7b2630117c285c592ca7cbc37b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304001
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-07-20 16:33:03 +00:00
Mike Klein
a17799aa59 don't divide by zero when colorCount=1
This is my super lazy fix for the attached, completely unimportant
false-postive bug.  I haven't even paused to consider whether
colorCount=1 makes sense here.

An alternative is to use sk_ieee_double_divide() here to say "divide by
zero is fine, man".  But I kind of like this: wScale will hoist out of
the loop just fine, and it's nice to have the pos==nullptr checks near
each other.

PS3: yep, we can.

Bug: oss-fuzz:24242
Change-Id: I380ff2610405488cdaf475c34617bc9b4427ade9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304019
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-07-20 16:23:08 +00:00
John Stiles
af1103040e Factor out random fragment-processor generation into a helper class.
The helper class allows us to regenerate a "random" fragment processor
with the same seed as many times as desired. This lets us check the
`compatibleWithCoverageAsAlpha` optimization without needing to clone
the input FP; instead, we can actually generate the FP under test three
times in a row, with the same random seed.

In a followup CL (http://review.skia.org/303479/) we will also leverage
this helper class to regenerate the FP under test with the same random
seed, but with a different input.

Change-Id: I1cd83082a949d555f7898970c8a1cc3002818286
Bug: skia:10384
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303657
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-07-20 16:22:58 +00:00
Adlai Holler
75c5168b41 Revert "Remove more GrContext imports & usage"
This reverts commit dd1395526d.

Reason for revert: Broke chrome roll

Original change's description:
> Remove more GrContext imports & usage
> 
> Sanity is coming soon!
> 
> Change-Id: I109ebeef9efd7dbf4d76a13e1c05df36d59affbc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303661
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I20d770058d4b54193b6cd2fdc9ca5a1e09f84309
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304056
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-07-20 16:18:04 +00:00
Julia Lavrova
16fbc24772 Reland "ICU API: only in SkParagraph, simplified (relanding reverted)."
This reverts commit a30095d17c.

Reason for revert: Fixing the build

Original change's description:
> Revert "ICU API: only in SkParagraph, simplified (relanding reverted)."
>
> This reverts commit 7479eda3b6.
>
> Reason for revert: Breaking build
>
> Original change's description:
> > ICU API: only in SkParagraph, simplified (relanding reverted).
> >
> > Reverted commit: https://skia-review.googlesource.com/c/skia/+/296128/
> >
> > Change-Id: Iaf793bff94a6060579c7d6176d477e598c047be6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303261
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> TBR=reed@google.com,jlavrova@google.com
>
> Change-Id: Idd4c41e22aa59e24bdbd07f2fa5e9258c1bbb7a7
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303358
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=reed@google.com,jlavrova@google.com

Change-Id: Iea5da4535ea2e388e8e632e6c556b66c8781631a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303377
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-07-20 15:26:31 +00:00
Adlai Holler
dd1395526d Remove more GrContext imports & usage
Sanity is coming soon!

Change-Id: I109ebeef9efd7dbf4d76a13e1c05df36d59affbc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303661
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-20 15:17:21 +00:00
Brian Osman
c59916a5cc SkVertices: Fix calculation of size needed for attr marker names
Bug: oss-fuzz:24246
Change-Id: Ib99a359b2f0c6ee55180734d6ae933b90e4f6ca8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303920
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-20 14:51:31 +00:00
Kevin Lubick
a6ab4b4f80 [canvaskit] Make effect deserialization on for everything but npm.
Change-Id: I7a60c55940d6d4704aa6d2161b0b8e93c9799285
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303597
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-07-20 14:35:18 +00:00
Kevin Lubick
d9926908b5 [canvaskit] Enable some options on npm build
This also makes the effects deserialization available via compile flag.

Change-Id: Ib6692499a619205ac480a8823ce7de12c0a5a723
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303596
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-07-20 14:35:18 +00:00
Greg Daniel
b7bcabb373 Fix vulkan unmapping of buffers during release.
When we free a vk buffer cause of memory budget, we need to make sure the
buffer is unmapped before calling free on it. However, the old code was
calling unmap even on cpu backed vk buffers. The cpu data gets uploaded
during the unmap call via a transfer buffer. This puts us in a death spiril
of creating and trying to free resources due to budget issues.

This hopefully fixes the attached chromium bugs. I am not sure why the
allocator was eventually crashing but before the crash we ended up in this
craziness of creating and destroying buffers. Maybe we ended un OOMing and
messing with the allocator? Anyways getting rid of the spiril hopefully
gets rid of the crash.

Bug: chromium:1107173, chromium:1106889
Change-Id: I225738df092b4cf5f8b3c97123e06d82358c9b8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303917
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-07-20 14:32:01 +00:00
Kevin Lubick
151d1aae27 [pathkit] Publish 0.7.0 to npm
Change-Id: I181e38e97888e9b319f62f1bbd6f4e832248d7dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303923
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-20 14:21:53 +00:00
Kevin Lubick
6249da8a83 [canvaskit] Publish 0.17.0 to npm
Change-Id: I764a1720a44440a9fb8de0c78ebec02808473876
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303922
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-20 14:10:45 +00:00
John Stiles
eac4ad754f Move test code out of header into CPP file.
This test code is templated, but not really generic (it's only meant to
work with two specific classes) so it doesn't need to live in a header.

Change-Id: I38d4f2cc9637207eca678fc81ff35ebbd7e69fce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303656
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-07-20 13:44:03 +00:00
Kevin Lubick
4c9046f9a9 Fix more swiftshader links
Follow up to https://skia-review.googlesource.com/c/skia/+/303599

Bug: skia:10510
Change-Id: I302860c137ea6b3b7c513b10145325f2726be10b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303919
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-20 13:37:05 +00:00
Michael Ludwig
ad4760a60e Respect SK_FORCE_8_BYTE_ALIGNMENT in GrBlockAllocator
We have unit tests for over-aligned allocation requests (which I know
caught bad addresses on other platforms, but my guess is that wasm's
malloc just so happened to produce pointers at 16 byte boundaries when
they were run). And in the wild, we only would ever allocate things on 8
bytes anyways, so it'd never trigger then. This is mostly to ensure that
if were ever to request something at 16bytes on wasm, the block
allocator's address padding will kick in and do the right thing.

Change-Id: I4b9e3ae5775e453cbbe05bebe4dbe69742a51354
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303658
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-07-20 13:26:21 +00:00