Now uses a GN template to avoid copy-pasting the same logic for each
type of test we want to perform, and the same file to be compiled in
more than one way at a time via an extra flag to compile_sksl_tests.py.
Change-Id: I8aadedeb140d78d58a345a2bac0da3d9c77e9a19
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319347
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Adds base class GrD3DAlloc and GrD3DMemoryAllocator, and a reference
to a GrD3DMemoryAllocator in GrBackendContext and a reference to a
GrD3DAlloc in GrD3DTextureResourceInfo. Internally, we override this
base class to define the AMD memory allocator.
Change-Id: I033924b0247ea330969b1398f25985e7a84aec11
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317243
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
I realized that "DefaultSettings" as a name suffix was unclear, because
"Default" is a different settings mode from skslc running with
--nosettings.
In --nosettings mode, skslc uses "standalone" settings.
Change-Id: I1f5d80df0a21cec55948c4ad146169bcb34f4999
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318210
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
We now support building an SkSL golden output twice, once honoring the
custom #pragma settings, and once more ignoring the settings. This
allows us to see the output of the workaround technique, alongside the
"default-settings" output which should not contain a workaround.
To implement this, skslc now supports a flag: --[no]settings.
When it's set, /*#pragma settings*/ comments are honored. When it's not
set, skslc ignores the comments. compile_sksl_tests.py passes this flag
along to skslc.
This approach is not strictly limited to workarounds; the
"TypePrecision" GLSL test was also updated to use this technique.
Change-Id: I79204df047b024533ed6bc1f4c088e0e878d5bb1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317246
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
MetalKit was introduced in iOS 9 and contains utilities for building
applications with Metal. None of these utilities actually seem to be in use.
However, linking against MetalKit means Flutter cannot deploy a unified binary
to iOS 8. This patch removes the unused dependency and unblocks Flutter.
Fixes https://github.com/flutter/flutter/issues/64017
Change-Id: I2cf54a1c95b4c3cda96300861598f2cb23f583d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314539
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Xiao Yu <xster@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
For the longest time, the libfuzzer binaries used by oss-fuzz
were just hacked onto the BUILD.gn file. This removes that patch
and makes them buildable from Skia proper.
After this, there should not be any modifications oss-fuzz needs
to do to a Skia checkout before it builds and runs.
Of note, oss-fuzz will define skia_use_libfuzzer_defaults to be
false so it can control those flags with more finesse (e.g.
fuzz with ASAN, fuzz with hong fuzz instead of libfuzzer). I
added on skia_use_libfuzzer_defaults so that a normal developer
gets something that works by default.
Bug: skia:10713
Change-Id: I024f5805060cba8f8560e1c2569b9309fb49a564
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316536
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Golden SkSL outputs are intended to eventually replace the majority of
our unit tests, since they can automatically update themselves when we
change implementation details of the compiler.
If you change the compiler output without updating the Golden files, the
CheckGeneratedFiles housekeeper will be triggered. Set
`skia_compile_processors` or `skia_compile_sksl_tests` to true in your
GN args to regenerate them.
Almost all of the tests from SkSLFPTests.cpp and SkSLGLSLTests.cpp can
be migrated into separate unit-test .fp/.sksl files in a followup CL.
hcm@ has signed off on removing the copyright boilerplate preamble from
our unit test files.
Change-Id: I9e24a944bbac8f8efd62c92481b022a0b1ecdd0b
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316336
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 6541013b53.
Reason for revert: TSAN issues with GrFence, and crash in GrMtlPipelineStateBuilder::CreatePipelineState.
Original change's description:
> Remove ARC from Metal backend
>
> Change-Id: I5ab28f6eda3b37d1b82c94c7cc6eaa2ce59157da
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311113
> Reviewed-by: Adlai Holler <adlai@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,bsalomon@google.com,adlai@google.com,johnstiles@google.com
Change-Id: I031629b483fc46de8bd3751253e5391c2ce87853
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312843
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This saves about 15kb of wasm code size (4kb gzipped), 11kb
of JS code size (2kb gzipped) and about 10ms
when creating a new surface (~35ms -> 25ms in a local test).
This also gates the webgl code more strongly (off unless you
really request it), since the headers won't be available
except in an emscripten environment.
Change-Id: I303f6c342c72e7cfe29be241f55ae8f5631a3f75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311916
Reviewed-by: Brian Salomon <bsalomon@google.com>
This removes about 5 kb of wasm code size (2 kb gzipped),
20 kb of js code size (4kb gzipped).
I think I can remove getproc (which is a somewhat large
function made up of a lot of string data) with some clever
adjustments of macros in a follow-on CL.
Change-Id: If3a4b30681e13abddea8e84d62297e90316ed7cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311817
Reviewed-by: Chris Dalton <csmartdalton@google.com>
This reverts commit 7f1117e886.
Reason for revert: Seems like Clang gets stuck allocating registers on ARM,
[2477/38027] CXX obj/skia/skia/SkSLByteCode.o
FAILED: obj/skia/skia/SkSLByteCode.o
/b/s/w/ir/cache/goma/client/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF...(too long)
fatal error: error in backend: Error while trying to spill LR from class GPR: Cannot scavenge register without an emergency spill slot!
PLEASE submit a bug report to https://crbug.com and run tools/clang/scripts/process_crashreports.py (only works inside Google) which will upload a report and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/skia/ski...(too long)
Original change's description:
> remove sksl interpreter guards
>
> This is only used by particles, benchmarks, and tests,
> and should be swept away by dead code elimination otherwise.
>
> Change-Id: I10462d6ae0a08dd8219fc49325160ec6790632af
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311759
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,brianosman@google.com
Change-Id: I1b6370d39285210267425f090235a4d80aebe4fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312034
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This is only used by particles, benchmarks, and tests,
and should be swept away by dead code elimination otherwise.
Change-Id: I10462d6ae0a08dd8219fc49325160ec6790632af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311759
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
I don't know why the meat is in a separate file.
Change-Id: I9bbc475d1644dd1d596cb7c98ae0e0292846e5d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311585
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
We now only support Wuffs v0.3.
Change-Id: Iaace012977ab88922ccdf2a929dc4c809bbb4047
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311016
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
This is a reland of 166cd52cee
with iOS simulator builds disabled.
Original change's description:
> move conditions for JIT into SkVM.h
>
> This makes it easier to keep in sync with the implementation in
> SkVM.cpp, and it's easier to handle here once than in each build system.
>
> Change-Id: I429f90cfc16f35a0d7e0b0fde176bc013aa7db18
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310263
> Commit-Queue: Mike Klein <mtklein@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
> Auto-Submit: Mike Klein <mtklein@google.com>
> Reviewed-by: Herb Derby <herb@google.com>
Change-Id: I82837c3d959769f26197f2402d3b911e71a35675
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310465
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 166cd52cee.
Reason for revert: iOS simulator was on unintentionally
Original change's description:
> move conditions for JIT into SkVM.h
>
> This makes it easier to keep in sync with the implementation in
> SkVM.cpp, and it's easier to handle here once than in each build system.
>
> Change-Id: I429f90cfc16f35a0d7e0b0fde176bc013aa7db18
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310263
> Commit-Queue: Mike Klein <mtklein@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
> Auto-Submit: Mike Klein <mtklein@google.com>
> Reviewed-by: Herb Derby <herb@google.com>
TBR=mtklein@google.com,herb@google.com,reed@google.com
Change-Id: I1ae283be09906603c207079cbf6f1e296a4835f8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310462
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This makes it easier to keep in sync with the implementation in
SkVM.cpp, and it's easier to handle here once than in each build system.
Change-Id: I429f90cfc16f35a0d7e0b0fde176bc013aa7db18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310263
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Relocate under modules/audioplayer and package as a standalone
component.
Change-Id: If9dc72bb0abe170049a514c9931186703a3c138a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310058
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Bug: skia:10369
Add SkEncodeImageWithNDK, mirroring the CG and WIC versions, for
encoding with the NDK APIs added to R.
Rename SK_ENABLE_NDK_DECODING to SK_ENABLE_NDK_IMAGES and use it for
both encoding and decoding.
Move code for converting to/from NDK types into a common location.
Update encode_platform.cpp to use NDK encoding APIs when available and
to use both types of webp (lossy and lossless). Add tests specifically
for the new implementation.
Update NdkDecodeTest to use ToolUtils::equal_pixels for comparing
pixels.
Change-Id: Ic62f89af27372ccce90b8e028e01c388a135a68c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308800
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Change-Id: I5b06691d4f0383957b4031b3fd3e96bdfad94521
Cq-Include-Trybots: luci.skia.skia.primary:Canary-Flutter
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309665
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Explanation: The sksl standalone compiler is used to convert the raw
(text) SkSL pre-includes into a "dehydrated" binary format. It also
(previously) depended on those files, as they were #included and used,
unless a special #define was changed. This created a dependency cycle
that we hid from GN (by lying about the outputs of the dehydrate step).
As a result, builds would never reach steady-state, because the compiler
would be rebuilt (due to the newer dehydrated files), and then the
dehydrated files would be rebuilt (due to the newer compiler).
This CL changes the logic so that the standalone compiler always uses
the textual pre-includes, and no longer depends on the dehydrated binary
files. Thus, to make any kind of change to the dehydrated files (whether
due to pre-include changes, or the encoding format itself), you just
need skia_compile_processors enabled. The dependencies are now honestly
communicated to GN, and we reach steady state after one build.
The NOTE above is because GN/ninja cache the dependencies of each
target, and will still think that the SkSLCompiler.obj linked into the
standalone compiler depends on the dehydrated files, at least until one
successful build, when it will realize that's no longer true.
Reland notes:
The bots originally rejected this CL, because SkSLCompiler was
hard-coded to load the text files from a relative path that assumed the
executable was in "<skia_checkout>/out/<some_dir>". That's not true for
bots, and it was fragile, even for users. Now, we use GN to directly
generate sksl_fp.sksl, and copy all of the other pre-includes to the
root out dir (working directory when running skslc). This means we
no longer need to generate the sksl_fp.sksl file into the src tree, and
the compiler can more safely assume that the files will be in the
working directory.
Bug: skia:10571
Change-Id: Id7837a9aba7ee0c3f7fa82eb84f7761e24b9c705
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308896
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit a1ed0dc9f8.
Reason for revert: Bots will need some guidance to ingest this CL
Original change's description:
> Untangle dependency cycle in sksl dehydration
>
> NOTE: If you have any out directories with skia_compile_processors
> enabled, you will likely need to run `gn clean <dir>`
>
> Explanation: The sksl standalone compiler is used to convert the raw
> (text) SkSL pre-includes into a "dehydrated" binary format. It also
> (previously) depended on those files, as they were #included and used,
> unless a special #define was changed. This created a dependency cycle
> that we hid from GN (by lying about the outputs of the dehydrate step).
> As a result, builds would never reach steady-state, because the compiler
> would be rebuilt (due to the newer dehydrated files), and then the
> dehydrated files would be rebuilt (due to the newer compiler).
>
> This CL changes the logic so that the standalone compiler always uses
> the textual pre-includes, and no longer depends on the dehydrated binary
> files. Thus, to make any kind of change to the dehydrated files (whether
> due to pre-include changes, or the encoding format itself), you just
> need skia_compile_processors enabled. The dependencies are now honestly
> communicated to GN, and we reach steady state after one build.
>
> The NOTE above is because GN/ninja cache the dependencies of each
> target, and will still think that the SkSLCompiler.obj linked into the
> standalone compiler depends on the dehydrated files, at least until one
> successful build, when it will realize that's no longer true.
>
> Bug: skia:10571
> Change-Id: I246360cec387b17d017805ed42ab6424329e32e7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308760
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=mtklein@google.com,brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Change-Id: Id0f3f6e18474f7531b8531cfa481031c26b88d51
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10571
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308802
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
NOTE: If you have any out directories with skia_compile_processors
enabled, you will likely need to run `gn clean <dir>`
Explanation: The sksl standalone compiler is used to convert the raw
(text) SkSL pre-includes into a "dehydrated" binary format. It also
(previously) depended on those files, as they were #included and used,
unless a special #define was changed. This created a dependency cycle
that we hid from GN (by lying about the outputs of the dehydrate step).
As a result, builds would never reach steady-state, because the compiler
would be rebuilt (due to the newer dehydrated files), and then the
dehydrated files would be rebuilt (due to the newer compiler).
This CL changes the logic so that the standalone compiler always uses
the textual pre-includes, and no longer depends on the dehydrated binary
files. Thus, to make any kind of change to the dehydrated files (whether
due to pre-include changes, or the encoding format itself), you just
need skia_compile_processors enabled. The dependencies are now honestly
communicated to GN, and we reach steady state after one build.
The NOTE above is because GN/ninja cache the dependencies of each
target, and will still think that the SkSLCompiler.obj linked into the
standalone compiler depends on the dehydrated files, at least until one
successful build, when it will realize that's no longer true.
Bug: skia:10571
Change-Id: I246360cec387b17d017805ed42ab6424329e32e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308760
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 943463f60e.
Reason for revert: Flutter
Original change's description:
> Reland "Switch GN defs on Mac and iOS to use frameworks, take 2."
>
> This is a reland of c5f8e7df81
>
> Original change's description:
> > Switch GN defs on Mac and iOS to use frameworks, take 2.
> >
> > GN will be removing support for frameworks in the libs variable, so
> > might as well get ahead of it.
> >
> > Change-Id: I990ffdb945c85a9868883d0cab1c2bdcdbdf545c
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308189
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
>
> Change-Id: Ie93c4b6a5e82bd61738367c68c2a2bac7bdf23f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308199
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=mtklein@google.com,jvanverth@google.com,herb@google.com,senorblanco@google.com
Change-Id: Iee06d5e787643643b0f2b206a7cfa2643de25f8b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308597
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This is a reland of c5f8e7df81
Original change's description:
> Switch GN defs on Mac and iOS to use frameworks, take 2.
>
> GN will be removing support for frameworks in the libs variable, so
> might as well get ahead of it.
>
> Change-Id: I990ffdb945c85a9868883d0cab1c2bdcdbdf545c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308189
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ie93c4b6a5e82bd61738367c68c2a2bac7bdf23f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308199
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit c5f8e7df81.
Reason for revert: This breaks CLion.
Original change's description:
> Switch GN defs on Mac and iOS to use frameworks, take 2.
>
> GN will be removing support for frameworks in the libs variable, so
> might as well get ahead of it.
>
> Change-Id: I990ffdb945c85a9868883d0cab1c2bdcdbdf545c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308189
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=mtklein@google.com,jvanverth@google.com,senorblanco@google.com
Change-Id: I5479693596f9bb07686325489b58489e89f60c05
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308338
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
GN will be removing support for frameworks in the libs variable, so
might as well get ahead of it.
Change-Id: I990ffdb945c85a9868883d0cab1c2bdcdbdf545c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308189
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 07438b0cda.
Bug: skia:10369
Bug: skia:10371
This will allow Skia clients developing for Android 11+ to rely on
Android's NDK APIs for decoding, which will allow them to decode
without including their own decoding libraries (e.g. libjpeg-turbo).
Using these APIs also provides support for static HEIF images.
Run ImageGenSrc in kPlatform_Mode on Android to verify decoding
visually.
Add tests and a grayscale png.
Update some test bots running Android R to specify ndk_api so they will
run the new code.
Change-Id: I4ca07d832dbd6a9d8cff0faea975fd70da00718f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308185
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This reverts commit cfef980939.
Reason for revert: Breaking Google3 roll
Original change's description:
> Add an SkImageGenerator that uses NDK APIs
>
> Bug: skia:10369
> Bug: skia:10371
>
> This will allow Skia clients developing for Android 11+ to rely on
> Android's NDK APIs for decoding, which will allow them to decode
> without including their own decoding libraries (e.g. libjpeg-turbo).
> Using these APIs also provides support for static HEIF images.
>
> Run ImageGenSrc in kPlatform_Mode on Android to verify decoding
> visually.
>
> Add tests and a grayscale png.
>
> Update some test bots running Android R to specify ndk_api so they will
> run the new code.
>
> Change-Id: Ica782339b2414d472ede0b61729a127ce41892a5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305689
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>
TBR=djsollen@google.com,mtklein@google.com,scroggo@google.com,brianosman@google.com,reed@google.com
Change-Id: Ifed506a76a0ff5903d101c1bf7330d319b8376a6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10369
Bug: skia:10371
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308180
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Bug: skia:10369
Bug: skia:10371
This will allow Skia clients developing for Android 11+ to rely on
Android's NDK APIs for decoding, which will allow them to decode
without including their own decoding libraries (e.g. libjpeg-turbo).
Using these APIs also provides support for static HEIF images.
Run ImageGenSrc in kPlatform_Mode on Android to verify decoding
visually.
Add tests and a grayscale png.
Update some test bots running Android R to specify ndk_api so they will
run the new code.
Change-Id: Ica782339b2414d472ede0b61729a127ce41892a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305689
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Gradient layout FPs were passing a position to their colorizers via
sk_InColor.x. This worked, but it makes more sense to pass coordinates
to children by sampling the child at explicit coordinates.
Change-Id: I60520f2e54e04bc9c4d8562e6b2256b95e0de5b4
Bug: skia:10548
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307217
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
SkDescriptor's programatic API is neither
exposed for untrusted use nor harded for it.
Why are we fuzzing it?
Do we need a change in oss-fuzz before deleting this?
Bug: oss-fuzz:19648
Bug: oss-fuzz:24417
Change-Id: Id8d075938d831ec8cad4014c8fe6efaef46edb55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307177
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This speeds up compiler construction, because we no longer have to parse
and process a bunch of SkSL source code during startup.
Change-Id: I6d6bd9b5ce78b1661be691708ab84bf399c6df8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305717
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This is an attempt to fuzz the usage of SkSurfaceCharacterization,
SkDeferredDisplayRecorder, and SkDeferredDisplayList.
This fuzzer first makes a surface and characterization from
GrDirectContext and then create a DDL and draw it on the surface.
The code is compiled with ninja and run with AFL at the speed around
600/sec
The future changes will include:
1. An alternative way to create DDL: first create the surface and
extract the characterization from that existing surface.
2.currently we just pass the ownership of the DDL into draw_ddl. In
the future we should add a version that retains ownership of the DDL
in order to fuzz the lifetime of the DDL.
3. Refactorize line 62-119
Change-Id: I9cd9736813be3abc82430bd4eeb559d6993ecbd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303600
Commit-Queue: Zepeng Hu <zepenghu@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
SkTypeface_FreeType uses SkFontData and makeFontData as a way to lazily
create FT_Face objects. Other SkTypeface types do not need this, so
remove it.
Change-Id: I2f2f829deac9f7f6aac06f9ce84f856922d8a861
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299443
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Change-Id: I6f4409e9e8c6d4a6d71bc41e57dce7417d7788f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302440
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
I spent a little time working on adding the --dylib JIT
mode to Windows where we'd shell out to Clang to make a .dll,
but then I remembered this VTune JIT API.
That dylib approach is nice for working with a wide range
of tools (perf, Instruments, gdb, etc.), but when your only
need is Vtune, this API is actually the best option. You
get your profiler aware of your JIT'd code with way less
overhead than the shell-then-dlopen approach.
If we need to expand to more tools I'll go make the dylib
mode work, but I think this is good enough to make me happy
on Windows for now.
This should look really similar to
https://skia-review.googlesource.com/c/skia/+/255124.
Change-Id: I9e283cdf9bdfeb11c647a2315a7916dc68ef73c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301935
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This CL is working towards replacing GrContext with the GrDirectContext/
GrRecordingContext pair.
Change-Id: Id4488e1280d76a16c37d58bd8d29fb7f8dde6b1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301940
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
The major improvement is that now the fuzzer is able to execute
the sksl code (before it just compiled it). The fuzzer will
reserve 256 bytes for providing uniforms to the shader;
meanwhile, the fuzzer will read the remaining bytes as sksl code
to create SkRuntimeEffect. It then creates a shader and executes
it by painting the shader on a canvas.
The code was tested locally with afl-fuzz, and the execution
speed was around 700/sec.
An alternative implementation would have been using Fuzz.h to
read bytes; I decided to go with sk_sp<SkData> since it has a
comparable format to other binary fuzzer and meets all the
functionality in this fuzzer.
For future changes, there are 2 important improvements to the
implementation:
1) Current shader does not have children shaders; thus,
makeShader() will fail if the SkSL ever tries to use an 'in shader'.
As pointed out in patchset 11, after creating the runtime effect,
effect->children().count() will tell you how many children it's
expecting (how many 'in shader' variables were declared). When you
call makeShader(), the second and third arguments are a
(C-style) array of shader pointers, and
a count (which must match children().count()).
Some helpful examples can be SkRTShader::CreateProc in
SkRuntimeEffect.cpp, make_fuzz_shader in FuzzCanvas.cpp.
2)
In this fuzzer, after creating the paint from a shader, the paint
can be drawn on either GPU canvas or CPU, so a possible way is to
use SkSurface::MakeRenderTarget to create GPU canvas and use a byte
to determine which canvas it will be drawn on.
Change-Id: Ib0385edd0f5ec2f23744aa517135a6955c53ba38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300618
Commit-Queue: Zepeng Hu <zepenghu@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>