Commit Graph

52052 Commits

Author SHA1 Message Date
Brian Osman
133724cc02 SkSL::Program: Maintain a separate list of shared program elements
Change program iteration so that default iteration (over owned & shared
elements) only permits const access. Add a separate non-const iterator
that only visits owned elements.

Initially, nothing is being placed in the shared list. Follow-up CLs
will move builtin variable declarations, builtin functions, etc.

Bug: skia:10905
Change-Id: I9a5b11170117bad3ff6a43aab780c1189904417c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330477
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-19 19:42:10 +00:00
Herb Derby
1c49494d71 Add missing cache invalidate
Change-Id: I63b204e127e7deb33f6da5c7413b201bcf06ff88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336516
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-11-19 19:04:20 +00:00
Michael Ludwig
8df863fc01 Switch to static asserts for internal canvas struct sizes
Change-Id: I3f6f23459c5b5572337c3803235f165b139522d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335862
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-19 18:36:25 +00:00
John Stiles
d9076cb637 Merge foo.x, foo.y, foo.z into foo.xyz when optimizing swizzles.
When values from the same argument are used consecutively by the outer
swizzle, they can be merged in the inner swizzle. Merging isn't always
possible, of course, but it will be used where it can be:

    `half4(1, colRGB).yzwx` --> `half4(colRGB.xyz, 1)`
    `half4(1, colRGB).yxzw` --> `half4(colRGB.x, 1, colRGB.yz)`

Change-Id: Id164b046bc15022ded331c06d722f1ae3605a3bd
Bug: skia:10954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335872
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-19 18:20:24 +00:00
Herb Derby
281583ae73 processGlyphRunList -> processGlyphRun: move out loop
This change will facilitate experimenting with direct-to-op
text draws. There should be no performance change because
almost all blobs are a single run.

Change-Id: I07fb3487e0601e00507403d94bc611c5022c1408
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336447
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-19 18:15:44 +00:00
Mike Reed
8dacba3547 Migrate away for heuristics for bicubic filtering
Bug: skia: 7650
Change-Id: Id20aed3a7a2676ab053a32a95f225e60186c0851
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335593
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-11-19 18:12:04 +00:00
Chris Dalton
9458c8d44a Add an epsilon to GrPathUtils::findCubicConvex180Chops
Cubic tangents become unstable if we chop too close to 0 or 1. This
adds an epsilon to simply not chop them if it's too close.

Bug: skia:10419
Change-Id: I99e98c5d433e2cb59c767ee564e015d7ec4f7765
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336280
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-11-19 17:43:21 +00:00
Herb Derby
4ce110b8bd Revert "tighten up device bounds for glyphs"
This reverts commit 5dfa02be69.

Reason for revert: Breaks zooming text on android.

Original change's description:
> tighten up device bounds for glyphs
>
> Change-Id: I61655b9492bdaacc2c1d5c7631b2e67af2b46668
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335280
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=herb@google.com,robertphillips@google.com
Bug: chromium:1150411

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

Change-Id: I80e334192bd60995e95ecfc6d5310f5ae7af4d7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336446
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-11-19 17:23:21 +00:00
John Stiles
0777ac4778 Optimize swizzled multiple-argument constructors.
This will reorder constructors with swizzles applied, such as
    `half4(1, 2, 3, 4).xxyz` --> `half4(1, 1, 2, 3)`
    `half4(1, colRGB).yzwx` --> `half4(colRGB.x, colRGB.y, colRGB.z, 1)`

Note that, depending on the swizzle components, some elements of the
constructor may be duplicated and others may be eliminated. The
optimizer makes sure to leave the swizzle alone if it would duplicate
anything non-trivial, or if it would eliminate anything with a side
effect.

Change-Id: I470fda217ae8cf5828406b89a5696ca6aebf608d
Bug: skia:10954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335860
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-19 17:10:11 +00:00
Nathaniel Nifong
f403dd2426 update debugger wasm makefile
Change-Id: I4d8ed14bfee5f00e3babe909ce625304f63aa504
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336419
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-11-19 16:45:10 +00:00
Kevin Lubick
753e7983e0 [infra] Remove deleted taskdriver
Change-Id: I1fca7981d3573c69a506bd3f5461d1c4c6be9431
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336421
Reviewed-by: Eric Boren <borenet@google.com>
2020-11-19 15:26:38 +00:00
Adlai Holler
039f90c0a9 Revert "Remove GrDrawingManager::fActiveOpsTask ivar"
This reverts commit f42994335f.

Reason for revert: Maybe broke Chrome roll?

