Commit Graph

1120 Commits

Author SHA1 Message Date
Florin Malita
7806794543 [skottie] Initial audio layer plumbing
Looking at audio layer support for Skottie, we need an API to
externalize audio asset loading and playback.

Similar approach to the other resource types for loading, but in
addition we also delegate playback control to the embedder.

First thought: keep it really simple and just emit seek() events.
Positive |t|s for track playback, negative for track off.

The embedder needs to implement state menagement (playing/not-playing)
and optional synchronization (if animation playback is not real time).

Change-Id: I54d1c2c39d0c38dd926f7c93764bde6695cb3fe2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309317
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-08-12 13:03:16 +00:00
Julia Lavrova
73f003acfd Revert "ICU: SkShaper (bidi iterator only)"
This reverts commit 64e3d040e9.

Reason for revert: Breaking google3

Original change's description:
> ICU: SkShaper (bidi iterator only)
> 
> Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

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

Change-Id: Ib081d97f61e57f74bb9414b3973cca640f3b3929
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309442
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-11 21:06:10 +00:00
Julia Lavrova
64e3d040e9 ICU: SkShaper (bidi iterator only)
Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-11 19:58:08 +00:00
John Stiles
31954bf23f Enable ClangTidy check performance-unnecessary-copy-initialization.
https://clang.llvm.org/extra/clang-tidy/checks/performance-unnecessary-copy-initialization.html

Finds local variable declarations that are initialized using the copy
constructor of a non-trivially-copyable type but it would suffice to
obtain a const reference.

The check is only applied if it is safe to replace the copy by a const
reference. This is the case when the variable is const qualified or when
it is only used as a const, i.e. only const methods or operators are
invoked on it, or it is used as const reference or value argument in
constructors or function calls.

Change-Id: I1261410deccd8ea64e85edec53fbd5360940e587
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308759
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-07 22:20:36 +00:00
Herb Derby
6e2c56fefc move SkArenaAlloc reset to its own class
SkArenaAlloc has three fields that are used only for reset. Make a
subclass called SkArenaAllocWithReset which has the three
fields, and has the reset functionality.

An example of a reset() that is used instead of using a better scope
is PathOpsAngleAfter in PathOpsAngleTest.cpp.

Change-Id: Ie1965d128dfb7df9e022f4d18460d3f75f33e1a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307348
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-08-07 18:48:53 +00:00
John Stiles
ec9b4aab87 Enable ClangTidy check readability-const-return-type.
https://clang.llvm.org/extra/clang-tidy/checks/readability-const-return-type.html

`const` on a non-pointer/reference return type typically doesn't add
value and can have negative side effects. (i.e., returning a
`const std::string` isn't meaningfully different from returning a
`std::string`, but can sometimes inhibit move-related optimizations.)

In Skia's case, the priv() functions are a notable exception where const
return types are intentional and valuable. These calls have been marked
with NOLINT to exclude them from the check.

This check does not affect pointer and reference returns, where
constness is important.

Change-Id: I86cab92332f164e5ab710b4127182eec99831d7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308564
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-07 17:42:38 +00:00
John Stiles
3977088e23 Enable ClangTidy check readability-static-accessed-through-instance.
Our codebase generally tends to avoid this pattern naturally, and this
can catch real mistakes, e.g. http://review.skia.org/308659

https://clang.llvm.org/extra/clang-tidy/checks/readability-static-accessed-through-instance.html

Change-Id: I3b37ab6242bcca310bbbec718facdd8687f9c4ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308658
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-07 16:57:17 +00:00
Florin Malita
8bfe39160d [skottie] Add animation in/out point getters
We already expose frame-index-based seek methods, makes sense to also
allow querying the in/out points.

Change-Id: I3b805f6df3484c8bdc7cd6c81e54b5073710e222
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308598
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-08-07 14:47:26 +00:00
John Stiles
a6841be235 Enable ClangTidy check llvm-namespace-comment.
This fixes a large number of SkSL namespaces which were labeled as if
they were anonymous, and also a handful of other mislabeled namespaces.
Missing namespace-end comments have been added throughout.
A number of diffs are just indentation-related (adjusting 1- or 3-
space indents to 2-space).

