We no longer support MoltenVK, so we can't render using Vulkan on Mac,
but this change allows Macs with the SDK installed to compile Vulkan
code and use SPIRV-Tools.
Change-Id: I5baaf80de259e406495002a5fbfec89dbd1357b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336678
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
In follow on CLs we need to know what the load op is when we try to use
discardable msaa attachments. For vulkan the load op affects how we
copy the resolve attachment into the msaa attachment, which changes the
render pass we use (adds extra subpass). We need to be able to make a
compatible render pass to compile programs.
Bug: skia:10979
Change-Id: I40c23a18b251af6a2ad3b78a1f6382bdba0b90c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336598
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
The important part is in GrOpFlushState.h were previously
we were taking a mutable pointer to the view, which should
at least be a const pointer and was making us do funky things
in some of the calling code. But I decided to go all the way
and do a const ref instead which is The Way It Should Be (tm).
Change-Id: I399d102e8b5e0a5059168cc450ae66f12ad47e13
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336451
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
... rather than allocating an extra "result" array.
This CL also changes the sort algorithm to soldier on even after
it has found a loop.
Change-Id: I03fe8da1aade6c9461eb42e1b7d79fae562210f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335824
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Currently only in IOS, makes the iOS app more background-friendly
and sets up for storing Metal context state.
Bug: skia:10804
Change-Id: I267cfad2bf78b1691fe71986716d2986729dd237
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334678
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
The deprecated ones can be removed when the polymer debugger is gone.
Change-Id: I351f1c691d7a95fea594c7e001f9b16c15d216a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334160
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Makes the Metal backend more consistent with the other backends,
and allows new init parameters to be added without significantly
changing API.
Added updated sk_cf_obj because I needed some of its functionality.
Bug: skia:10804
Change-Id: I6f1dd1c03ddc4c4b702ea75eff14bc0f98ab5ad2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334426
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
MASK_FORMAT_UNKNOWN was shared state between glyphs, and
SkScalerContext making hard to reason about.
Change-Id: Ifb70bcc288bc46905de5f2c32891c940a0b2a11f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334157
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Drawing to a Premul Raster Surface and then copying out Unpremul pixels
was 15x slower. Drawing to an Unpremul Raster surface was a little
slower than the previous RasterDirect surface.
Out of an abundance of caution, I'm going back to the way things were.
We can revisit drawing to a Raster surface in the future.
This also adds better error handling to the SkottieFrames test which
thankfully caught this regression.
Bug: skia:10717
Change-Id: Ib8b9d490c92e013c3311adb1d08de5fa0fc0351c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334356
Reviewed-by: Kevin Lubick <kjlubick@google.com>
I keep getting blocked when I try to zoom in on strokes. I don't think
we need to limit zooming in our test app; the "tap to reset" feature
works very well if we get lost.
Change-Id: Icf2b364b94128512f7117299b607131c5065cc36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333656
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
- We were using the wrong keycodes for letters, so we never triggered
undo/redo/copy/paste in response to Ctrl+Letter combos.
- ImGui comes with system clipboard support on Windows and Mac, but not
UNIX/Linux. I added a bare bones X11 implementation, enough to support
copying and pasting text in and out of the ImGui text windows. There
is a bit of a delay when pasting to another program, probably because
we're not running a dedicated thread to handle those events. It looks
like we get a flurry of events before the real SelectionRequest.
- Note that this leaves the virtual clipboard functions on Window only
implemented for UNIX. We could supply our own copies for Win/Mac and
other platforms, if anyone really cares.
Change-Id: I2701e077ff2b6dff5ae3c5127c24b0937b893c89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334049
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Introduce a Builder helper and plumb the client-provided SkFontMgr for
font resolution.
Also clean up some of the legacy SkSVGDom factories.
Bug: skia:10840
Change-Id: I6e1eabe7c257cb75dfdb5bf67054f93f25769027
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333577
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
This isn't hooked up anywhere but breaks up the omnibus CL.
Change-Id: I15c200e57450e7cc8ee95a3f7969926d0eb8487f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333129
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Remove done and release distinction. Chrome is not using either as
it tracks texture access using other synchronization mechanisms
(semaphores, flush finish procs). Now there is just fulfill and release
where release is called when the texture can be deleted. Also,
release proc can be null.
Simplify texture idle mechanism as the "flushed" state was only used to
implement the old idea of a release proc. The "finished" idle state is
still used to implement the new release proc. Though, it could also be
removed if GrTexture were to be removed for textures returned by fulfill.
Not directly tied to this bug, but a new YUVA factory will be required
and it's good to clean things up first to avoid adding another
instance of the current complexity.
Bug: skia:10632
Change-Id: I4fe3c0af3f5a591506b1b3c736fd3284a38465a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331836
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Failing with RuntimeError: function signature mismatch
Bug: skia:10869
Change-Id: Ifd2f78362e2fd30b1c53be56a811551974e3cac3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333119
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Makes it more sensible.
A bunch of call sites we're already written to expect this. Update
some others.
Change-Id: I77c28045ebf01e6aa9d92d2ebc37287604ec10c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332544
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
The previous behavior leaked Skia-internal concepts into public SkSL.
Users coming from GLSL will expect that bindable/sampleable objects are
uniform (just like texture2D). This keeps the old support around (and
tested), but updates all of our examples to use 'uniform'.
Bug: skia:10679
Change-Id: I0c98162f5e21dad7014d9778ceb26143d2f6030e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332376
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Change-Id: If4f614510b3d2a5802e87350b8f09797d9c52c96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332036
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
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>