Commit Graph

4774 Commits

Author SHA1 Message Date
Brian Salomon
49721c8437 Revert changes to unbreak bots.
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>
2020-11-03 18:52:45 +00:00
Brian Salomon
b2c42140ea GrRefCntedCallback has Make function.
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>
2020-11-03 16:49:12 +00:00
Brian Salomon
f01a9d9020 Add SkImage::MakeFromYUVATexturesCopyToExternal
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>
2020-11-03 15:03:21 +00:00
Kevin Lubick
dffd20efe9 [canvaskit] Add unit tests to wasm_gm_tests
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>
2020-11-02 16:51:23 +00:00
Herb Derby
c76d4096af add API for Op creation
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>
2020-10-26 18:51:15 +00:00
Jim Van Verth
7c64798b3d Add control to toggle immediate/delayed MTLDrawable acquisition
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>
2020-10-23 17:30:15 +00:00
Kevin Lubick
acdc283404 [canvaskit] Use portable fonts for GMs
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>
2020-10-23 17:04:48 +00:00
Kevin Lubick
65674e4c2e [canvaskit] Compile in most gms for testing
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>
2020-10-22 16:44:07 +00:00
Kevin Lubick
bffc116a4a [canvaskit] Load resources into wasm gms/unit tests.
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>
2020-10-21 20:40:29 +00:00
Mike Klein
c49da0b519 upstream cl/337571894 with tweaks
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>
2020-10-20 16:22:01 +00:00
Adlai Holler
b270568f29 Almost remove GrContext
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>
2020-10-20 15:52:01 +00:00
Kevin Lubick
cd74dfa477 [canvaskit] Add test harness for running all gms and getting output
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>
2020-10-20 11:54:23 +00:00
Greg Daniel
a670782ed3 Update GrAttachment budgeted and gpu memory size calculation.
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>
2020-10-19 17:54:10 +00:00
Brian Salomon
c1a249d1dc Revert "Revert "New variant of SkImage::MakeFromYUVATextures.""
This reverts commit be8004d2fb.

Bug: skia:10632
Change-Id: I52dd36ae167623563c7554c40092442a3822ee3c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327760
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-19 15:37:29 +00:00
Florin Malita
a5e8f6b402 [svg] Post-relocation cleanup
Remove transitional headers and build file workarounds.

Change-Id: Iebe63d44b6ae3a736c7b31a45975056ec92b91cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327716
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-10-18 19:29:38 +00:00
Brian Salomon
be8004d2fb Revert "New variant of SkImage::MakeFromYUVATextures."
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>
2020-10-16 22:32:54 +00:00
Brian Salomon
fea12238ed 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>
2020-10-16 21:03:31 +00:00
Mike Klein
8aa0edfed2 move SkTPin to include/private
Change-Id: Ib0dc823d331a7cddc5da1d1be83136ce803a7871
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327783
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-10-16 19:45:11 +00:00
Brian Salomon
6c11ba2334 fix always true comparison in assert
Bug: skia:10632
Change-Id: I271875a73b7e80a3ef5ea357eab7c8165440e7a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327718
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-16 15:54:02 +00:00
Brian Salomon
7db7139f40 Revert "Revert "Move all YUVA image creation in GMs into sk_gpu_test::LazyYUVImage.""
This reverts commit 839fb228ac.

Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian10-Clang-arm-Debug-Chromebook_GLES
Bug: skia:10632
Change-Id: I7c9fc21f03dfd0537fed6074e550dd8a500a12b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327623
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-10-16 14:58:13 +00:00
Tyler Denniston
acafbe8721 Reland "Add subset of W3C test suite to SVG corpus"
This reverts commit 7767a269f8.

Reason for revert: removing bad SVGs from parse tests

Original change's description:
> Revert "Add subset of W3C test suite to SVG corpus"
>
> This reverts commit f761a8c1e5.
>
> Reason for revert: breaking some CPU bots due to parse errors
>
> Original change's description:
> > Add subset of W3C test suite to SVG corpus
> >
> > Bug: skia:10845
> > Change-Id: I5a98f4f50f3f507b01d847464d21926705134354
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327199
> > Auto-Submit: Tyler Denniston <tdenniston@google.com>
> > Commit-Queue: Tyler Denniston <tdenniston@google.com>
> > Reviewed-by: Kevin Lubick <kjlubick@google.com>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Ravi Mistry <rmistry@google.com>
>
> TBR=rmistry@google.com,kjlubick@google.com,fmalita@chromium.org,fmalita@google.com,tdenniston@google.com
>
> Change-Id: I0235f43b512c0f3baa0cd069479712cf885a14b9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10845
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327377
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>

TBR=rmistry@google.com,kjlubick@google.com,fmalita@chromium.org,fmalita@google.com,tdenniston@google.com

# Not skipping CQ checks because this is a reland.

Bug: skia:10845
Change-Id: If55b984e47712ee8e4ff84bf691c1dce997f17c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327621
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-10-16 14:54:43 +00:00
Brian Salomon
839fb228ac Revert "Move all YUVA image creation in GMs into sk_gpu_test::LazyYUVImage."
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>
2020-10-16 13:37:43 +00:00
Brian Salomon
db0288d747 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>
2020-10-16 13:19:01 +00:00
Florin Malita
b3418103e9 Reland "[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.

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>
2020-10-16 02:32:41 +00:00
Tyler Denniston
7767a269f8 Revert "Add subset of W3C test suite to SVG corpus"
This reverts commit f761a8c1e5.

Reason for revert: breaking some CPU bots due to parse errors

