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>
This reverts commit c1f3f8cda4.
Reason for revert: duplicate symbols on other platforms
ld.lld: error: duplicate symbol: GrGLCreateNativeInterface()
>>> defined at GrGLMakeNativeInterface_none.cpp:12 (third_party/skia/HEAD/src/gpu/gl/GrGLMakeNativeInterface_none.cpp:12)
>>> blaze-out/arm64-v8a-fastbuild/bin/third_party/skia/HEAD/_objs/skia/GrGLMakeNativeInterface_none.pic.o:(GrGLCreateNativeInterface())
>>> defined at GrGLMakeNativeInterface_egl.cpp:137 (third_party/skia/HEAD/src/gpu/gl/android/../egl/GrGLMakeNativeInterface_egl.cpp:137)
>>> blaze-out/arm64-v8a-fastbuild/bin/third_party/skia/HEAD/_objs/skia/GrGLMakeNativeInterface_android.pic.o:(.text._Z25GrGLCreateNativeInterfacev+0x0)
I even ran the G3 trybot and forgot to see if it was green...
Original change's description:
> Exclude gl files for Fuchsia platform.
>
> Fuchsia platform supports only vulkan. So exclude all gl files and
> add vulkan files for building Skia on Fuchsia.
>
> Change-Id: I2593a14926747b1154a1134bfdd43772627110a4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301739
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,bsalomon@google.com,guruji@google.com
Change-Id: If2623c600c5b3fc43bf896b4da02dc7cf61d8a27
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301896
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
AE allows selecting the paint order when both fill & stroke are present.
The CL also fixes some text stroke issues: stroke width not parsed
correctly and not actually used on the paint.
Change-Id: Iec27bb65d09f689365e43b801d3844106780572b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301857
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Fuchsia platform supports only vulkan. So exclude all gl files and
add vulkan files for building Skia on Fuchsia.
Change-Id: I2593a14926747b1154a1134bfdd43772627110a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301739
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This splits the creation and the updating of backend compressed textures
below the public API level. In a follow on change I will add the public
api call to updateCompressedBackendTexture.
Bug: chromium:1099255
Change-Id: Ie410cfb42046d0e0c8f4fe60055be5782f811d47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301577
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
While testing on Linux with a configuration like
skia_enable_fontmgr_custom_directory=false
skia_enable_fontmgr_custom_embedded=false
skia_enable_fontmgr_custom_empty=true
skia_enable_gpu=true
skia_use_fontconfig=false
skia_use_freetype=true
skia_use_system_freetype2=false
the default typeface will be an empty typeface with no glyphs. This of
course leads to many test failures, which is fine.
However, this also leads to crashes when testing GPU Ops since the Op
factories may return nullptr to indicate no-op but the callers of those
factories currently do not expect nullptr or handle it as a no-op.
Change the callers of Op factories to treat nullptr as no-op.
Change-Id: I9eb1dfca4a8a9066a9cfb4c902d1f52d07763667
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301586
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Now that we have inlining this should be ok.
This reverts commit 24dcd207ea.
Change-Id: I2aed6de6d962595cb0f3305bc26f340c99e0d1d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301552
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This makes batch texture ops consistent with singleton texture ops, and
images drawn through a texture producer.
Bug: chromium:1102578
Change-Id: I490b20940ef6f1899396b786369271ce7130e8a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301540
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Like SkCodec::getScaledDimensions, but accounts for orientation
Change-Id: I53ba682d5b60e46053cf3cc50b7e6430929cfcef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301581
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reserve tight space for saving callee-saved registers,
and skip any stack adjustment if we don't need it (again).
Change-Id: Ieec82c2de8cf23db3ae4057435d4bdb4dd78c791
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301659
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Maintains the old and new code-paths:
- if the shader was made with explicit filteroptions, use those
- if not, infer the filteroptions from the filterquality enum
(and the legacy heuristics of sniffing/snapping the ctm)
In either case, the bulk of the onProgram() is shared, driving off
the (possibly computed locally) filteroptions.
bench looks sort like we expect:
509.28 filteroptions_sampling_0_mipmap_0 8888
495.76 filteroptions_sampling_0_mipmap_1 8888
642.52 filteroptions_sampling_0_mipmap_2 8888
942.40 filteroptions_sampling_1_mipmap_0 8888
976.94 filteroptions_sampling_1_mipmap_1 8888
1686.34 filteroptions_sampling_1_mipmap_2 8888
Bug: skia:10344
Change-Id: I77a79f79f640986fdd6b14f163c1a03462c55dc0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297561
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
58afe4cb7a..fe36a64765
2020-07-10 cclao@google.com Vulkan: Add driverUniform's buffer to mResourceUseList
2020-07-09 courtneygo@google.com Add support for VK_KHR_sampler_ycbcr_conversion
2020-07-09 syoussefi@chromium.org Vulkan: Warm up glslang on startup
2020-07-09 thakis@chromium.org Don't build vulkan_validation_layers on macOS.
2020-07-09 ianelliott@google.com Vulkan: Rotate damage rects for 90/270 rotation
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC mtklein@google.com on the revert to ensure that a human
is aware of the problem.
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md
Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: chromium:1091440,chromium:1098741
Tbr: mtklein@google.com
Test: Test: Aztec Ruins with VVL
Change-Id: I45b11d58c976f53ac94c732224417f21b22b2c49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301744
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Not important, and the constructors for these six benchmarks were
allocating a total of 3 GB of RAM.
Change-Id: I03db4d21fe9755902e1b642eb2b6315f697b955e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301656
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Adds GrD3D12CommandSignature, needed to pass to ExecuteIndirect().
Change-Id: I24aa395d710414eba0464aa4e2cb0a87721bcb12
Bug: skia:10482
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301378
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This functionality was being used but we forgot to check for it.
Bug: skia:10419
Change-Id: If74d7b58de5b9e902798e0d9834beaf2ad7f752b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301544
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Previously, clamping would be a separate child processor on the GrPaint.
This CL consolidates all GrPaint-related color processors into a single
call to grPaint->addColorFragmentProcessor.
Change-Id: If726a1d216d55cb2d07cff92a7c4e7e2a873322d
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301020
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Another piece of the Great Recontexting.
Change-Id: Ib089dbdba89e25add407cf816d28c96c7e5dbc05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301303
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This was previously implemented as a runtime effect in order to dogfood
runtime effects when they were new. However, runtime effects do not
support passing a color to a FP via `sample(fp, inputColor)`, which
is needed to properly implement SkPaintToGrPaint.
Change-Id: Ic826860ab06038f13633be677d79a9138d41db85
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301547
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Previously due to a typo it was half(half, float).
Change-Id: I2b9deeb50a4d20348f3bf949e0d5b01847d653c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301576
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Code relevant to repeat mode was being inserted for filtered
clamp-to-border but not used.
Change-Id: I431d876459cc29b28fcc6599c20da482ffc2582e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301551
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
At least locally after an Nvidia driver update I am seeing both of the
buffer address extensions reported by the driver. It is illegal in
vulkan to enable both of them on the device, so we remove the EXT
version if we have both.
Change-Id: I7b3046c5fd27ba071ce9e1c58c478eaf4d2a82b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301553
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
OpenType and many other font formats have the concept of pre-computed
metrics for the union of all glyph bounding boxes. This allows for fast
though course quick rejecting of bounds, since the glyphs themselves may
potentially be quite a bit larger than the EM. With the introduction of
variable fonts OpenType does not vary these bounds, so the bounds are
only valid for the default non-varied font.
As a result the fTop, fBottom, fXMax, and fXMin reported in
SkFontMetrics may be bogus. Since simply always setting them to empty
zeros may be disruptive, provide a way forward for new users to check if
the bounds are valid.
This exposed an issue where SkTextBlobBuilder::TightRunBounds does not
handle SkTextBlob::kRSXform_Positioning, so add a test for that.
Change-Id: I872729e0f16e2a196229f9902addf4b07b461590
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301455
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
The normal code path is to call ConservativeRunBounds, but if it runs
into issues it will call TightRunBounds. ConservativeRunBounds properly
handles RSXform positioning, but TightRunBounds does not. Handle RSXform
in TightRunBounds.
Change-Id: Ic024fe3e0784acb818ba4714d9042e313f9fdbfa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301454
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
We only ever use CIter.
Change-Id: Ifb0ca12931f583173379c90429ec9c8ead7bdd5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301385
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
More busywork so we can deprecate getGrContext.
Change-Id: I8479985334881251e6ad814d7855681df716b1da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301542
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Since we make two jit() passes anyway (mainly for allocation size, with
stack size hinting along for the ride) we might as well feed forward
another hint, which registers we'll use in the program.
We can use this information when targeting the Windows ABI to save only
the callee-saved registers that we actually use. ARM will benefit too.
The first jit() call always saves all callee-saved registers , making
its code size a conservative estimate for the second jit() that saves
only what's needed.
This leaves some dead stack space reserved for unused registers,
but since it's O(1) and relatively small I don't really care.
I think it's an easy follow-up to tighten it up.
Change-Id: I41e71e6b2baba9c0b60ffdc303c138a54ff50dab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301534
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Instead GrTextureEffect is a special effect known by
program builders, pipeline states, etc.
Change-Id: I4436d7a10a1c3174fe1f02f136363a1c117f92fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301357
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
I've been working on only saving the callee-saved xmm registers we
actually use, and been failing a lot at it, but I think I finally
understand why and have an new approach brewing.
While I get my new approach going, this CL just salvages some of the
enter/exit refactoring from my failed attempts.
It's mostly streamlined comments. In terms of behavior it switches to
adjusting the stack pointer just once at enter and once at exit, instead
of up to twice each. This is really just finesse, and not something I'd
expect we'd ever notice.
Change-Id: I701b4c38c797d8f7cf25c84a5dfd201fc73b1f8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301530
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Our intent is to report the number of analytic clips that have been
added; the number of fragment processors involved is an implementation
detail. (Hypothetically, an analytic clip might be represented by more
than one FP.)
Change-Id: I17484d7a69cc68b06bbbf87cb1e6fb38d5b2fb5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301453
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: I9fa9f8785f48e884cf296a638347003d1687e7c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301536
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
We were assuming that there was always a vertex buffer. However,
when doing instanced draws, there's not necessarily one.
Change-Id: I870aa039b5cc552dce2644f40b933de1f62ad80b
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301449
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: I680cd7278d1cc0e3378991e6692098e5ce9e3efd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301447
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This may address a memory regression detected by Pinpoint, and is
conceptually more correct. If an analytic FP happened to be implemented
in terms of multiple FPs, naively counting all the child FPs wouldn't
give the right result.
Change-Id: Ia9b76f765db832f063f2730c820ebcdea3f7edb8
Bug: chromium:1097538, chromium:1102804
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301444
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Early results from measuring RSS (via /proc or similar) shows results
that aren't very accurate or stable. From previous detailed testing, I
know that mallinfo gives a good answer. We only really need results
from ~one machine, so limiting to UNIX bots isn't a big deal.
Change-Id: I73af043720b1204e1da436e2e63b19766a97a9a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301445
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:10139
Change-Id: I379249758160ad096c9e03f25a41b00bc1987518
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301384
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This should fix the gpu-specific slides in Viewer.
Change-Id: I3ff069005bfe3639eb9608223b13c64f4c28c396
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301441
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: Ice75d0caa7b4beb2d982be094d62b54e71b45045
Bug: chromium:1101491
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301456
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>