Original change's description:
> Remove GrDrawingManager::fActiveOpsTask ivar
>
> This thing is just extra state tracking we don't need. Also
> update a couple out-of-date comment blurbs around there.
>
> Bug: skia:10877
> Change-Id: Ibd41afd34d85d52a3d9ebb98e700f5ce9ed3fffb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335276
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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

Change-Id: Ia81cb8baa0eca8920dd7489d252e27fbb84818e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10877
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336441
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-11-19 15:20:38 +00:00
Jim Van Verth
d482d35b17 Update docs for iOS deployment
I've landed some CLs that should make it easier to launch apps on Xcode,
plus it looks like the latest GN has also added some fixes.

Change-Id: Ifaf051020dff7ecad7091c854b8b42fc7f475afa
No-Try: true
Docs-Preview: https://skia.org/?cl=335871
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335871
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-11-19 14:50:28 +00:00
Kevin Lubick
9db7858165 update infra repo
This pulls in the fix for debugger:
https://skia-review.googlesource.com/c/buildbot/+/336384/

Change-Id: I7f0ea5d2a1bb326ad946ba4e5f33c7232388ac7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336436
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-11-19 14:12:32 +00:00
John Stiles
b5aa3ef24a Update DeviceSpaceEffect and ColorSpaceXform to return half4s.
This is slightly more efficient than assigning to sk_OutColor; it saves
one assignment in the optimized code.

Change-Id: I225c428a2b0bfdb0da4b60c6a8b488f104868ea7
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336216
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-19 14:03:37 +00:00
skia-autoroll
f0cd1ab54a Roll ANGLE from 2ffff6d024c7 to 8b76d37f9f9a (13 revisions)
2ffff6d024..8b76d37f9f