Change-Id: I6c62052a0d3aea4ae12ca07e0c2a8587b2fce4ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308503
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-08-06 19:07:52 +00:00
Nathaniel Nifong
2000c64e2b Publish version 0.17.3
Change-Id: I08199a86f59e33ed87ee48b879b405f496d03f67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308166
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-08-05 15:23:05 +00:00
Ben Wagner
8c9830bc46 Use SkUniqueCFRef with CTTypesetterCreateLine
This is a 'Create' and returns a reference. Be sure to release the
reference.

Bug: skia:10542
Change-Id: If4ed7a37a43efe5f8f17a4a15a0f82cdae7d9276
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307795
Auto-Submit: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-08-05 14:19:29 +00:00
Harry Terkelsen
10f019c506 [CanvasKit] Expose TypefaceFontProvider.
Change-Id: I950a3a4f45b7b4a106299576bc918531054b23f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307873
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-08-04 20:55:21 +00:00
Julia Lavrova
093263ce45 Remove SK_PARAGRAPH_OLD_SPACE_RESOLUTION (staging changes done)
Change-Id: Ia67eb9055cb589c1ff73b5ac851a2c7b538c2575
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307790
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-04 19:35:38 +00:00
Julia Lavrova
2aa72457ba Chromium Project Code Inclusion
Change-Id: Iac6a1ca7131c74f297ee047e0e3841740e24e18b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307703
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-08-04 15:50:46 +00:00
Nathaniel Nifong
e09b314405 Add ParagraphBuilder.pushPaintStyle to allow text to be colors with paints.
Previously one could not color text with paints, even though TextStyle's foregroundColor and
backgroundColor fields are SkPaints. Canvaskit only exposed these as colors in order to allow
SimpleTextStyle to be a value object that would not have to be deleted by the user.

CanvasKit.Paint is a bound SkPaint. I wanted to allow a user to pass a paint to be used
in a text style without alterting SimpleTextStyle's status as a value-object.

So I've added a new bound method, pushPaintStyle which acts just like pushStyle but allows
a foreground and background paint to be supplied which are used to override the existing paints.

The user is responsible for deleting these paints.

Sorry for the kludgy design, if you have got a more elegant way, I'm open to suggestions.

Change-Id: Ib78464171346fe9f717f6d5b9d9428b1d0278498
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307596
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2020-08-04 13:23:06 +00:00
Mike Reed
093de4eb2c Use more of pathbuilder
Bug: skia:9000
Change-Id: Ia5c16ffbaeebbdd027c692c96095cfa181030d35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307702
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-03 21:04:55 +00:00
John Stiles
fbd050bd0b Enable ClangTidy check modernize-make-unique.
The majority of existing call sites were automatically updated using
clang-tidy -fix. A small handful required a manual update,
e.g. CppCodeGen.

This check is a bit lenient, and in particular will not flag cases like
`std::unique_ptr<Base>(new Derived())` which is still pretty common
throughout our codebase. This CL does not attempt to replace all the
cases that ClangTidy does not flag.

Change-Id: I5eba48ef880e25d22de80f321a68c389ba769e36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307459
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-03 17:53:52 +00:00
Leon Scroggins III
577536aa1a Remove "dummy" to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 162536543
Change-Id: I40df639e2f42da6d99d897a02cf05aecff682061
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307226
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-07-31 19:11:23 +00:00
Florin Malita
ef666fa83d [skottie] Avoid image data duplication when pre-decoding
The MultiFrameImageAsset helper can be flagged to decode lazy images
upfront (to avoid run-time decoding and resource cache interactions).

But when pre-decoding is enabled, MultiFrameImageAsset yields a
different SkImage for every request - *even for static images*.

This means that e.g. each image layer precomp instance gets its own
copy of the data.  Bad bad bad.

Update MultiFrameImageAsset to cache the last frame, and reuse when
backed by a static image.

Change-Id: I65431e7ccf4a64f0055f935f9823c33402d1bb2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306938
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-07-30 22:09:41 +00:00
Elliot Evans
6b2602ed2d Remove remaining usages of skvx::mad
This CL attempts to remove the remaining subset of skvx::mad usages.
https://skia-review.googlesource.com/c/skia/+/304853 removes all usages
of skvx::mad but causes small differences in rendering, so it is not
suitable for landing.

