Commit Graph

490 Commits

Author SHA1 Message Date
Herb Derby
afe25662ee Reland "Replace SK_ARRAY_COUNT with std::size() all the rest"
This is a reland of commit f838f6f62f

Original change's description:
> Replace SK_ARRAY_COUNT with std::size() all the rest
>
> Added changes to IWYU_mapping.imp to allow std::size. This
> requires multiple entries because std::size can be defined from
> any number of files. Please see the following for reference:
> https://en.cppreference.com/w/cpp/iterator/size
>
> Please check that I got all the includes from the documented list.
>
> Change-Id: I8346834ea7f37128f2dc50f238af0665a1fcfd8d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550696
> Reviewed-by: John Stiles <johnstiles@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: I4c50340ac2a970de479da57d7d1b55bbf267b617
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/555004
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2022-07-01 16:20:51 +00:00
Herb Derby
cc01efda73 Revert "Replace SK_ARRAY_COUNT with std::size() all the rest"
This reverts commit f838f6f62f.

Reason for revert: Breaks G3 Roll and MSVC compiler

Original change's description:
> Replace SK_ARRAY_COUNT with std::size() all the rest
>
> Added changes to IWYU_mapping.imp to allow std::size. This
> requires multiple entries because std::size can be defined from
> any number of files. Please see the following for reference:
> https://en.cppreference.com/w/cpp/iterator/size
>
> Please check that I got all the includes from the documented list.
>
> Change-Id: I8346834ea7f37128f2dc50f238af0665a1fcfd8d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550696
> Reviewed-by: John Stiles <johnstiles@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: I6282aeac9dacb31f753acb57d196a88447bce761
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/555003
Auto-Submit: Herb Derby <herb@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-07-01 15:30:06 +00:00
Herb Derby
f838f6f62f Replace SK_ARRAY_COUNT with std::size() all the rest
Added changes to IWYU_mapping.imp to allow std::size. This
requires multiple entries because std::size can be defined from
any number of files. Please see the following for reference:
https://en.cppreference.com/w/cpp/iterator/size

Please check that I got all the includes from the documented list.

Change-Id: I8346834ea7f37128f2dc50f238af0665a1fcfd8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550696
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-07-01 13:39:17 +00:00
Herb Derby
8ccbeeebc3 Remove SkMakeSpan
Change-Id: I33121076bac3ceca19c81ff9fb47e4b024a14230
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549838
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-06-15 17:26:32 +00:00
John Stiles
d259c5e4a2 Run SkSL unit tests with optimizations disabled.
We were already running unit tests twice--once with inlining on, and
once with inlining off, but always with optimization on. Now, the two
passes are instead "inliner + optimizer both on" and "inliner +
optimizer both off". (Testing the full 2x2 matrix of possibilities seems
like overkill.)

Change-Id: I73fb0932877c7b953c1f2e122125e5e7781a8582
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539396
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-05-11 14:38:07 +00:00
Kevin Lubick
62f57a02b3 [includes] Enforce IWYU on src/utils
Client changes:
 - cl/443664347
 - cl/444232853
 - http://ag/17915718
 - http://ag/17913178
 - https://crrev.com/c/3602239

Change-Id: I16bcdbbe2b13bbf52f007b0f131e9ee0c14ed237
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532257
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-04-28 17:32:20 +00:00
Brian Salomon
7bfda9a23d Finish GrMipMapped->GrMipmapped
Change-Id: I3a9e9e90b0ac1b1099830eaca06506bcce794144
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530055
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-04-15 15:43:52 +00:00
Robert Phillips
59ba27bc6a Move Ganesh specific headers into include/private/gpu/ganesh
Change-Id: Ia799cdff5288efe5d5d53e8d8f77cf32f3343371
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529131
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-04-12 17:30:07 +00:00
Greg Daniel
719239cd69 Move all Ganesh source files into ganesh subdirectory.
Change-Id: I238d29ba0250224fa593845ae65192653f58faff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528156
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-04-07 21:06:50 +00:00
Kevin Lubick
556ca8f7ee [includes] Enforce IWYU for //tools/debugger/...
This moves the Build-Debian10-BazelClang-x86_64-Release-IWYU
job from experimental to on when a file in one of the
folders that we enforce IWYU is modified (currently
for svg, sksl, and now, debugger).

