f01a9d9020
is the culprit
Revert "GrRefCntedCallback has Make function."
This reverts commit b2c42140ea.
Revert "Add SkImage::MakeFromYUVATexturesCopyToExternal"
This reverts commit f01a9d9020.
Bug: skia:10632
Change-Id: Ief076f168b63ff8ca15b607163a13d5f52a733d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331798
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Each caller does not need to check for null function.
Also inherit from SkNVRefCnt.
Change-Id: I9a53c3c8e9dec1361db6cfb21b97d178173b23ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331490
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Updated API for creating a RGBA texture-backed image from RGBA texture
planes with user-provided backing store using GrYUVABackendTextures.
Ultimately we would like to remove all such APIs and have the client
make a SkSurface and draw a YUVA texture image to the surface but
a recent attempt to do that in Chrome caused a not yet understood
perf regression.
Add wacky_yuv_formats variation that tests new api.
Bug: skia:10632
Change-Id: I89411216948682f13281a91a7575d5f345badda7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329956
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
There are currently many tests skipped, but many more pass.
This changes the built binary to have a lot of debugging logic
in it so we should be able to get backtraces on those crashes
more easily when debugging.
gmtests.html was removed as it was superceded by run-wasm-gm-tests
and make run_local.
Bug: skia:10812, skia:10869
Change-Id: I72ab34d3db83a654dc8829831b3ecb795fe23d43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329170
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Introduce three calls on GrOp: Make, MakeWithExtraMemory,
and MakeWithProcessorSet. Instead of returning
unique_ptr<GrOp>, they return a type of GrOp::OpOwner.
GrOp::OpOwner safely deletes the op when it goes out
of scope for either new/delete or GrOpMemoryPool
allocations.
In order to make the code easier to refactor, I
eliminated MakeArg from the helpers.
Change-Id: Icfd697906f3147a8734575d08bd7195e7517383a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323778
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Change-Id: Ia1b57dc4af65e7625659c147077b5e47b09b6b62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329178
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This adds an Init() which should be called before any resources
are loaded or GMs/Tests are called.
This also adds a little helper in compile.sh for building only
a single GM, which can make local development faster given the
fact that emsdk doesn't do its final compilation/linking in
parallel.
Bug: skia:10812
Change-Id: I1a8932549b9ae951c153c0d49927bdc933c29657
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329358
Reviewed-by: Ben Wagner <bungeman@google.com>
The few we omit fail to compile or link.
Bug: skia:10812
Change-Id: I660d64b6f9bfe63949a12506d29e9a8d73898e6b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328377
Reviewed-by: Chris Dalton <csmartdalton@google.com>
To load in the resources, we have the Node JS script
find all files in the provided resources directory and serve
that as a JSON file (the HTML JS can't list files easily).
The HTML JS reads that file, then loads all those files as
ArrayBuffers.
After the testing WASM and the resources all load, we pre-load
them into the WASM memory, assigned with their name. This is
just a map of name -> SkData. The WASM code can't (easily)
make fetch calls, so rather than load these resources on demand
like we would in a real file system, we pre-load them all
and serve them from RAM. For simplicity (and consistency with
the known_hashes), this map is a global.
Finally, to connect the resources to the GMs, we overwrite the
gResourceFactory (defined in ResourceFactory.h) which is used
by tools/Resources.cpp to load any resource file (in theory).
One more change is to write some progress steps to window._log
so it can be read by puppeteer and dumped to disk to aid in
debugging.
Bug: skia:10812
Change-Id: Ie22c7f4b8d7cbbd18173b4e2ed755105c1b45249
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328901
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Seems harmless to fall back to other SetupCrashHandler() options.
Change-Id: I2e7ce5dd72f391af88a57f4bd29831122fe784b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327893
Reviewed-by: Peter Foley <pefoley@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This is everything except for literally removing the class.
Change-Id: I2f16caf865d1bcf9c0f267aed73313c0676a73bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327222
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
The JS starts a web server and then uses puppeteer to load the html
page. The page will load the compiled JS+WASM to run the GMs,
calculate the md5 hash of the pixels using the exact same algorithm
as DM and then get those encoded as a PNG. The HTML then makes
a post request with that image data (assuming it's not an image we
have seen before) and keeps all the test results in a simple
JSON array.
The JSON array will be read in by a task driver in a followup CL.
Bug: skia:10812
Change-Id: I90e8ed42bd96ae11fa75ce84ef2ee1a97ab93d5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328378
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
This adds the budgeted parameter to the GrAttachment ctors. Currently
we only have stencil and msaa attachments which are always budgeted
but this will soon change as more things get added.
Along the same lines this fixes the gpu memory size calculate on
render target. The msaa attachment was getting double counted in
the RT and the attachment itself.
Bug: skia:10727
Change-Id: I3520de9627eadaa4074f7425df509a6c1ccbe07f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327337
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This reverts commit fea12238ed.
Reason for revert: MSAN/SwiftShader failure
Original change's description:
> New variant of SkImage::MakeFromYUVATextures.
>
> Takes a new type GrYUVATextures. This a set of GrBackendTextures and
> SkYUVAInfo that have been pre-validated to be compatible.
>
> Bug: skia:10632
>
> Change-Id: Id252f8662ede0f268e88fd40dc1b0b8f4ab6345f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317762
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: I5350d4f9b1eda0503fb0af9db8575a734bdc811f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327922
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Takes a new type GrYUVATextures. This a set of GrBackendTextures and
SkYUVAInfo that have been pre-validated to be compatible.
Bug: skia:10632
Change-Id: Id252f8662ede0f268e88fd40dc1b0b8f4ab6345f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317762
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit db0288d747.
Reason for revert: undeclared tuple size
Original change's description:
> Move all YUVA image creation in GMs into sk_gpu_test::LazyYUVImage.
>
> LazyYUVImage now supports making images from a generator and from
> textures. It uses ManagedBackendTexture to manage texture plane
> lifetime via ref-counting.
>
> Adds some supporting utility functions to SkYUVAInfo and
> SkYUVAPixmaps.
>
> Eases transition of forthcoming MakeFromYUVATextures API change.
>
> Bug: skia:10632
>
> Change-Id: I8cfd747c27076d1627da6ea8a169e554a96049e0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326720
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: Icdfb70f7dadd97eace8f88d5a886d31534102f5f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327622
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
LazyYUVImage now supports making images from a generator and from
textures. It uses ManagedBackendTexture to manage texture plane
lifetime via ref-counting.
Adds some supporting utility functions to SkYUVAInfo and
SkYUVAPixmaps.
Eases transition of forthcoming MakeFromYUVATextures API change.
Bug: skia:10632
Change-Id: I8cfd747c27076d1627da6ea8a169e554a96049e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326720
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Move the SVG rendering code to modules/svg, and componentize.
Also split into include/src/utils.
As external clients still reference the old header locations,
introduce temporary forwarding headers to facilitate the migration.
This reverts commit d6cf56fd34.
TBR=
Change-Id: Ibadd7c8dc0464ec0c27841530ade0c2098305d20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327344
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
This reverts commit 6fc4106a9d.
Reason for revert: Blocking the Android roll
Original change's description:
> [svg] Relocate out of experimental
>
> Move the SVG rendering code to modules/svg, and componentize.
> Also split into include/src/utils.
>
> As external clients still reference the old header locations,
> introduce temporary forwarding headers to facilitate the migration.
>
> Change-Id: Ib289dbdcd80c16a01c47805e7242f2e08bebc165
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326948
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>
TBR=fmalita@chromium.org,fmalita@google.com,tdenniston@google.com
Change-Id: I386cf77a15a9e1d392029804abaf937dae53f435
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327342
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Fixes crashes when running vkbert config where we tear down a Vulkan
GrDirectContext before deleting the backing store of a SkSurface
created via MakeBackendRenderTargetSurface.
Bug: skia:10843
Change-Id: I99ea2266ba14325d3aaac5ee59aa712688fb9329
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327196
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Move the SVG rendering code to modules/svg, and componentize.
Also split into include/src/utils.
As external clients still reference the old header locations,
introduce temporary forwarding headers to facilitate the migration.
Change-Id: Ib289dbdcd80c16a01c47805e7242f2e08bebc165
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326948
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
The semantics of `vector::reserve` and `SkTArray::reserve` were not the
same. SkTArray::reserve takes a delta over the current array size,
whereas vector takes a total array size. This could lead to subtle
errors with over- or under-reservation, hurting performance.
This CL renames `SkTArray::reserve` to `SkTArray::reserve_back` to give
the SkTArray behavior a distinct (hopefully easily understandable) name,
leaving its functionality as-is.
Change-Id: Icbd3114bb317fd5f307f393c02ae6fb6f83764e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326956
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit 21f8b51099.
Reason for revert: D3D traced resource assert from unit test
Original change's description:
> Revert "Revert "Use ManagedBackendTexture in place of TestUtils backend texture helpers.""
>
> This reverts commit f625e4ce45.
>
> Change-Id: Id73c53ec7ab8d4a5951712dc150d86e6349addbf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325658
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,bsalomon@google.com
# Not skipping CQ checks because this is a reland.
Change-Id: I407f1d522d5c4f28d070cc2ce87af7faffca11fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325860
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 5ee0556048.
Reason for revert: breaking bots
Original change's description:
> Use ManagedBackendTexture in place of TestUtils backend texture helpers.
>
> Unify on a single family of helpers for making backend textures.
>
> Stresses callback systems in more tests by avoiding artificial
> flush/submit/syncs.
>
> some misc test cleanup along the way.
>
> Change-Id: Ia692e8927ba97b391ee77ea06ebf437a555617b2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324710
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com
Change-Id: I7d4fc9412c870ae13f7498671379b871dbf5a6c4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325619
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Unify on a single family of helpers for making backend textures.
Stresses callback systems in more tests by avoiding artificial
flush/submit/syncs.
some misc test cleanup along the way.
Change-Id: Ia692e8927ba97b391ee77ea06ebf437a555617b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324710
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
MSAA now requires this.
Removes last use of SkSurface::MakeFromBackendTextureAsRenderTarget.
Bug: skia:9832
Change-Id: I2837aa0dd9e2cc999c5aac194816777bca477abe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324889
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Need the indexed version of the draw as well
Change-Id: I0b11687be1bb6126d963eb6ce99879525df2603f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324697
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>
This is a bug in the layers related to input attachments.
Change-Id: I1e44c45ce44bea79e7078836150237a6c63cbb36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324625
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Add helper to create self-managed BackendTexture-backed SkSurface for
tests using MBET.
GrGpu::createTestingOnlyBackendRenderTarget supports protected.
Make SkSurfaceCharacterization tests use self-managed SkSurface
factories and a use case of MakeFromBackendTextureAsRenderTarget is
removed.
Use self-managed BackendTexture-backed SkSurface factory in DM sinks and
in fm.
Bug: skia:9832
Change-Id: I0c1dc49697f8b3c942864e18b9112a3552f431ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323559
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Migration should be free because (1) the non-Android API is
only loosening up to GrRecordingContext and (2) the Android API
can only see GrContext through including GrDirectContext.h
Change-Id: I97aa75baba0b0969361db6eaef9f83ea94183700
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323557
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
In this CL, I forked compile.sh and created a new gm_bindings.cpp.
I also moved viewer.html into wasm_tools and created a gmtests.html
for testing out the bindings locally.
Right now there is only one gm file compiled in. I plan in a followup
CL to have some way to generate the list of cpp files that need to
be compiled in from gms.gni. I was unable to get it to work with
simply linking the lib_gm.gni, probably due to the same issue with
Registry that csmartdalton@ ran into when adding viewer.html
and the associated bindings.
Suggested reviewing order:
- gmtests.html to get a sense of how the test flow works.
- gm_bindings.cpp to make sure I setup the contexts/GMs correctly.
- compile_gm.sh to see how the gms are compiled in.
- The remaining files in any order.
When I tested this locally, the bleed_downscale digest was
exactly the same (pixel for pixel, byte for byte) as a known
digest in Gold, so I'm fairly confident in how things work.
Change-Id: I2babef848ca60f7db74e4adf27b8952a66bdeee1
Bug: skia:10812
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322956
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This is a massive breaking change for all existing users of CanvasKit.
It will be (one of the only) changes in 0.19.0 to make the transition
easier.
Suggested reviewing order:
- index.d.ts (to see type changes). Notice SkPicture still has Sk
prefix, but no other types do (this felt "right" since Sk is
part of the name of the type, but I can be swayed on this).
- canvaskit-wasm-tests.ts
- tests/*.spec.js
- interface.js and helper.js
- html examples
- markdown files
Change-Id: I3b3d3815df2078f986893df3c70101d6248c117d
Docs-Preview: https://skia.org/?cl=322617
Bug: skia:10717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322617
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Encode as PNG to an SkWStream instead of a path.
It's just as natural at the call sites, if not more so,
and is more flexible for environments without a filesystem.
While here, tweak the method names and add some comments.
Change-Id: I8ce9869471fc7e1a0955d51ecb621e76c2e1d4d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323509
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>