https://skia-review.googlesource.com/c/skia/+/306702/ removes all
non-nested usages of skvx::mad

Change-Id: Iab5d4cfd0feb856c38b3ebbfe3bf3ed5aad20fe6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306722
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Elliot Evans <elliotevans@google.com>
2020-07-30 20:41:09 +00:00
Elliot Evans
fc5bbe0a6c Fix SIMD CanvasKit build to output to the expected directory.
the BUILD_DIR in compile.sh was not being set properly prior to this
change, resulting in build output in the `skia/out/canvaskit_wasm`
directory instead of the `skia/out/canvaskit_wasm_experimental_simd`
directory.

Change-Id: Idb599d4885a16c10848e4c90954e778f63065c45
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306299
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-07-29 15:04:22 +00:00
Julia Lavrova
3d404beb7c Reland "Attach whitespaces to the neighbor unresolved blocks"
This reverts commit 143646297e.

Reason for revert: Have to fix it and reland again

Original change's description:
> Revert "Attach whitespaces to the neighbor unresolved blocks"
>
> This reverts commit 131c5ad6f1.
>
> Reason for revert: Blocking the G3 roll
>
> Original change's description:
> > Attach whitespaces to the neighbor unresolved blocks
> >
> > Fix the situation when an unresolved {arabic} text is broken into
> > many small runs by resolved english spaces.
> >
> > Bug: skia:10487
> > Change-Id: I3a739501c0fb7e0fc845e68392e1d214df9302db
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304000
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> > Reviewed-by: Ben Wagner <bungeman@google.com>
>
> TBR=bungeman@google.com,jlavrova@google.com
>
> Change-Id: Iaa338dd5fb5c9962df2ee32bafbc089da0e2b8a1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10487
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305797
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Bug: skia:10487
Change-Id: If8a85254fd536f465d80766de0406053d90c96a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306062
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-07-28 17:19:21 +00:00
John Stiles
059ed6749d Update types in TextStyle to use member initialization syntax.
While doing a refactor, Clang issued some warnings about having copy-
constructors without assignment operators in some TextStyle classes.
Rewrote the code to minimize custom constructor/copy/assignment methods,
favoring C++11 member initialization syntax instead.

Change-Id: I4f0361ce38d4b0ada346b0ede4fcad4e2b686d67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305959
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-07-27 20:53:15 +00:00
John Stiles
c88a6ac43d Add missing #includes for referenced types.
These missing includes were discovered when attempting a refactor.

Change-Id: I8aad5610de2337de6e55885b5868e606c1514eaf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305997
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-07-27 14:06:31 +00:00
Florin Malita
d1ae99438e [skottie] Add support for inline/data-uri fonts
BM can now export inline fonts, encoded as data-uris.

Extend our DataURIResourceProviderProxy helper to also intercept and
decode inline typefaces.

Change-Id: Iaf1be9db2fd32383af78bc351b1228fe6b3b64bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305685
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-07-25 13:46:52 +00:00
Robert Phillips
143646297e Revert "Attach whitespaces to the neighbor unresolved blocks"
This reverts commit 131c5ad6f1.

Reason for revert: Blocking the G3 roll

Original change's description:
> Attach whitespaces to the neighbor unresolved blocks
> 
> Fix the situation when an unresolved {arabic} text is broken into
> many small runs by resolved english spaces.
> 
> Bug: skia:10487
> Change-Id: I3a739501c0fb7e0fc845e68392e1d214df9302db
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304000
> Commit-Queue: Julia Lavrova <jlavrova@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Iaa338dd5fb5c9962df2ee32bafbc089da0e2b8a1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10487
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305797
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-24 19:48:22 +00:00
Julia Lavrova
131c5ad6f1 Attach whitespaces to the neighbor unresolved blocks
Fix the situation when an unresolved {arabic} text is broken into
many small runs by resolved english spaces.

Bug: skia:10487
Change-Id: I3a739501c0fb7e0fc845e68392e1d214df9302db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304000
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-07-24 18:21:49 +00:00
Julia Lavrova
90787fefef Reland #3 "ICU API: only in SkParagraph, simplified."
This is the fix for google3 failure.
This reverts commit e36a466723.

Reason for revert: Trying to fix google3 build brake

Original change's description:
> 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>

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