Change-Id: Ia6fe1e7b30fc486db3eb081b6a64bc4c250cbf0b
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525796
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-30 13:53:13 +00:00
Kevin Lubick
efce17de5d Reland "[includes] Remove link between SkImage.h and SkImageEncoder.h"
This is a reland of commit f60584eb0f

Client changes:
 - https://chromium-review.googlesource.com/c/chromium/src/+/3508565
 - http://cl/433225409
 - http://cl/433450799

Original change's description:
> [includes] Remove link between SkImage.h and SkImageEncoder.h
>
> According to go/chrome-includes [1], this will save about
> 210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000
>
> Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

Bug: 242216
Change-Id: Ic61e4ac2878e7a51f389312a3a434856e2e32be3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518277
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-10 04:47:51 +00:00
Kevin Lubick
a573cbab1a Revert "[includes] Remove link between SkImage.h and SkImageEncoder.h"
This reverts commit f60584eb0f.

Reason for revert: Chrome and G3 issues

Original change's description:
> [includes] Remove link between SkImage.h and SkImageEncoder.h
>
> According to go/chrome-includes [1], this will save about
> 210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000
>
> Canary-Android-Topic: image-encoder-2
> Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

Bug: 242216
Change-Id: Idc906ff54d8baf49989d3ee24e045d7b0ca710df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517676
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
2022-03-08 13:09:49 +00:00
Kevin Lubick
f60584eb0f [includes] Remove link between SkImage.h and SkImageEncoder.h
According to go/chrome-includes [1], this will save about
210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000

Canary-Android-Topic: image-encoder-2
Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-07 21:32:13 +00:00
Jim Van Verth
34241299d1 Control growth of FuzzNicePath with chain of path transforms
The test case was producing a stack trace of sequential path transforms.
While each individual call would check to see if the path is too big
and return, the resulting path kept getting continually bigger as we
transformed it again and then popped the stack. This CL changes it to
skip the transform op if the returned path is already too big.

Bug: oss-fuzz:39470
Change-Id: I7f93ae0c39f19950c59fd7173da481286e7274ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508637
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-02-14 19:11:54 +00:00
John Stiles
e4d3d3947c Synthesize uniforms/children in the SkRuntimeEffect fuzzer.
Previously, we used a fixed portion of the fuzzer input for uniform
data, and assumed zero children. Now we synthesize uniform and child
inputs based on the needs of the input shader. We no longer need to
reserve the last 256 bytes of each shader for uniform data; a followup
CL will remove the special corpus that this fuzzer used.

The contents of each uniform/child is not particularly important, since
we don't care what the final paint looks like. Each uniform is filled in
with increasing values in each slot, starting at zero (0, 1, 2, 3, ...).
Each child is a simple built-in shader/filter/blender.

