Change-Id: Ief57d9c102b3c7658738920cdf54ccd4d21c5c5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331656
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Change-Id: I19a9564ac4d52b709b8fdd757b99222372c626f4
Bug: oss-fuzz:26942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331598
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>
Change-Id: I16a5938f5156fac2e93b8cd0b2a8e2ed45b46386
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330938
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Each caller does not need to check for null function.
Also inherit from SkNVRefCnt.
Change-Id: I9a53c3c8e9dec1361db6cfb21b97d178173b23ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331490
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This brings back the 2px wide picture frame approach described in these
slides: go/thin-line-aa. This has been in place when the per-edge-aa
only needed to support rectangles but was scrapped when the code path
was updated to support arbitrary quadrilaterals.
I opted to have the GrQuadPerEdgeAA logic check for degeneracy and
update what it requests for the outset. This scale factor out to a 2px
wide shape makes sense in the context of anti-aliasing, but not so for
the generalized inset/outset logic defined in GrQuadUtils. It would have
been more efficient to implement it there, but would have locked it in
to being just AA inset/outset.
I also updated SkGpuDevice's drawStrokedLine to construct the quad of
the line directly, and to always turn a line path into a rect, instead
of restricting it based on matrix or stroked width. With this new change
the quality of the fill rect is much higher under rotations and
perspective compared to the hairline.
See rect case: https://drive.google.com/file/d/1xwgG5heADcdXYShsDodgbuv2tbHfuBNt/view?usp=sharing
Hairline case: https://drive.google.com/file/d/1duNLxiYLLJhsJ94Uc01rSxjB4ar6_Ud9/view?usp=sharing
Bug: chromium:820987
Change-Id: Ibd58b89a467ad5a61c5479d11259024259f1bb47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329418
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:10828
Change-Id: Ifab9c2b179fa981a94d03ff96718c3b31f745fee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331338
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This was the simplest one to start with. I need to add support for the
"filter effect subregion" in order to handle tile stitching property,
so this isn't quite complete. But I believe this is enough for the
basic filters-turb-01-f test to pass, which gives us a baseline for
further filter work.
Summary of changes:
- Added attribute type and parsing for SVG integer datatype
- Added new node class for feTurbulence
- Added several new properties and parsing for feTurbulence
Bug: skia:10841
Change-Id: I8c877a5e1a837bfd527782253062eeb58febdde6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330621
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Updated API for creating a RGBA texture-backed image from RGBA texture
planes with user-provided backing store using GrYUVABackendTextures.
Ultimately we would like to remove all such APIs and have the client
make a SkSurface and draw a YUVA texture image to the surface but
a recent attempt to do that in Chrome caused a not yet understood
perf regression.
Add wacky_yuv_formats variation that tests new api.
Bug: skia:10632
Change-Id: I89411216948682f13281a91a7575d5f345badda7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329956
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
We need to abandon all the GPU resources before dropping any
refs the thread-safe cache may be holding.
Change-Id: Id1a06adf9e0241bfaf55e3f58bf8c2db928ea141
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331536
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This method is only valid in the range 2^(+/-30) due to fp32 overflow.
Adds a comment to the function and updates its test.
TBR=bsalomon@google.com
Change-Id: Ifa2fc0ed4a7f9123f0bebaa02c666c61e06e62a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331481
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Prior to rendering a node, check the filter presentation attribute and
create a new canvas layer with a corresponding SkImageFilter set.
Also added the computation of the filter effect region and added a naive
(and incomplete) construction of the image filter DAG for a
<filter> element.
Bug: skia:10841
Change-Id: Ie94299757e059c39540ad316cddf438df5726d97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330619
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
This method finds the locations a cubic needs to be chopped at before
it can be passed to the stroke tessellation shader. It's an integral
part of CPU stroke preparation and therefore extremely perf sensitive.
Bug: skia:10419
Change-Id: Ib23c2583b8cfc78814ce52425f7af2c8b2f8b420
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330314
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
You can use this to cross complie from an x86_64 mac if you have
at least XCode12 beta 2 installed, and you set target_cpu = "arm64"
in your gn args.
Change-Id: I3fcdcd162155ac0242c15260994de09177ff2f97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328659
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: chromium:1139750, skia:8389
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel,win10-blink-rel
Change-Id: I69c55f505947fdec5d9d391d2b2d2d3ff6dec9b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330216
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Some time ago FontConfig stopped being thread antagonistic and
documented that it was thread safe (or at least any thread un-safety was
a bug). However, until
447b9ccc7d
at least one of the basic atomic primitives was implemented incorrectly.
Resume using a mutex to serialize access to FontConfig until 2.13.93.
Bug: cl/339089311
Change-Id: I632f03bc575a37b5391390a0868aef256e3aacda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331339
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This has two advantages:
- sksl_gpu was on the verge of overflowing 255 program elements anyway
- this makes it easier to skip ProgramElements when generating the
dehydrated data; in particular, we don't have any need to dehydrate
function prototypes, but if we just skip them, the count would be
wrong
Change-Id: Idbcdec53518e9e6f42473a73a53dae408ce7c980
Bug: skia:10872
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331282
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>
Adds grvx, Ganesh's addendum to skvx. Here we introduce familiar names
and operations from GPU languages, as well as functions that are
approximate and/or have LSB differences from platform to platform.
The initial implementation has: fast_fma, fast_acos, and
fast_angle_between_vectors. When a function is approximate, its error
range is well documented and tested.
Also establishes GrWangsFormula as the first user of grvx.
Bug: skia:10419
Change-Id: Id0682599cf9c0303eff386095afc3ef9f3a7fa1b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330119
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
- Prototypes for never-declared functions
- Prototype before use
- Prototype after use
- A variety of inputs and outputs on the prototyped functions.
- Calling declared-but-undefined functions
Currently, the prototypes are not actually emitted in the generated GLSL
or Metal output at all. This CL is demonstrates our baseline before
proper prototype support is added.
Change-Id: I6112e0a89ab9bbecefccaca9fba985bb8011fff1
Bug: skia:10872
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331376
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
There are currently many tests skipped, but many more pass.
This changes the built binary to have a lot of debugging logic
in it so we should be able to get backtraces on those crashes
more easily when debugging.
gmtests.html was removed as it was superceded by run-wasm-gm-tests
and make run_local.
Bug: skia:10812, skia:10869
Change-Id: I72ab34d3db83a654dc8829831b3ecb795fe23d43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329170
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
We finally have a reference and derivation of Wang's formula, thanks to
tdenniston@. And it turns out that the formula we had been using for
cubics wasn't quite right. It was overly conservative for certain types
of curves.
This CL fixes the incorrect cubic formulas and adds a citation to the
"Pyramid Algorithms" book. We should now be getting by with fewer linear
segments.
Bug: skia:10419
Change-Id: Ib850c7b4d17b8d9f9abed800cc7cb5f074df6e17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331156
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit 3ab5b73649.
Reason for revert: <optional> header is C++17 only
Original change's description:
> heif: Add AVIF type and AVIF sniffing
>
> AVIF is the image format based on the AV1 video codec. The
> container for AVIF is very similar to that of HEIF. Add type
> definitions for AVIF and sniffing code for detecting AVIF images.
>
> The underlying android platform's HEIF decoder implementation will
> also support AVIF decoding.
>
> Bug: b/141654151
> Change-Id: I7e31f4cedf0bffb8920ddf880a26601e48d0e833
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330059
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Chong Zhang <chz@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>
TBR=djsollen@google.com,scroggo@google.com,chz@google.com,vigneshv@google.com
Change-Id: I9c9cd00af1a41bffa37725f39afc9bc0e504d616
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/141654151
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331336
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
AVIF is the image format based on the AV1 video codec. The
container for AVIF is very similar to that of HEIF. Add type
definitions for AVIF and sniffing code for detecting AVIF images.
The underlying android platform's HEIF decoder implementation will
also support AVIF decoding.
Bug: b/141654151
Change-Id: I7e31f4cedf0bffb8920ddf880a26601e48d0e833
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330059
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Chong Zhang <chz@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This improves the test output for Metal. Previously, the Metal output
was just an error message, since 1D textures were unsupported. Now we
have a valid golden output for the 2D case in Metal. (1D is still
unsupported and is likely to remain unsupported; Skia currently has no
use case for 1D textures.)
Change-Id: I91977712030f08e371cc6bfb2afa578940ca00b7
Bug: skia:10797
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330940
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
The triangulating path renderer can generate multiple triangulations of
the same path at different levels of precision. As previously
implemented the more precise triangulations would steal the unique
key from prior triangulations. This new callback will allow us to
replicate this behavior in the thread-safe cache.
Bug: 1108408
Change-Id: I8b445ca1e503b2fd78727a23d9376a2cf77f291c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330562
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: Id97669b7916a6909a39dda79ecb9671f7fe1caf0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330818
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Motivated by investigating
https://skia-review.googlesource.com/c/skia/+/330696
This CL does not fix anything, but is meant to better document
the current behavior.
Change-Id: I62b8cbfb39e05404f0f5303f024e1f56fc32b7e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330937
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Caused by an optimization being made in the native drawFrame function.
Fixes bug introduced in change Ibcd4f0ed468563b22e29d23c7d72b474534d21f3
Change-Id: I3d23e9dec61bb6c193bbaf75202e31ee90259708
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331016
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Don't want to do any work in dm if we're not going to actually run
a given test/gm
Change-Id: I16adf62729747f86de94bdd62228fbce31be0a85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330942
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Added:
- SkSVGFilter: This corresponds to a <filter> element. Also added some
of the attributes of this element.
- SkSVGFe: This will be the base class of all <fe*> elements.
- SkSVGFilterContext: This will hold the contextual mapping of string id
-> image filter result, for constructing pipelines.
Bug: skia:10841
Change-Id: I15a29d39411a6255ab4e11f022baa10554b2bce6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330618
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
stop running animation at the end if not looping
hook looping and background color into SkottieAnimation implementation
add looping attribute to SkottieView
Change-Id: I0c66026429018d61f49ccced1fd5add63619263a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329816
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Tyler Freeman <fuego@google.com>
Fixes a crash introduced by 0e13db707f.
Change-Id: If250c57804705f35d11c1914efe5de2e6d5edb38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330936
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This error was caused by an unbalanced symbol table push. This could
occur when an interface block encountered an error while parsing its
var-decls.
Change-Id: I910a980ac92fac7c0786c48b8dc3003ee3e75e5b
Bug: oss-fuzz:26700
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330896
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
It turns out that "userSpaceOnUse | objectBoundingBox" can be specified
as the unit type for multiple elements, such as clips, masks, filters
etc. and is not specific to gradients.
The full list:
https://www.w3.org/TR/SVG11/coords.html#ObjectBoundingBoxUnits
Bug: skia:10842
Change-Id: I995d588862fb43b9f130f0455d7af8de47046af4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330616
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Also added unit tests for each of SkTArray's various constructors, and
added `SkTArray::value_type` which allows calling code to refer to the
array's value-type. These unit tests exposed some preexisting strict-
aliasing issues in SkSTArray when compiled on GCC 6+ with optimizations
enabled, which are being investigated separately at skia:10891.
Change-Id: Ia0fb18830cfbbdcb1545fe7f7ac51d8e768a3f94
Bug: skia:10891
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330279
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Profiling sksl_large showed a non-trivial amount of time was spent on
allocating vector<int>s related to swizzle components. This CL
essentially eliminates that cost, for a ~2% savings.
Nanobench before: http://screen/35m2rfy5B8h9eyg
Nanobench after: http://screen/4GuW6ipodyBL34h
Change-Id: I653b69bf1bfbcfdf048987edd23e6f14a5ef3fbc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330336
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>