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>
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>
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: 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>