Change-Id: Ife73aa21539e870d69bda6b5892979646732d778
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304060
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-24 13:28:52 +00:00
Florin Malita
d140e767b8 ResourceProviderProxyBase should not drop loadFont (yet)
Although deprecated, loadFont is still in use - we should proxy it for
now.

Change-Id: Iccef76d4ba394d08fc61c7471def8dee470db695
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305516
Auto-Submit: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-07-23 18:26:50 +00:00
Elliot Evans
1ec3b1ab2e Fix CanvasKit SkSurface.requestAnimationFrame for web workers
Change-Id: I19d368d6f9f8a2bf4bed73a8f1843be907183096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305539
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Elliot Evans <elliotevans@google.com>
2020-07-23 16:03:23 +00:00
Florin Malita
72db717348 [skottie] Add spread/choke support for glow styles
Spread/choke operates as a compression of the alpha channel towards the
low bits.

Change-Id: I82aec1321b60f7f75a79e8280e761d4629f6c923
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305183
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-07-22 23:20:02 +00:00
Kevin Lubick
ab47abfca3 [canvaskit] Publish 0.17.2
Change-Id: Ia6d3ec1a38498468bb6b30059f94ded0d68800a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305196
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-22 17:15:02 +00:00
Harry Terkelsen
d2093b13c8 Set fCanUseDoLoops = false for WebGL 1.0
Change-Id: Ie55e876638246a444c32b169ed3830cd7b0fbab3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304861
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-07-22 01:27:56 +00:00
Brian Salomon
d007281c9a Fix clang 12 Wsuggest-override and Wsuggest-destructor-override
Change-Id: Ic44e24057b95bb014504f02a736fb4341afc8971
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304856
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-22 01:11:36 +00:00
Elliot Evans
683bbe01ff Modify CanvasKit to work in a Web Worker and add a demo of it in action.
In this CL:
- Modify modules/canvaskit/gpu.js to support the use of OffscreenCanvas.
- Add a CanvasKit demos.skia.org demo for CanvasKit in a Web Worker.

Change-Id: I8c26bd94f2aa5b3c09cf149b056b910b0e4cd602
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304320
Reviewed-by: Elliot Evans <elliotevans@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Commit-Queue: Elliot Evans <elliotevans@google.com>
2020-07-21 22:21:06 +00:00
Florin Malita
138518d92a [skottie] Cleanup post https://skia-review.googlesource.com/c/skia/+/303997
Follow up to address review comments.

Change-Id: Ia5f3f7a638524191538ac039a4d84c497a261c78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304600
Auto-Submit: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2020-07-21 19:35:08 +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
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
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
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
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
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
Kevin Lubick
3ba1777ceb [npm] Support npm publish flow
See go/npm-publish and b/160246223

Change-Id: I5a92a19ae6be814ca9a98679cfe39184f7cdb184
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303580
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2020-07-20 11:29:36 +00:00
Nathaniel Nifong
a237f9ec12 Run both puppeteer tests in a WebGL 1 and 2 configuration.
Change-Id: Iaaef7d1ac96eec1813d3b0340ecabcbec90e3923
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300982
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-07-17 20:36:37 +00:00
Nathaniel Nifong
d0c9d0cb7f Replace arcTo with three functions for it's overloads.
I found this to be about 15% faster on a benchmark designed to stress these functions.

https://github.com/flutter/flutter/issues/61305

Change-Id: I9dc2a8396e54c55464bb71562de0c07c853e829c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303024
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-07-17 19:08:03 +00:00
Florin Malita
f2d90659ff [skottie] Fix analytical mask fill type
Sksg::Merge needs to preserve the fill type of the first path appended
in the stack.

Theoretically, one could append multiple paths with different fill types
using sksg::Merge, but in practice Skottie should never do that (append
mode with invertible shape only used for the very first mask in a stack).

TBR=
Change-Id: Ie9ac9187cc1c8baaae2bef439313a7700407f04a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303582
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-07-17 18:35:23 +00:00
Nathaniel Nifong
2d7afd4824 fix heap-buffer-overflow by not returning string from reportBackendType
Change-Id: I2dbced29f9d43454e35e3ff9fbbb97d11fef29a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303623
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-07-17 16:42:30 +00:00