2020-11-19 jmadill@chromium.org Trace Tests: Run one step per frame.
2020-11-18 cclao@google.com Revert "Vulkan: Remove rotation related data from driver uniform"
2020-11-18 kainino@chromium.org Skip one more test on Apple DTK (ARM)
2020-11-18 syoussefi@chromium.org Vulkan: Remove texture gather suppressions from khr deqp 3.1
2020-11-18 syoussefi@chromium.org Vulkan: Support format reinterpretation in imageBuffers
2020-11-18 ynovikov@chromium.org Remove Nexus 6P expectations
2020-11-18 syoussefi@chromium.org Vulkan: Fix aliasing format for non-layered image bindings
2020-11-18 m.maiya@samsung.com Add auto generated code for GL_EXT_tessellation_shader
2020-11-18 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Headers from 11c6670b4a4f to 30e70cbd9850 (1 revision)
2020-11-18 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from 0cb8cc8cfcb2 to 169d0c7f8a7b (4 revisions)
2020-11-18 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 04515da400d5 to bb96f79d0e15 (2 revisions)
2020-11-18 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Loader from be6ccb9ecaf7 to b54d55122868 (3 revisions)
2020-11-18 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from d8a3265375ff to 45b78e7b52a7 (529 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 lovisolo@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: lovisolo@google.com
Change-Id: If72f769f5098c095ad9cf52abcedc3968dd35e8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336278
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-19 05:04:25 +00:00
skia-autoroll
5bd1dc204c Roll SwiftShader from bb96f79d0e15 to 060020166679 (4 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/bb96f79d0e15..060020166679

2020-11-18 zzyiwei@google.com Add baseline VK_EXT_device_memory_report support
2020-11-18 capn@google.com Only lower MSan codegen optimization for LLVM JIT
2020-11-18 rnk@google.com Use pragmas to work around MSVC x86_32 debug miscompile bug
2020-11-18 caramelli.devel@gmail.com Subzero: inconsistency in registered threads option for the CommandLine with external LLVM

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 lovisolo@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: lovisolo@google.com
Change-Id: Ia5eda7a03965531a099203c0b86615f5f050fc97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336277
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-19 05:00:15 +00:00
skia-autoroll
c6ad76c61b Roll Dawn from a0758a1aef12 to ce207be41fd6 (4 revisions)
https://dawn.googlesource.com/dawn.git/+log/a0758a1aef12..ce207be41fd6

2020-11-18 rharrison@chromium.org Use the transform manager instead of invoking the transform directly
2020-11-18 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 90f32536458a to 46d9c7745efa (13 revisions)
2020-11-18 hao.x.li@intel.com Query API: Non Precise Occlusion Query
2020-11-18 cwallez@chromium.org RefBase: remove implicit conversion to bool.

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 kainino@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: kainino@google.com
Change-Id: Ic542c7582351b43e94e383ae7310e12ec1f1a9ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336279
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-19 04:56:25 +00:00
Michael Ludwig
6ed90894d0 Move clip operations on SkDevices into a helper macro
The macro is slightly awkward right now because it also takes the
code to call into SkConservativeClip. In a later CL this will be hidden
inside SkNoPixelsDevice, and the macro only has to take one argument.

Some of the lines that will go away extend past the 120 limit. I think
it's okay visually given its use in a macro and the short lifetime of
those lines.

Bug: skia:9283
Change-Id: Id2d872e7d098d816e208438c4462251dc1c457d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335859
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-11-19 00:40:33 +00:00
Robert Phillips
4dbff75f6a Update GrTTopoSort to use pre-existing memory ...
... rather than allocating an extra "result" array.

This CL also changes the sort algorithm to soldier on even after
it has found a loop.

Change-Id: I03fe8da1aade6c9461eb42e1b7d79fae562210f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335824
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-18 22:34:55 +00:00
Michael Ludwig
0d66b25fc1 Simplify internal logic in androidFramework_setDeviceClipRestriction
Bug: skia:9283
Change-Id: I21f1e5840171929d038781ffd397203ab86927ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335857
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-11-18 22:17:45 +00:00
John Stiles
d1d872905b Add fix for fuzzer-discovered crash with negated constructors.
This was found at https://oss-fuzz.com/testcase-detail/5155684475469824
but the associated oss-fuzz issue ID appears to be misdirected (it's
showing oss-fuzz:24498, an unrelated issue).

PrefixExpressions can return true for `isCompileTimeConstant` but did
not implement `compareConstant`; the fuzzer discovered this. Because
compile-time constants can only be compared if they are of the same
kind, this means that `compareConstant` is actually comparing a pair of
expressions that are both negated. These negations will just cancel
out, so `compareConstant` on a pair of PrefixExpressions can just call
`compareConstant` on the inner operand of each expression.

Change-Id: I7793e25314e6c8a74278b73299d310794baf71f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335870
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-11-18 21:53:45 +00:00
Brian Osman
1f71f433ff Always enable SkSL's ByteCodeGenerator, disable interpreter in Google3
The ByteCodeGenerator is needed for SkSL-via-skvm, but almost no one
needs the ByteCode interpreter.

Bug: b/172773885
Change-Id: Ia7b6768dbc00c6c78b971ba50f0b702536bbd5b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336016
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-11-18 21:30:45 +00:00
Jim Van Verth
2d36627c8b Add ios_min_target.
Setting this variable sets up the proper compiler flags and
correct minimum version in Xcode.

Change-Id: I8133994332fc9778580745a99a2d5d73a6f88382
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335661
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-11-18 21:21:25 +00:00
Jim Van Verth
421ee3a28f Fix typo in gn/ios.gni.
Change-Id: Ia2862680ac87976ddf2a845b958df055755ce527
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335869
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-11-18 21:07:25 +00:00
John Stiles
d0f712f3fe Add fix for fuzzer-discovered crash at oss-fuzz:27614.
The fuzzer managed to create a test case which temporarily evaluates to
expression `half2(half(0.2)) + 2` as it is optimized. This requires a
bunch of temporary nonsense math as the IR Generator is attempting to
simplify as it goes; various attempts to remove terms from the fuzzer
test-case would cause it to stop reproducing the error.

Constructor::getVecComponent assumed that any constructor with a single
scalar argument would always implement `getConstantFloat` and
`getConstantInt`; however, constructors themselves did not actually
implement these methods. This meant that nesting a scalar constructor
inside a non-scalar constructor would abort when it tried to deduce the
value inside the inner constructor.

This has been fixed by implementing `getConstantFloat` and
`getConstantInt` for Constructors. These methods will assert if the
constructor has more than one argument or is a non-scalar type. This
should allow any number of nested constructors, e.g.
`half4(half(half(half(1))))` should recursively evaluate properly,
should we somehow generate this as an intermediate expression.

Change-Id: Iaee4284cba03974443cd7b5dccfd7909c1a5f3a6
Bug: oss-fuzz:27614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335868
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-11-18 21:01:15 +00:00
Michael Ludwig
466e7e88d3 Hide SkCanvas::AutoValidateClip in cpp file
Bug: skia:9283
Change-Id: I1f808ec9d004f228b17a139dff7a2f44676baf50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335856
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-11-18 20:56:15 +00:00
Michael Ludwig
47d5ba9638 Fix SkRegion::setPath to respect inverse fills when path isn't finite
This maintains the status quo around clipping calls with non-finite
paths.

Bug: skia:9283, skia:10970
Change-Id: I99cda50a7117464c12ca7d3409ed6b4892863ec8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335826
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-18 20:47:20 +00:00
Michael Ludwig
5013d957f3 Rename fDeviceClipBounds to fQuickRejectBounds
This better differentiates it from device clip bounds, and the fact that
the stored bounds have been outset by 1 to account for AA, and are only
used for quick reject purposes.

Bug: skia:9283
Change-Id: I47420f23b74e47626596f978c78f01d7d97ae808
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335828
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-11-18 20:37:55 +00:00
Brian Salomon
94584f4574 Remove unused macros from GrGLConfig.h, GrGLConfig_chrome.h, and scripts
Change-Id: I5a9e7d490fd71f326ac37a72eb942fc64f557733
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335666
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-11-18 20:23:35 +00:00
Michael Ludwig
408959f24c Track AA-ness and rect-ness in SkConservativeClip
This is needed so that SkNoPixelsDevice can switch to using
SkConservativeClip and more fully implement the SkDevice API.

Tracking the AA-ness allows SkCanvas/SkDevice::isClipAA() to be more
accurate; previously for recording canvases, it always returns false.
Technically, it will still return false after this CL until
SkNoPixelsDevice is updated to use SkConservativClip's new AA tracking.

Tracking whether or not the clip shape remains an intersection of rects
is similarly meant so that SkDevice's getClipType and
SkCanvas::isClipRect are more accurate. Without this tracking,
SkNoPixelsDevice always claimed the clip was a rectangle. This is not
accurate, even if all it needs to otherwise track is the bounds of the
more complex shape. We got away with it because it doesn't seem to be
critically relied on during any recording steps of clients.

Bug: skia:9283
Change-Id: I3acde969aca9d7eb97a7e1c7ab8374e7230b04fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335825
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
2020-11-18 19:56:35 +00:00
Mike Klein
e08eb75bbe allow JIT on ARM Mac
`viewer --slide GM_runtimecolorfilter` improves 10->3ms.

Change-Id: Iab079ddbdc93fdc406372899b26dc7de223855fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335917
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-11-18 19:50:15 +00:00
John Stiles
57adba0959 Fix worklist files with skslc.
Previously, the worklists were being deleted as soon as they were
closed; by the time skslc executed, they were already gone.

Change-Id: I0d0be87525093a3ff37421cbff553fa481c8e1f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335864
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-18 19:41:45 +00:00
Adlai Holler
f42994335f Remove GrDrawingManager::fActiveOpsTask ivar
This thing is just extra state tracking we don't need. Also
update a couple out-of-date comment blurbs around there.

Bug: skia:10877
Change-Id: Ibd41afd34d85d52a3d9ebb98e700f5ce9ed3fffb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335276
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-11-18 19:30:05 +00:00
Florin Malita
c743164d30 [skottie] More robust font style parsing
- both weight and slant are optional
  - handle arbitrary whitespace separators
  - case insensitive keys

Change-Id: Iadd3a43167cd71654d7578549bd331fde243c28f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335822
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-18 19:16:45 +00:00
Christopher Cameron
75ae8fcc31 Remove unexpected color conversion in GrSurfaceContext::readPixels
One of the branches of this function creates a temporary
GrSurfaceContext and (recursively) calls readPixels on that object.

In the case that canvas2DFastPath is true, this GrSurfaceContext is
given nullptr as its color space. This value historically mean to
do no color conversion, but now is interpreted as sRGB.

Consequently, if the content being copied is not sRGB, this will
introduce a conversion from sRGB to the content's color space, which
will result in incorrect pixel values being read.

Bug: skia:10965 chromium:1115317
Change-Id: I62b7edb728f0dbefa9a5a9c60905dee0cde6455a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335738
Commit-Queue: Christopher Cameron <ccameron@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-18 18:33:45 +00:00
Brian Osman
7b239054d9 Revert "Replace skslc worklist files with -- delimited command lines."
This reverts commit 3e1b771ce4.

Reason for revert: Not working on Windows.

Original change's description:
> Replace skslc worklist files with -- delimited command lines.
>
> Command lines with delimiters are a simpler approach; they don't require
> a scratch file to be created and parsed. (I didn't consider this
> approach until after implementing worklists.)
>
> This also fixes a minor issue with result codes when processing multiple
> files at once; in particular, unit tests can ignore compile errors, but
> regular fragment processor compilation should treat compile errors as
> fatal and stop the build.
>
> Change-Id: I3f153e7670d757c6b021bf60a260a2cd3f2090aa
> Bug: skia:10919
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334428
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

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

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

Bug: skia:10919
Change-Id: I0e4bae8a8e09c61eac4e79453fd38e5e81b29e89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335858
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-11-18 18:02:25 +00:00
Herb Derby
c59e4486d5 use the DirectSubRun to size the arena
The alloc size calculation is over estimating the size needed.
It should be using DirectSubRun::DevicePosition, which is
4 bytes, instead of the size of the union of the different
sub run types which is 12 bytes.

The DirectSubRun is by for the most common case.

Bug: chromium:1147712

Change-Id: I972b5f4e716448fc72c64204c88fbaa373043392
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335669
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-11-18 17:54:25 +00:00
Kevin Lubick
ae0d3ffe6d [canvaskit] Document and tweak MakeImage API
Change-Id: I84b8bc8b84e0b79ea4a8a6b53bb3358e0ec9c138
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335665
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-11-18 17:43:56 +00:00
Herb Derby
90f211f46b calculate glyph offset using (0,0) mapping
This code has rotted a bit. The glyph off set is now calculated
by mapping (0,0) through the current matrix, and the initial
matrix, and taking the vector difference. Residual is no longer
needed and all the plumbing can be removed.

Change-Id: I20b56afc6749fd26fe283a7ff22f38951da0e6f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335823
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-11-18 17:18:45 +00:00
John Stiles
108bbe2522 Optimize away swizzles on single-argument constructors.
The optimizer can now turn the expression `half4(1).xyz` into
`half3(1)`, or `half4(1).w` into `1`. This is actually a somewhat common
case when inlining chains of fragment processors, as inputs are often
overridden to `half4(1)` or `half4(0)`. This optimization also applies
to more complex cases, e.g.:

     `half2(anyFunc(sqrt(2))).yxyx` --> `half4(anyFunc(sqrt(2)))`

Since the interior of the constructor is always evaluated once in either
case, it does not actually matter what the constructor contains.

Change-Id: I8d5f358502eaa8e35d4968e74fbd6b0ce2ab6365
Bug: skia:10954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335818
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-18 17:02:45 +00:00
Brian Osman
8dbcebac34 Remove (unused) SkSL::NodeArrayWrapper
Change-Id: Ibe3c3d27a112df8838bc86d6c2482277fdae62af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335821
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-11-18 16:56:15 +00:00
Tyler Denniston
79832e3151 [svg] Parse "inherit" generically for SkSVGProperty
This generic parsing will allow us to later remove kInherit and
"inherit" parsing from all other specific SVG types.

Also convert "filter" presentation attribute to new-style parsing
for compatibility with the setter.

Change-Id: Id917e12d77cdefb1a8f1404cac1e0c4e486d8b53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335660
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-11-18 16:51:55 +00:00
Brian Osman
fb964a40f1 SkSL: Preserve coerced types of literals during dehydration/rehydration
Fixes a bug with ternary expressions in the pre-includes.

Change-Id: Ib277ce7d9f6a50ab3ee02610746af2672208afde
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335820
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-18 16:27:25 +00:00
Brian Osman
0540efe78a Remove nullptr default Type from IntLiteral
This was slightly dangerous, and only used for tests. Fix the tests to
just put a Context on the stack.

Change-Id: Ifc3d600c3498e1dedeee8350f3284163f3195bec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335819
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-11-18 16:14:35 +00:00
Nathaniel Nifong
ffc7a21490 update externs for debugger_bindings.cpp
include minVersion function in externs

Change-Id: I4789240fb5f2dac701d948d8cacc997c7bcf444b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335640
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-11-18 16:09:14 +00:00
Brian Salomon
fcc4e85f3c Remove SkYUVAInfo::PlanarConfig
Bug: skia:10632
Change-Id: I72b4379c82fd7dc4c7169387014f8fffbb86e23f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-11-18 14:26:14 +00:00
Robert Phillips
9ef7e206b9 Remove friending between GrRenderTask and GrDDLTask
Change-Id: Ic60753fbffab7cbe4dde6834f80bfd83bdaaa5c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333461
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-18 12:39:24 +00:00
Robert Phillips
a186c35574 Update the TopoSort test ...
... to ensure that, if the topological sort fails, all the nodes still appear in the result.

Change-Id: Ic4acaab2662c872662246b7c1f5471e17c5ba98e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335639
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-18 12:39:15 +00:00
Kevin Lubick
2efafe688d Fix debugger auto-deploy
Change-Id: If13899402363059ba2950c955b71077dfe3a2f60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335656
Reviewed-by: Ravi Mistry <rmistry@google.com>
2020-11-18 12:26:40 +00:00