Commit Graph

52177 Commits

Author SHA1 Message Date
Brian Salomon
14f99fc2f3 Make GrSurfaceContext take GrColorInfo rather than its components.
Bug: skia:11019
Change-Id: I0446e3565c892cddaaeb13d9a8379e144c0ea8ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341419
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-12-08 14:56:22 +00:00
Eric Boren
4159ecbca9 Revert "[infra] Switch from isolate to RBE-CAS"
This reverts commit 03d69876ff.

Reason for revert: failing

Original change's description:
> [infra] Switch from isolate to RBE-CAS
>
> Bug: skia:10883
> Change-Id: I4bab202c89253248b7c93d23540038f83af97d33
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340100
> Commit-Queue: Eric Boren <borenet@google.com>
> Reviewed-by: Weston Tracey <westont@google.com>

TBR=borenet@google.com,westont@google.com

Change-Id: Idf99f74579e44bb6b88dcb2c727d8215a3c70c71
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10883
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341678
Reviewed-by: Eric Boren <borenet@google.com>
2020-12-08 14:29:10 +00:00
Eric Boren
03d69876ff [infra] Switch from isolate to RBE-CAS
Bug: skia:10883
Change-Id: I4bab202c89253248b7c93d23540038f83af97d33
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340100
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Weston Tracey <westont@google.com>
2020-12-08 14:04:24 +00:00
skia-autoroll
554e7574e9 Roll SwiftShader from 7c84426d2abe to 84b9bb6621c7 (2 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/7c84426d2abe..84b9bb6621c7

2020-12-07 ynovikov@chromium.org Add status host to CQ config
2020-12-07 sugoi@google.com Fix some minor tracing mistakes

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 jmbetancourt@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: jmbetancourt@google.com
Change-Id: I8b6882c16854ffb35e2afbeca49230c933ab29cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341603
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-08 04:53:57 +00:00
Michael Ludwig
f639a24c50 Consolidate quick reject / paint bounds logic into helper function
Bug: skia:10987
Change-Id: I149bbe33b79848e010c35c94482131fd301f7837
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339992
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-12-08 01:41:50 +00:00
Michael Ludwig
529b25929c Use SkTCopyOnWrite more in SkCanvas
This updates the image_filter->color_filter helper function to modify
the copy-on-write paint directly, which lets us apply that optimization
more clearly in drawImageAsSprite and internalDrawDevice, so that those
variations of DRAW_BEGIN magic macros can go away.

It also updates the draw image family of functions to use a
copy-on-write paint to avoid a copy when the paint is non-null and valid
for an image draw.

Bug: skia:10987
Change-Id: I0a75c06add19352c64f7b463bfa3e80bab769624
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341056
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-12-07 22:24:50 +00:00
Nathaniel Nifong
1184ae0f15 update buildbot repo to deploy debugger changes from https://skia-review.googlesource.com/c/buildbot/+/341046
Change-Id: I304776be90cf8a0f19b3ca7262f453c37407c6e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341464
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-12-07 22:14:50 +00:00
John Stiles
bf282c05e5 Replace array indexing on vector types with swizzles.
Our optimizer ignores index expressions, but has a few simplifications
that it can perform on swizzles. (Added extra code to SwizzleByIndex
which demonstrates this.)

Change-Id: If3c85a0456d98749008d796e422944b602ee6933
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341460
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-07 21:16:40 +00:00
Nathaniel Nifong
e38a9e7f18 handle different bounds for every frame
b:skia:11045

Change-Id: I0547b329fde8edcbc275992c7c5168e788294ba8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341045
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-12-07 20:52:10 +00:00
Brian Salomon
b5f880a3f6 Take origin when creating/updating backend texture using pixmaps.
Bug: skia:11042

Change-Id: I511c7556f97f19d7f162031c245019d2da33c129
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341005
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-12-07 20:31:10 +00:00
Chris Dalton
011a77357e Use infinity to signal conics instead of NaN
From reading the GLSL ES spec, behavior around NaN handling is not
well defined. Infinity and isinf(), on the other hand, seems to be
well defined.

Bug: skia:10419
Change-Id: Id465a89a0d921707021974b5a64ec88bbcce0c33
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341076
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-12-07 20:05:10 +00:00
Mike Reed
198e6ea3f9 add new entry-points for drawImage[rect] with samplingoptions
Change-Id: Icc2c2e4affbf4c4dba1983b069351f33487af81b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339116
Reviewed-by: Florin Malita <fmalita@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-07 19:39:30 +00:00
John Stiles
10160e4656 Avoid unnecessary coercions in index expressions.
Short/ushort types are valid as-is and don't need to be coerced to int.

Change-Id: I41d6a537094e0c3f968e47926f541e0f6a3f92b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341459
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-12-07 19:14:50 +00:00
Ethan Nicholas
3c7298922f remove incorrect line number from SkSL errors with no source information
Change-Id: Ib9117dbd1bcd2c3581fba02416d9eabda1dfc6dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341458
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-12-07 18:29:50 +00:00
John Stiles
4453237e52 Use a scoped helper class to push and pop CodeGenerator::fOut changes.
This mirrors other "AutoXxxxxxx" classes used in SkSL to push and pop
temporary changes into member variables, such as AutoSymbolTable or
AutoLoopLevel.

Metal and Pipeline code generators were updated to use this class.
SkSL was left as-is for now; it modifies fOut more extensively than the
others and will need special care.

Change-Id: Icf505b9b55e3458de349e35e3b812dd005f9afed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341457
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-12-07 18:21:55 +00:00
John Stiles
1b27c3d7a3 Check array bounds when a constant array index is used.
This sort of error would be detected by most backend compilers. This
case was also detected by the bytecode generator. It's easy for us to do
a similar check during SkSL IR generation and report the error sooner.

Also, `convertIndex` had migrated a few hundred lines away from
`convertIndexExpression`, so I moved it back to live next to its parent.

Change-Id: I715d3abf42581782b55ba60df30d0296355667d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341377
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-07 18:17:30 +00:00
Mike Reed
bccdd90a91 Handling mipmapaccess failing
This was checked for in the legacy shader (in a diff way), but not in
the new backends. This null-pattern seemed the clearest.

Change-Id: Icbf9424e8c9444466e1cea5139944504df352c63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341416
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-07 18:16:50 +00:00
Robert Phillips
6c70661f86 Pass GrMipMapped boolean down to GrResourceProvider::createTexture
This is the portion of:

https://skia-review.googlesource.com/c/skia/+/266916/ (Update two of GrResourceProvider's createTexture entry points)

I still care about.

Converting the boolean to an int and passing that down is dubious at best.

Change-Id: I830cc3bfad36526bfa7884e21c9f376585d27f0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341397
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-12-07 18:08:29 +00:00
Brian Osman
e7f68f3644 Tweak ParticlesSlide's resource provider to show how to use PathBinding
Adds an example effect that spawns particles along an SkPath.

Change-Id: I53f3c02fefec814bd9e16f3ac593eac4cf6a297c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341418
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-12-07 17:26:39 +00:00
John Stiles
b21fac2481 Detect cases in Metal where out params are swizzled.
We will need to emit a helper function to work around this case, as
GLSL supports swizzled out params, but Metal does not. In this CL, we
do not yet synthesize the helper function, but we annotate the code with
a comment indicating affected calls. (Of course, this will be replaced
with a helper function in a followup CL)

Even detecting a swizzle is actually an interesting problem, because
index expressions are sometimes actually swizzles, depending on the type
of the base expression. Also, the index or swizzle might be nested in
several other valid assignable expressions.

Change-Id: I8c74f9a7daec08eff1f32387f8b6b96851c1bd6e
Bug: skia:10855
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341057
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-07 17:12:09 +00:00
Brian Salomon
2c1cfb4168 Remove rendundant tests/GrTestingBackendTextureUploadTest
Bug: skia:11019
Change-Id: Idb63ad7e792dc4e802bcbcdb16a2532675f1a0ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341044
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-12-07 16:16:19 +00:00
Florin Malita
512ff75a0b [svg] Initial <tspan> support
Introduce classes to support text node nesting:

  - TextContainer -- base class for nestable text containers
    (<text>, <tspan> etc)
  - TextLiteral -- actual text string/payload

Example structure mapping:

  <text>Foo<tspan>Bar</tspan>Baz</text>

  TextContainer[text]
    TextLiteral["Foo"]
    TextContainer[tspan]
      TextLiteral["Bar"]
    TextLiteral["Baz"]

Also add text layout state (SkSVGTextContenxt) to SkSVGRenderContext.
This will be used to track layout across a text subtree.

For now we don't touch rendering, so the output is quite garbled for
non-trivial text (no advance propagation -> things draw on top of each
other).

Bug: skia:10840
Change-Id: Ic6d3990ec8635b586f5d3d226be070fbf134e391
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341236
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-12-07 15:29:19 +00:00
Kevin Lubick
f3b959c000 [canvaskit] Respect Exif metadata for animated images.
Change-Id: I58a5095ea3314a21d895f34a4b8cab9484c29b1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340717
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-12-07 11:10:07 +00:00
Kevin Lubick
e7c1a731ff [canvaskit] Remove 2d point arrays from API.
I kept in an array of Color (Float32Array) because it's very convenient
and not worth the hassle of removing.

Change-Id: I34c430c2b5112b6d073b049a81994e946428f21c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340797
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-12-07 11:09:49 +00:00
skia-autoroll
d90e578fb4 Roll ANGLE from 2ded93db0a0d to 251ba5cb119f (15 revisions)
2ded93db0a..251ba5cb11

2020-12-05 syoussefi@chromium.org Vulkan: Fix transform feedback with in-render-pass clears
2020-12-05 zentaro@chromium.org Mark classes with final dtors as final
2020-12-05 syoussefi@chromium.org Vulkan: Support for geometry shader with max_vertices=0
2020-12-05 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 78187c025ba6 to 6991410be08c (262 revisions)
2020-12-04 timvp@google.com Batch replace std::unordered_map with angle::HashMap in src/
2020-12-04 syoussefi@chromium.org Vulkan: Fix transform feedback spanning multiple render passes
2020-12-04 syoussefi@chromium.org Vulkan: Support geometry/tessellation primitive topologies
2020-12-04 sugoi@google.com Suppress memory leaks detected by LSAN
2020-12-04 paulthomson@google.com Capture: Disable GL_CHROMIUM_bind_uniform_location
2020-12-04 jmadill@chromium.org Program: Allow non-fragment program input variables.
2020-12-04 courtneygo@google.com Ignore redundant Texture state changes
2020-12-04 jmadill@chromium.org Translator: Collect gl_in as a varying.
2020-12-04 ianelliott@google.com Revert "Suppress memory leaks detected by LSAN"
2020-12-04 angle-autoroll@skia-public.iam.gserviceaccount.com Roll VK-GL-CTS from 524e5bcfba33 to 41331850eb21 (39 revisions)
2020-12-04 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from d76e39a75a7a to 78187c025ba6 (806 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 jmbetancourt@google.com on the revert to ensure that a human
is aware of the problem.

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

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

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Tbr: jmbetancourt@google.com
Test: Test: no errors building
Change-Id: I04cabac5b4e3e26b500f91f6a6aed325187b2819
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341336
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-07 04:58:29 +00:00
skia-autoroll
aa443a8cce Roll SwiftShader from bae138de13ac to 7c84426d2abe (8 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/bae138de13ac..7c84426d2abe

2020-12-05 capn@google.com Remove stlport C++11 extensions
2020-12-04 ynovikov@chromium.org Add CQ configuration.
2020-12-04 amaiorano@google.com Add unit test for ENABLE_RR_EMIT_ASM_FILE
2020-12-04 amaiorano@google.com Kokoro: isolate flag enabling for incremental builds
2020-12-04 amaiorano@google.com Kokoro: upgrade Linux build from gcc 7 to 9
2020-12-04 capn@google.com Fix stringification of macro value
2020-12-04 capn@google.com Allow configuring Reactor's anonymous mmap name
2020-12-04 capn@google.com Remove named anonymous mmap for GL/VK allocations

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 jmbetancourt@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: jmbetancourt@google.com
Change-Id: I026aa7a4994318d41ebed0de523182ca7d44f664
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341316
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-07 04:46:08 +00:00
skia-recreate-skps
d67df01dcf Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=rmistry@google.com
NO_MERGE_BUILDS

Change-Id: I2686dd9c3a1e9adaf4f64a88a356ff48f3d9dfb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341276
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-12-06 21:29:51 +00:00
Mike Reed
edb22ec498 work on better SkPath::dump
ForceClose is a pain, and already removed from some
(hopefully all at some point) of our iterators

Follow-on plan: use raw iter, and output code compatible with
SkPath::Make()

Change-Id: Icda4ad2e605eb2fb9842dd35b5e0d4a0939e62eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341237
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-06 19:47:31 +00:00
Michael Ludwig
f326e4faef Remove SkCanvas::LayerIter used in SkCanvasStateUtils
The LayerIter existed to iterate over the top-most device and any
unclipped layers connected to it. With unclipped layers gone,
SkCanvasStateUtils can just access the top-most device using other
APIs.

Bug: skia:10986
Change-Id: I260ec37fcc8e39d1ec2972a3297521d714649cb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339991
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-12-05 17:21:53 +00:00
Michael Ludwig
e0dee01043 Remove support for deprecated kDontClipToLayer_SaveLayerFlag
This removes the conditional behavior based on #defines, and the private
flag definitions. It removes GMs and updates tests that tested the
feature. Follow-up CLs will go through and simplify the internals of
SkCanvas to take advantage of this support removal.

Bug: skia:10986
Change-Id: Id42c9e7d134dd06507fabf6577e7872942ef9077
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339988
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-12-05 00:00:13 +00:00
Michael Ludwig
3021795041 Improve CanvasState cross-library tests
Several things are accomplished as part of this:
1. The canvas_state_lib build target is brought back so that we can
   actually test the canvas state sharing across library boundaries.
2. The canvas state helper functions are updated to work with DLLs
   (confirmed tests pass on Windows in cross library mode)
3. The tests now always run, and the cross-state define only changes
   what version of the helper functions are used
4. Updated the dlopen code in the test to use the SkOSLibrary ports
   instead of calling dlopen/dlclose directly.
5. Fix bugs in SkCanvasStateUtils that were uncovered as part of
   always running these tests.
6. Switches the define away from SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
   to SK_TEST_CANVAS_STATE_CROSS_LIBRARY, since these tests are not
   strictly speaking testing the unclipped layer feature.

Change-Id: Id4ae41e4bc3fb8227367deac899878ecf9d7b98e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341003
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-12-04 22:03:25 +00:00
Nathaniel Nifong
ae95077db6 fix another m44 bug in debugger
Change-Id: Id80344a71b54c80609ec24947014592d6b30eb63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341001
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-12-04 21:41:55 +00:00
John Stiles
f2bd501ce3 Use references instead of pointers for Metal out params.
Pointers require decorating the variable with a * to read back the
value, which the code generator did not properly handle. There was a
special case to add the * but it only supported assignment into the
variable, not reading back. References require no special decoration.

This change fixes compile errors in Functions.sksl with the "bar"
function. (This test marks `x` as an inout but never actually mutates
it.) It also allows us to remove a special-case workaround for `frexp`,
an intrinsic function which uses a reference for its out-parameter.

Additionally, this CL adds a non-inlining copy of "OutParams.sksl" to
the Metal test directory, as most of our tests which use out-parameters
end up inlining all the code, which hides these sorts of bugs.

Change-Id: I31c4db04f6b512b4cd4fe65b3347b82bdbf039cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341000
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-12-04 20:22:55 +00:00
John Stiles
bc3c41b874 Enforce that layout(binding=...) is set on interface blocks in Metal.
Previously, we would emit an invalid [[buffer(-1)]] annotation on the
block, causing the Metal compilation to fail.

Change-Id: I68b2439c05db3163686e84c5dcc9a5c43870ff67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340761
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-04 19:30:35 +00:00
Mike Reed
db873dd600 add util for checker image
Change-Id: I6fcf6263a6a261016cb5971872c2f2b5a9943d8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341004
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-04 18:02:24 +00:00
Mike Reed
ca3755d020 Reland "Remove some flutter flags"
This reverts commit 7672470dff.

Reason for revert: think I fixed the .mm call-sites

Original change's description:
> Revert "Remove some flutter flags"
>
> This reverts commit a58c14025a.
>
> Reason for revert: missed .mm call sites
>
> ../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm:163:17: error: no member named 'MakeScale' in 'SkMatrix'
>       SkMatrix::MakeScale([UIScreen mainScreen].scale, [UIScreen mainScreen].scale);
>       ~~~~~~~~~~^
>
>
> Original change's description:
> > Remove some flutter flags
> >
> > Change-Id: I45466d1134511d26a90a4874a0db709c6048dd8b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340760
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=reed@google.com
>
> Change-Id: Ia9c21d1119c39d788a8c5272be1b0964527a5826
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340996
> Reviewed-by: Mike Reed <reed@google.com>

TBR=reed@google.com

# Not skipping CQ checks because this is a reland.

Change-Id: I7995f2ef46c7da470449dc4b5a96ef2f5023ef32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341002
Reviewed-by: Mike Reed <reed@google.com>
2020-12-04 17:07:59 +00:00
John Stiles
fdb8dbe69c Code cleanup: fix case of member functions.
These were added by a certain new team member who hadn't internalized
all the Skia style rules yet.

Change-Id: If8c53045428c61efb7a09c573885b17cb2ab360e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340999
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-12-04 16:56:11 +00:00
John Stiles
2630ea3312 Disallow identifier names that overlap existing types.
It's not legal to use identifiers like "int" or "sampler" to name your
variables (or enums, or structs, etc.). SkSL will now report this as an
error instead of relying on the driver to catch this.

(Note that in some contexts, it might be legal by the spec to reuse a
name that you introduced yourself, depending on the scope. In practice,
this confuses Apple GLSL, so we shouldn't support it anyway.)

This caught several existing places in our code where we used the name
"sampler." These were never exposed to the driver (they were intrinsics
that we would replace during compilation) so they were harmless before.

Change-Id: Ia6dcfca8c500d02e1eb5f9427bed8727e114dfc2
Bug: skia:11036
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340758
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-04 16:52:01 +00:00
Mike Klein
8ab65bf694 don't parse svgs we won't run
Change-Id: Ia3b11e5f785fb452a66067c0c063bc2354790978
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340976
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-04 15:54:51 +00:00
Mike Reed
7672470dff Revert "Remove some flutter flags"
This reverts commit a58c14025a.

Reason for revert: missed .mm call sites

../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm:163:17: error: no member named 'MakeScale' in 'SkMatrix'
      SkMatrix::MakeScale([UIScreen mainScreen].scale, [UIScreen mainScreen].scale);
      ~~~~~~~~~~^


Original change's description:
> Remove some flutter flags
>
> Change-Id: I45466d1134511d26a90a4874a0db709c6048dd8b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340760
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Ia9c21d1119c39d788a8c5272be1b0964527a5826
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340996
Reviewed-by: Mike Reed <reed@google.com>
2020-12-04 15:46:35 +00:00
Jim Van Verth
fa8d6915cb Remove Metal Perf bots running on MacOS 10.13.
We're not supporting Metal on MacOS 10.13 any more so we shouldn't be
running these.

Change-Id: I218f6cd1be4c5cdcc1e350e7edc55c1b74312838
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340757
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-12-04 14:49:31 +00:00
John Stiles
bb43b7e85e Simplify various logic around multi-dimensional arrays.
SkSL::Type now asserts if you try to create a multi-dimensional array;
various looping/recursing constructs that no longer need to loop or
recurse were updated.

Change-Id: I191b4a032ddc6e7759cebc8b41c536cfaaf1b626
Bug: skia:11026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340759
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-04 14:28:51 +00:00
Mike Reed
a58c14025a Remove some flutter flags
Change-Id: I45466d1134511d26a90a4874a0db709c6048dd8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340760
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-04 13:56:31 +00:00
skia-autoroll
d8090fdc86 Roll ANGLE from 8670d6183a84 to 2ded93db0a0d (4 revisions)
8670d6183a..2ded93db0a

2020-12-04 sugoi@google.com Suppress memory leaks detected by LSAN
2020-12-04 ianelliott@google.com Revert "Vulkan: Use specialization constant for halfRenderAreaWidth"
2020-12-03 syoussefi@chromium.org Vulkan: Fix precision issue in blit math
2020-12-03 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from bfb211914759 to bae138de13ac (8 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 westont@google.com on the revert to ensure that a human
is aware of the problem.

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

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

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Tbr: westont@google.com
Change-Id: I44c9e8d066a2bc6cfb3dace471e460f296e3f754
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340754
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-04 05:36:51 +00:00
John Stiles
c0c5106bd4 Add Type::isArray and Type::isStruct helper methods.
These methods improve readability for simple, commonly-performed type
checks.

We already had a (very rarely-used) helper function `isArrayed` which
was only applicable to texture and sampler types. To avoid potential
confusion, this has been renamed to `isArrayedTexture`.

Change-Id: Ibec9d872ff3b415964b842c96ddc1b5b271ac883
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340720
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-03 22:58:52 +00:00
Mike Klein
b19518dcc7 add missing unit test for 128-bit ops
Change-Id: I233398bf34411231d44613d89aed28935fe30a28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340796
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-12-03 22:25:10 +00:00
Julia Lavrova
b42686ad01 Painting styled text blocks in RTL
Bug: skia:11017
Change-Id: I13bd210a0d38614bab4a5a98c4507150043224cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340317
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-12-03 21:51:40 +00:00
Mike Klein
abcc1ecdfd plumb register aliasing hints through on arm64
There's no reason not to do this, though there are so many registers on
arm64 that I doubt we'll see any speed difference here at all.

I let dst() take a second hint, which makes most of these super easy;
double hints don't really come up on x86 because we've got all that
any() register-or-memory-address complexity to deal with instead there.

The most subtle bit is that it's safe to alias the index and destination
registers of the gather ops... we pull an index out of a lane, load the
value, and shove it back into that same lane, all totally safe.

Change-Id: I0f28ead95922e99e712ccb2cf824bf2610f556a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340721
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-12-03 21:30:43 +00:00
Jim Van Verth
95fb5786c5 Deprecate Metal support on iOS 9.
Also fixes a warning when building for OSes older than MacOS 11/iOS 14.

Change-Id: I81fb5849df41c63f6d10696f6c056451719df906
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340756
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-12-03 21:11:28 +00:00
John Stiles
e766cb8c1d Use addArrayDimension instead of manually creating array type.
Just noticed one more spot in the code where an array type was being
hand-assembled.

Change-Id: I3c9d931caee3dc8e03b3eb016af5fa0a36064d57
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340660
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-03 21:07:14 +00:00