Original change's description:
> Add subset of W3C test suite to SVG corpus
>
> Bug: skia:10845
> Change-Id: I5a98f4f50f3f507b01d847464d21926705134354
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327199
> Auto-Submit: Tyler Denniston <tdenniston@google.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Ravi Mistry <rmistry@google.com>

TBR=rmistry@google.com,kjlubick@google.com,fmalita@chromium.org,fmalita@google.com,tdenniston@google.com

Change-Id: I0235f43b512c0f3baa0cd069479712cf885a14b9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10845
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327377
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-10-15 21:13:49 +00:00
Tyler Denniston
f761a8c1e5 Add subset of W3C test suite to SVG corpus
Bug: skia:10845
Change-Id: I5a98f4f50f3f507b01d847464d21926705134354
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327199
Auto-Submit: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2020-10-15 19:27:56 +00:00
Robert Phillips
d6cf56fd34 Revert "[svg] Relocate out of experimental"
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>
2020-10-15 18:54:18 +00:00
Brian Salomon
5b67c4d136 Ref GrDirectContext in MakeBackendRenderTargetSurface
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>
2020-10-15 15:40:56 +00:00
Florin Malita
6fc4106a9d [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>
2020-10-15 14:36:06 +00:00
John Stiles
f4bda743ff Rename SkTArray::reserve to reserve_back.
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>
2020-10-14 21:42:11 +00:00
Robert Phillips
3172208ad0 Revert "Remove GrContext"
This reverts commit 2edf18d818.

Reason for revert: breaking wasm-debugger

Original change's description:
> Remove GrContext
>
> Woo!
>
> Change-Id: Ifa3ff7e79c7048c2f1d808cc9705593d72886f08
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326436
> Auto-Submit: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com

Change-Id: Ie05bda5dad7fb5d369ebe579d2e009fdb99c0729
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326941
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-14 18:30:13 +00:00
Adlai Holler
2edf18d818 Remove GrContext
Woo!

Change-Id: Ifa3ff7e79c7048c2f1d808cc9705593d72886f08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326436
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-10-14 17:47:31 +00:00
Adlai Holler
a069304560 Rename GrContextPriv to GrDirectContextPriv
Change-Id: I3fccadd8a2860dbee73f93f995738146373f8a39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326196
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-14 16:46:01 +00:00
Adlai Holler
53cf44cfaf Migrate GrContextPriv & ivars to GrDirectContext
After this, GrContextPriv gets renamed and GrContext gets removed.

Change-Id: I49b034e4669876becb50b93c5fe3af887481e1ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326158
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-10-14 14:32:49 +00:00
Florin Malita
367ed49661 Fix skottie2movie post https://skia-review.googlesource.com/c/skia/+/325618
TBR=

Change-Id: Iec74270e135d1ad5a5be6ea51ceeb802e101e4d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326358
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2020-10-13 17:35:30 +00:00
Brian Salomon
7205080055 Revert "Reland "Revert "Use ManagedBackendTexture in place of TestUtils backend texture helpers."""
This reverts commit 4efaf5e9fe.

Cq-Include-Trybots: luci.skia.skia.primary:Test-Win10-MSVC-Golo-GPU-QuadroP400-x86_64-Debug-All-Direct3D,Test-Win10-Clang-ShuttleA-GPU-RadeonHD7770-x86_64-Debug-All-Direct3D
Change-Id: I0f5f1c427e8892a67b027b0fbe4863d9fcee2363
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325863
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-13 01:22:13 +00:00
Brian Salomon
4efaf5e9fe Reland "Revert "Use ManagedBackendTexture in place of TestUtils backend texture helpers.""
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>
2020-10-12 22:16:13 +00:00
Brian Salomon
21f8b51099 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>
2020-10-12 19:30:43 +00:00
Brian Salomon
f625e4ce45 Revert "Use ManagedBackendTexture in place of TestUtils backend texture helpers."
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>
2020-10-12 16:19:49 +00:00
Brian Salomon
5ee0556048 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>
2020-10-12 15:28:52 +00:00
Chris Dalton
61003cde76 Add support for WEBGL_multi_draw_instanced_base_vertex_base_instance
Bug: skia:10419
Change-Id: I82238c3115daa0c1879fe18a8f8af8199194be80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319936
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-10-09 22:12:03 +00:00
Brian Salomon
e4e0aad937 VulkanWindowContext uses sample-able swap VkImages when available.
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>
2020-10-09 21:53:43 +00:00
Greg Daniel
f52bca1069 Suppress another version of the vulkan validation error.
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>
2020-10-09 17:27:33 +00:00
Greg Daniel
e70a30d46f Suppress vulkan validation layers bug.
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>
2020-10-09 15:37:54 +00:00
Brian Salomon
f9b0042423 Expose ManagedBackendTexture from BackendTextureImageFactory.
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>
2020-10-08 20:35:32 +00:00
Adlai Holler
1fc76ce6ff Migrate more Android & SkSurface API off GrContext
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>
2020-10-08 18:32:32 +00:00
Kevin Lubick
0039874105 [canvaskit] POC bindings for testing gms
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>
2020-10-08 16:03:08 +00:00
Kevin Lubick
8d43858ed2 [canvaskit] Update jsfiddle links and fix renderSKP
Leftover API changes from removing Sk.

Bug: skia:10717
Change-Id: I5b3ab4b5e20212e734558437090600cf6387410c
Docs-Preview: https://skia.org/?cl=323886
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323886
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-10-08 12:51:15 +00:00
Kevin Lubick
54c1b3dd43 [canvaskit] Remove Sk from nearly all function/type names.
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>
2020-10-07 21:01:32 +00:00
Mike Klein
989f5bfb8f refactor HashAndEncode
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>
2020-10-07 16:13:13 +00:00