It's interesting but perhaps not consequential that bilerp can produce
alpha just greater than 1.0f. I think this setup of what clamps what
where mirrors the GPU backend more closely. No pixel diffs.
The p3 GM would draw a little differently if we only min(rgb, alpha),
and that would make it inconsistent with the GPU backend, so I've kept
it as clamp(rgb, 0, alpha).
Change-Id: I5cfacb9aae56c33b542cbc4e5e740b4d24c6b9e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262812
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
It's possible for SkSL to get past the initial compile (with generic
Settings), then fail to compile once we install the device's caps.
Change-Id: I082edae13659f3ed6501e87eee67eb3b9cd03303
Bug: chromium:1039366
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262386
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit d7436a37ff.
Restores old file order in gpu.gni until Mac/Metal issue can be
debugged.
Change-Id: I6e2ee3bdc3b39270aeaaf28b9613e4ac49d38e1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262801
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
One option for fixing bilerp asserts is just to commit to clamping its
output. Will write up another option that I think mirrors the GPU
backend more closely as a patch on top of this CL.
Few minor things here too:
- Use clamp() more now that we have it.
- Update assert_true() calls to print out the interesting value
instead of the condition.
- Clamp alpha before rgb for clarity in the case we're clamping rgb
to that clamped alpha. Either order actually works, but this order
is more obviously correct.
Change-Id: I8f05834fd862ba8bb45b961e01563af091232c95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262811
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
- Add instruction numbers to program dumps.
- Dump the program when an assertion fails,
and print the failing condition or an optional
other value (e.g. if alpha outside [0,1], print alpha).
With all that and the new commented assert enabled, I'm seeing that
sometimes we get a bilerp alpha of 0x3f800001, just a little more than
1.0f. Fix still tbd.
Change-Id: I2c20e41ae370d8cd2963e2dbf0fd91aa0fd50061
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262808
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Devices receive the 4x4, but by default they simply downsample it to SkMatrix.
New SkM44 matrix for the impl. It differs from SkMatrix44 in a few ways
- no tracking of "type"
- faster for concat, as it does not use doubles for intermediates
- much simpler API
There are some low-bit differences in some gms, so adding a flag for clients to
stage this change. (due to faster but lower-precision in SkM44::concat)
Performance: running canvas_matrix bench
3x3 version:
167.93 canvas_matrix_3x3 8888
209.97 canvas_matrix_2x3 8888
174.87 canvas_matrix_scale 8888
135.30 canvas_matrix_trans 8888
4x4 version:
116.59 canvas_matrix_3x3 8888
105.40 canvas_matrix_2x3 8888
159.83 ? canvas_matrix_scale 8888
113.47 canvas_matrix_trans 8888
Why faster?
- not tracking matrix_type helps a lot it seems
- faster full concat (no doubles)
Before adding the specialized preConcats...
318.11 ? canvas_matrix_3x3 8888
339.38 canvas_matrix_2x3 8888
383.28 canvas_matrix_scale 8888
251.67 canvas_matrix_trans 8888
Change-Id: I68eac942919fa5418081e789f31710a1e2a752da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262056
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Motivation: this will let me add dependencies without breaking clients.
Change-Id: I70b71c08b0a902b2b7e6fc160c63dc3afdeb7de5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262806
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Tweaking SkVM.h requires ~550 build steps because SkShaderBase.h
includes it. By switching that to forward declarations of the types
using SkVM_fwd.h, it's down to ~15. Big deal for laptop productivity.
Change-Id: Ide5cc776b8a0c6fa6473cf5f43acabdf566e8808
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262860
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
- Add fract(), clamp().
- Refactor sampling to support bilerp and bicubic,
with bicubic left as an easy follow up.
I _think_ this is failing asserts that we left alpha in [0,1]. For now
I've opted bilerp into the same clamp that bicubic will need eventually.
Will follow up to remove bilerp clamp... we shouldn't need that to my
knowledge. On the other hand, this is the first time we ever check.
Cq-Inlcude-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_SKVM_BLITTER
Change-Id: I74e3e3c5fb5cda200f704f1e84ac1d01653b2f09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262782
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Change-Id: Icf81d2fd50e060e9e9ca2876f5ed7192d0d18d7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258885
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
Auto-Submit: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
This reverts commit 90673ec665.
Reason for revert: Causes metal bot failures
Original change's description:
> Rename GrSimpleTextureEffect->GrTextureEffect
>
> It will become less simple.
>
> Change-Id: I409d0faba386597ae05738273d5ff773501eb358
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262383
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: Id25c9cde3c2048149409745f163e42c588de70c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262514
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
It's not that useful now that we're drawing real stuff,
and kind of annoying to keep updating its Fade shader.
Change-Id: Ie8252b9a189bd38b150647e4a93b66b765c7ef97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262536
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
We'll need something like this to extend the lifetime of our
SkBitmapController::State (and the bitmap and mipmaps it holds)
to match the lifetime of the blitter. This is particularly
important particularly for kMedium where we're not sampling off
the original image.
Not sure which other effects will need this sort of thing, if any.
I think gradients would just write the colors directly into uniforms.
Change-Id: Idefe620f88113ed436e04a101195b27aec1230db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262522
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
1031d2c65b..51e653f03f
git log 1031d2c65b5e..51e653f03f26 --date=short --first-parent --format='%ad %ae %s'
2020-01-07 shrekshao@google.com Suppress flaky failure with MacOS/NVIDIA/OPENGL
2020-01-07 j.vigil@samsung.com EGL: Implement EGL_ANDROID_framebuffer_target
2020-01-06 courtneygo@google.com Vulkan: Update dEQP source for test fixes
2020-01-06 syoussefi@chromium.org Vulkan: No line raster emulation code if extension
2020-01-06 syoussefi@chromium.org GL: Enable EXT_gpu_shader5
2020-01-06 flibitijibibo@gmail.com Fix UWP build
2020-01-06 ericbinet@google.com Add missing steps in DevSetup
2020-01-06 flibitijibibo@gmail.com Fix GGP build
2020-01-06 lehoangq@gmail.com Metal: fix vertex attribute's conversion lost after changing buffer binding.
2020-01-06 j.vigil@samsung.com update date comments to 2020
Created with:
gclient setdep -r third_party/externals/angle2@51e653f03f26
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 jvanverth@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/+/master/autoroll/README.md
Cq-Include-Trybots: skia/skia.primary:Build-Debian9-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: None
Tbr: jvanverth@google.com
Change-Id: Ia2fc172bacb133d1be1e0152d89ed7a660ea762c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262547
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).
More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
depot_tools:
https://crrev.com/1961043388e63c48946322de077bebbb333fde6a Revert "Move httplib2 import above third_party." (ehmaldonado@chromium.org)
TBR=borenet@google.com
Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: Ic45454ce1e53fc3c8234b2f76d54b64cc0b3877f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262511
Reviewed-by: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).
More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
depot_tools:
https://crrev.com/fa40bfa39bf0399570558e24bd3f8680a8130ac2 Update "git cl format --python" to default to PEP-8 (agrieve@google.com)
TBR=borenet@google.com
Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: I323c66981e556d17a739253c8b496fd27f3fd76c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262509
Reviewed-by: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).
More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
depot_tools:
https://crrev.com/cd1331ea69ccdfcecc6ab07eee8ffaf21824a7c6 Move httplib2 import above third_party. (morchard@google.com)
TBR=borenet@google.com
Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: Ib6de529a7cbae8430c38322032271b71b649063d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262506
Reviewed-by: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
This turns out to be way easier than the SkRP version.
Kinda just does what you'd hope.
Change-Id: I71e404b989f8420a20b0e6c7f11fd29bb7f49f5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262456
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
- Specialize on typical matrix types.
- Expand image formats to match what SkVMBlitter can draw to.
- Add floor() and abs(), and use them for repeat and mirror.
Change-Id: Ieab539681f5f9fddf1617bb72405ed54fa42de4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262439
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
If doRegen is called and fCurrGlyph > 0, this implies that the previous call
to doRegen exited early on a code == GrDrawOpAtlas::ErrorCode::kTryAgain.
We can calculate brokenRun directly from the fact doRegen is called with
fCurrGlyph > 0.
Change-Id: I1ee7b88e59708ae329c2204c1d7779a295cd9d33
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262378
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
It will become less simple.
Change-Id: I409d0faba386597ae05738273d5ff773501eb358
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262383
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Clean up the control flow, to try to see the invariants more clearly.
Change-Id: Ie07090950650166e99dff334e85189fe581a5efe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262235
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Validating that only certain types are allowed as in or uniform.
Change-Id: I941da448bffec06158e67fbf653833846d9fe3db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262222
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Adds workaround for swiftshader bug.
This reverts commit 460b6c1dd8.
Change-Id: I703789c9754fed3ecbf65a08b509cb1fc0013415
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262377
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Basic support for clamp/clamp/nearest/RGBA-8888/premul images.
A couple little changes to make this work:
- add pixel-center offset to shader (x,y)
- change the signature of gather??() calls to work
more naturally with how we let effects build uniforms.
Instead of gathering directly from one of the program
arguments, load the gather base pointer off another
uniforms pointer, just like any other uniform.
- remove the default argument to uniform??() so that
they parallel the new gather??() calls more closely.
There was only one place that was using the default
and I think it's clearer as an explicit 0 offset.
- centralize some more helpers onto skvm::Builder so
we can use the in both SkVMBlitter and SkImageShader.
Some diffs:
- very, very small color diffs probably due to slightly
different math converting between byte and float or blending;
- small sampling coordinate diffs where skvm + SkRP agree,
and the legacy shaders disagree. That's fine by me.
Change-Id: I72634e7fed4f13e6cb41b8067104760f392ea3bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262368
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).
More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
depot_tools:
https://crrev.com/a81450253f8880c27e2859f271fa6fe00c6c7104 depot_tools: Use mock from vpython (or unittest.mock) instead of third_party/mock (ehmaldonado@google.com)
TBR=borenet@google.com
Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: Ib28607c0206a632641312b0b9ffc896527681b9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262376
Reviewed-by: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Change-Id: Icbe887266d201bc6d64555f0e793765bf641e4b6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262230
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Client code has been migrated to SkRuntimeEffect.
Change-Id: Ied7d7bdf2a4e2bc1b9547fa5284a0b0a938c034f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262143
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Copies the function wholesale so it can be reused by other tooling
code.
Change-Id: I8b8f8ceb7dabb12e9e67b8339735f618dc2ccf2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262348
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
We were previously building FreeType2 with the psnames module,
which included large tables of glyphnames [1]. These were only
used in code related to PDF (and only when outputting Type 1
fonts, which is very rare).
Even though the PDF backend isn't in CanvasKit, the compiler
couldn't throw away these massive tables (about 80k in all)
of strings. Since these tables were only used for T1 fonts,
it made sense to tell FreeType not to include the rest of the
T1 related code, which saved about 55k more.
If, one day, we add in support for the PDF backend to CanvasKit,
SK_PDF_DO_NOT_SUPPORT_TYPE_1_FONTS is likely something we'll
want to define.
The roll-freetype.sh is inspired by a script of the same name
in the Chromium repo and aids in the updating of freetype
and our forked config files.
[1] 0a3d2bb99b/src/psnames/pstables.h (629)
Bug: skia:9733
Change-Id: I359bab4184587cbe91400661fb012eac1a601a83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262232
Reviewed-by: Ben Wagner <bungeman@google.com>
This saves about 32kb uncompressed, 21kb gzipped from CanvasKit.
This would also save about 11kb from a Flutter build.
Bug: skia:9733
Change-Id: I0a21b7279a73c692ea39aa28ac00d70d24b70373
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262218
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Change-Id: I0d6dd3625a8571c09af7557b1727812bba2a9ee4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262355
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Cap size of draws by vertex buffer size.
Remove size limit in combining since we now enforce a limit
when preparing draws. (This limit wasn't effective in bug
repro scenario as the large number of glyphs are in a single
run).
Fix another bug discovered along the way: We increase the
number of proxies in a FixedDynamicState after having recorded
draws. However, the draws take refs on the proxies in FDS and
unref them when destroyed. By adding the proxies late we cause
the ref count to underflow. (This needs a more systematic fix
outside the scope of this change).
Bug: chromium:1018511
Change-Id: I79fe446d97c573196653a18792462bd46b9ac4c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262001
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Most interesting thing is that we can use SkColorFilterShader with a
no-op color filter to apply alpha after the shader. We added that
feature to allow us to fold color filters into the shader, but it works
equally well to fold in alpha too.
The rest is basically deleting TODOs as unimportant.
Change-Id: Ib572d2f37b74ef1093c1e99ddee3642d4cfa5a76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262344
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>