(Fuzzer corpus change: https://github.com/google/oss-fuzz/pull/7266 )

Change-Id: Idc8bfcb17c10a470ef35fafc1789b915495e1d67
Bug: skia:12781
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507924
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-02-12 01:59:09 +00:00
Brian Osman
cd189e8a1d Remove default/deprecated arguments to makeShader calls
Bug: skia:12643
Change-Id: I37e1718a20283dfb814c85260257d57bac2b7b34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506211
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
2022-02-09 20:41:23 +00:00
Herb Derby
9bbff29d9c Add flatten and MakeFromBuffer to SkDescriptor
Create canonical flattening for SkDescriptor and unflattening
for SkAutoDescriptor.

Eventually Slug serialization and the remote glyphs cache will use
this method for SkDescriptor serialization.

Change-Id: Ia4b6be43058aeca19fbfdcf3c5cdd8d703935775
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505681
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-02-09 16:00:24 +00:00
John Stiles
2ad035378c Remove no-op versions of skstd::to_string.
The float/double versions of skstd::to_string produce better output than
the standard version, so let's keep those.

Other versions of to_string don't do anything at all now that
SkSL::String no longer exists. (Previously they existed to convert the
return type from std::string to SkSL::String.) We can just use the
std::to_string functions directly.

Change-Id: Ief513e474bd47ed97f1c13f4f64fb161f1654065
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503832
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-02-03 22:33:41 +00:00
John Stiles
ffeb6f2339 Remove SkSL::String class.
The previous CLs have removed the last significant differences between
SkSL::String and std::string. This CL removes SkSL::String entirely and
replaces it with std::string throughout the code.

Apologies for the very long CL, but I have done my best to make it as
simple and reviewable as possible. The vast majority of changes are
simple replacement of `SkSL::String` with `std::string`. In the rare
spots where code is moved from one place to another, it is logically
unchanged.

Change-Id: I39563d2db45da229f17f4504dfd63e00bde7a96e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503339
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-03 14:59:16 +00:00
John Stiles
e572d5b672 Convert SkSL::to_string to skstd::to_string.
Other than the `float`/`double` overloads, the only value-add of these
methods is to cast the result of `std::to_string` to `SkSL::String`.
When `SkSL::String` is removed, these no-op calls can be replaced with
direct calls to `std::to_string` instead. (The float overloads can
continue to live in `skstd` since their output isn't the same.)

Change-Id: I4df841403114b401ad58017f0264a246fef341af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502786
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-02-02 15:26:17 +00:00
Kevin Lubick
94303e8dbd [fuzz] Make mock gpu fuzzer compatible with Vulkan
Change-Id: I857da21674db669d7f2766132e9909ccbcdc1c55
Bug: oss-fuzz:44132
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502536
Reviewed-by: Robert Phillips <robertphillips@google.com>
2022-02-01 15:09:22 +00:00
John Stiles
3ab1292dad Fix null dereference in ~PromiseImageInfo.
While working on an unrelated fuzzing task, I noticed in the logs that
~PromiseImageInfo was crashing on a null dereference while the fuzzers
were doing smoke checks. It looks like fuzzer was being detected as
"broken" and presumably is not being run: http://screen/AKPKmyx7mHJ5nir

This CL should resolve the null dereference, but I don't know if this
indicates a deeper problem.

Bug: skia:12851
Change-Id: I4a44891783504372f28ab4b320c01a14df0892a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497436
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-01-21 20:18:04 +00:00
Jim Van Verth
62bb436301 Limit offset range when fuzzing SkOffsetSimplePolygon
Bug: oss-fuzz:43699
Change-Id: Ie856aed03b513a4ea84a09deda6a05b95b086b07
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496876
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-01-20 21:03:51 +00:00
Jim Van Verth
1f0e64acd6 Don't do PolyUtil fuzz tests on invalid polygons.
We shouldn't be trying to run the convex routine on known non-convex
polygons, and the offset routine only works for simple polygons.

Bug: oss-fuzz:43588
Change-Id: Ia1c73d05d7b1496c9d0599ee36eafe1d58684fd6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494818
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-01-14 14:33:27 +00:00
Jim Van Verth
db1d93f3b4 Stop timeout in api_mock_gpu_canvas.
Large paths can lead to large processing times for path effects and
hence timeouts.

Also re-enables ShrinkToFit test until that code is finally removed,
but using the PathPriv interface instead.

Bug: oss-fuzz:39040
Change-Id: If3aeac0e8b67cecc6e536cafda01ed6d583655d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494240
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-01-12 22:45:31 +00:00
Robert Phillips
bf489abbf6 [graphite] Add SkTileModeToStr
This is to be used in the PaintParamKey's block dumping methods.

Bug: skia:12701
Change-Id: I14de21d2d8b30e0fa69ac2e33fa975dc20f6656c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/493217
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-01-11 16:19:53 +00:00
Jim Van Verth
2e6181cac4 Check sanitized data when fuzzing PolyUtils.
PolyUtils is only ever used when generating shadows, and the data there
is pre-clamped to 1/16th values, so we should be fuzzing on that.

Bug: oss-fuzz:39746
Change-Id: I609059ab14cd83f0dab2d40cb17e3cb7979cff8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/493039
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-01-10 17:31:45 +00:00
Brian Osman
2f2977e19d SkSL: Add color transform intrinsics
These convert a color between the working color space and a known,
useful space (linear TF, sRGB gamut).

Bug: skia:10479
Change-Id: I3308e691beeaca5120ed0c2e30cf08661caa3684
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481416
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-28 14:05:49 +00:00
Herb Derby
0f2390f7fb move SkRemoteGlyphCache.h to private
Chromium has been using the remote glyph cache for a few years now.
It's time to give it a proper home.

This is an intermediate CL. The old .h file includes the new .h file.
After I change the include paths in Chromium, I will delete the old
file.

Change-Id: Iaf00c46aa0698326c0bdec9a0eed218bcc3e334e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482700
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-12-10 20:20:56 +00:00
Jim Van Verth
3b0eacc6ea Add SkSL::ShaderCaps and use as base class for GrShaderCaps
Bug: skia:12559
Change-Id: I76b225c9ca81264a15869324007d774d210053b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473416
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-11-19 16:35:39 +00:00
Brian Osman
95a8c4fdc0 Make all shader caps uniquely-owned
Bug: skia:12559
Change-Id: I5775120a826e582e73aab83273e59bc48c057a5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462077
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-10-21 20:11:03 +00:00
John Stiles
31e4c38236 Add support for function prototypes in Pipeline stage.
Previously we did not have a Pipeline callback function for prototyping
a function, so prototypes would be discarded during translation. This
failure mode can be seen in http://review.skia.org/454741, where
FunctionPrototype.sksl is made more complex (thwarting the inliner).
This causes us to emit invalid GLSL, and dm asserts/fails in the SkSL
tests: http://screen/4PkEEWn4m4tF5e7

This CL makes the same changes to FunctionPrototype, but does not crash.

Change-Id: Ia342c7811a454f62f52677440d247e628a1bdc4f
Bug: skia:12488
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/454740
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-09-30 20:02:19 +00:00
Michael Ludwig
db285de247 Adjust fuzzing behavior for triangulator/dashing
Bug 36932:
Adds a lower limit when fuzzing dash path effects, since it can produce
paths with > 140k verbs. While this is not that much memory on its own,
the triangulating path renderer can require 3+GB to complete its work
(although it doesn't actually fail).

Bug 36945, 37042:
Also has PathToTriangles check for finite paths before starting any
triangulation work. These paths were created with infinities and NaNs.
Normally such a path would be rejected at a higher level in SkCanvas.
Since the triangulator is being fuzzed directly, this emulates this.
It's included in GrTriangulator and not the fuzzer's main function
because it's a cheap test and theoretically we could encounter a path
that was built lower down (e.g. dashing or transformed to device space)
that then overflowed.

Bug: oss-fuzz:36923, oss-fuzz:36945, oss-fuzz:37042
Change-Id: If97212bf410f771b42cebaedb5733af1abbfc4b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449520
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-09-16 16:32:11 +00:00
Brian Osman
cbfa34a58c Convert internal SkSL to use .eval()
Also update RELEASE_NOTES to describe new syntax.

Change-Id: I2666551b98f80b61ae3a48c92a9e306cdc7242b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444735
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-03 15:54:54 +00:00
Robert Phillips
2af13c135b Reland "Fix compilation w/ "skia_enable_svg = false" (take 2)"
This reverts commit 44b7568c8a.

Reason for revert: Google 3 CL has landed

Original change's description:
> Revert "Fix compilation w/ "skia_enable_svg = false" (take 2)"
>
> This reverts commit 30a6b101f4.
>
> Reason for revert: Maybe blocking G3 roll?
>
> Original change's description:
> > Fix compilation w/ "skia_enable_svg = false" (take 2)
> >
> > Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,fmalita@chromium.org,fmalita@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
>
> Change-Id: Ibee3819e073b04efdf9736058c1f9b288249620c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444216
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: Idf73d864108067ee1c34e88ee4e5236847abd582
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444501
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-01 17:54:08 +00:00
Robert Phillips
44b7568c8a Revert "Fix compilation w/ "skia_enable_svg = false" (take 2)"
This reverts commit 30a6b101f4.

Reason for revert: Maybe blocking G3 roll?

Original change's description:
> Fix compilation w/ "skia_enable_svg = false" (take 2)
>
> Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,fmalita@chromium.org,fmalita@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ibee3819e073b04efdf9736058c1f9b288249620c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444216
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-31 22:31:00 +00:00
Robert Phillips
be2c3ee05d Fix compilation with "skia_enable_skparagraph = false"
Change-Id: I034d841618fbf878223c82ec30f0ad37678d737e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443899
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-31 18:50:20 +00:00
Robert Phillips
30a6b101f4 Fix compilation w/ "skia_enable_svg = false" (take 2)
Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-31 18:28:25 +00:00
Kevin Lubick
17c7c2f4b1 [fuzz] Update docs with better OSS-Fuzz link
Change-Id: I1be6bb537139c50342602aacd978585151a4a480
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443916
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-08-31 14:04:02 +00:00
Brian Osman
293497e77f Convert internal sample() calls to shade/filter/blend
Bug: skia:12302
Change-Id: I8cf958acf9214d0de903a4097647afd74f2a659e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441541
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-24 21:03:44 +00:00
Kevin Lubick
e312532442 [fuzzer] Add docs about oss-fuzz dashboard and coverage report
Change-Id: I2ef9ee10a4e3b9c0c250b5ad2c6c99f9415b37db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441098
Reviewed-by: John Stiles <johnstiles@google.com>
2021-08-23 13:05:39 +00:00
Kevin Lubick
9ad7874d42 [fuzzer] Add docs about testing oss-fuzz locally.
Change-Id: Ib1e94b3924ece8b249a42a5c25daf771132e534a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441058
Reviewed-by: John Stiles <johnstiles@google.com>
2021-08-23 11:40:35 +00:00
Kevin Lubick
890f3b37f6 [fuzz] Update documentation
Change-Id: Iea5cfb32f27d09e5231a0952aef52a8502abbfcd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441056
Reviewed-by: John Stiles <johnstiles@google.com>
2021-08-20 15:25:26 +00:00
John Stiles
b0697081b5 Improve SPIR-V handling of RTFlip when running the fuzzer.
If the passed-in shader references RTFlip (i.e., sk_FragCoord is used),
the settings must contain RTFlip layout info; otherwise, an error
occurs. Originally, the fuzzer detected this as a problem because the
error was being delivered via SK_ABORT, but it's failing more cleanly
now that Ethan's new error handling code is in place (causing the fuzzer
to report that the bug was "fixed"). With this CL, the oss-fuzz shader
will actually compile successfully in SPIR-V instead of leading to an
error.

Change-Id: I3268e84bd8e01c95a25ed0845a37324e98033c4b
Bug: oss-fuzz:35916
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439779
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-08-17 22:31:10 +00:00
Robert Phillips
41ebbd71b1 Move triangulators and tessellators into gpu/geometry
This is the other half of making everything in gpu/ops be v1-only.

Bug: skia:11837
Change-Id: I5d77a499ef02eba69208d5bd634650433d02f6fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440216
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-17 19:25:25 +00:00
John Stiles
13c9f6690e Fix additional cases of variable shadowing.
These changes will allow us to enable shadowed-variable warnings.

Change-Id: I24ee7e198c1c77b58836237c37557c00452680e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439476
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-08-16 17:47:14 +00:00
Brian Salomon
54fd96b5fa Fix Wunused-but-set-variable warnings
Change-Id: I0e093fd35b11e9a765ef9c09f3b6346086ff66bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435983
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-05 21:49:18 +00:00
Michael Ludwig
2f6e2f8410 Use SkClipOp::kFoo instead of kFoo_SkClipOp from SkClipOpPriv
The SkClipOpPriv.h header will be going away soon, but a number of
places still use its kIntersect_SkClipOp definitions instead of the
equivalent SkClipOp::kIntersect. Besides updating these references,
a number of unnecessary includes to SkClipOpPriv.h are removed and
some test cases exercising expanding clip ops are deleted since they
will be unnecessary shortly.

Bug: skia:10208
Change-Id: I2bbdd6bb39869134c6a80ef2b4482e6cabdeb0b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436157
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-08-03 18:08:21 +00:00
John Stiles
2955c26908 Add new SampleBlender callback to SkVMCodeGenerator.
This CL doesn't actually allow the callbacks to be invoked from SkSL
yet, but the callbacks now exist and are now threaded through the
various callsites which will need them.

Change-Id: I00f43ff94de9da8d93daf2e59885eea6f87c2e3e
Bug: skia:12257
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431696
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-23 21:05:10 +00:00
John Stiles
d9a56b9227 Remove color argument from sampleShader.
Passing a color to a shader isn't supported in SkSL anymore.

Change-Id: Ic2743e519b69fa8add4c010166032b4dab2152a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431938
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-23 21:04:08 +00:00