Commit Graph

4826 Commits

Author SHA1 Message Date
Brian Osman
91292e9482 Runtime Effects: Support 'uniform shader' (vs. 'in shader')
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>
2020-11-04 22:29:53 +00:00
Greg Daniel
fbc60b7e9e Fix viewer last image and zoomer.
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>
2020-11-03 23:00:22 +00:00
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
Adlai Holler
0ce2c54094 Reland "Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext""
This reverts commit cf43fc6768.

Reason for revert: Fixed g3

Original change's description:
> Revert "Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext""
>
> This reverts commit ff13ffbeac.
>
> Reason for revert: Blink in g3
>
> Original change's description:
> > Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
> >
> > This reverts commit 89bdc90ac8.
> >
> > Reason for revert: Fix metal
> >
> > Original change's description:
> > > Revert "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
> > >
> > > This reverts commit d2daa94ede.
> > >
> > > Reason for revert: Metaru
> > >
> > > Original change's description:
> > > > Take GrContext private, GrDDLContext inherit from GrRecordingContext
> > > >
> > > > Woo!
> > > >
> > > > Change-Id: I8d201b709343dc18cad31ea740575285dd035f35
> > > > Docs-Preview: https://skia.org/?cl=317436
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317436
> > > > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Adlai Holler <adlai@google.com>
> > >
> > > TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
> > >
> > > Change-Id: I9b58dee285fbdc49ebc8e76df5da0fe224cf9787
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318758
> > > Reviewed-by: Adlai Holler <adlai@google.com>
> > > Commit-Queue: Adlai Holler <adlai@google.com>
> >
> > TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
> >
> >
> > Change-Id: Id4b10795193a904cd4ed8c36e60e74abe3b6702a
> > Docs-Preview: https://skia.org/?cl=318759
> > Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac10.15.5-Clang-arm64-Debug-iOS_Metal,Build-Mac-Clang-x86_64-Debug-Metal
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318759
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Adlai Holler <adlai@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
>
> Change-Id: Ib20fe933120d56b72efaec73a0bedec60bc28def
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319184
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Adlai Holler <adlai@google.com>

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


Change-Id: I4f01291f4b3bfbb8fd7dd8cf2bf8415430c3392e
Docs-Preview: https://skia.org/?cl=322437
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322437
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-10-06 18:59:11 +00:00
Brian Salomon
72c7b98ae3 Start removal of tool usage of SkSurface::MakeFromBackendTextureAsRenderTarget.
Adds a new helper that creates a GrBackendRenderTarget using
GrGpu and then wraps it in a SkSurface. Uses the SkSurface
release proc to delete the BERT using GrGpu.

Upgrades GrGpu::createTestingOnlyBackendRenderTarget to create MSAA
buffers.

Updates many tests/tool to call sites to use the helper instead of
SkSurface::MakeFromBackendTextureAsRenderTarget.

Adds syncToCpu bool to SkSurface:: and GrContext::flushAndSubmit.

Bug: skia:9832

Change-Id: I73a8f0ce09dc6523729af0814464c6b6657fda06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293683
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-10-06 16:32:11 +00:00
Ben Wagner
59637dd6f9 Add SkTypeface::getPostScriptName.
Bug: skia:10234
Change-Id: Idfa1261e36174a4b4223b8eb62c872448fc58b14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322680
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-10-06 15:35:06 +00:00
Herb Derby
d6cfe72549 Add flag to switch op allocation to new
Added a flag to switch from using the memory pool to
using new and delete for GrOp allocation.

Just add the following to your gn args.
extra_cflags = [
    "-DGR_OP_ALLOCATE_USE_NEW",
]

Change-Id: Icea4a6df047cff2cd5e50032f0bd4b714a5740d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322625
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-06 15:19:06 +00:00
Ben Wagner
ae4bb98f13 Reland "Remove use of legacy display globals."
This is a reland of c1916c34fe

As it turns out, benches are not always given a canvas.

Original change's description:
> Remove use of legacy display globals.
>
> In the ongoing effort to remove the display globals from Skia, allow
> their use only if SK_LEGACY_SURFACE_PROPS is defined. Do not define this
> in a normal Skia build and remove all use from Skia code.
>
> Change-Id: I9ff550f5db246b9024aac687a1bc01321f1be4c8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319343
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

Change-Id: I61a2ac058fafc99653e3304876cf4b97350dac8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322490
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-10-05 19:13:58 +00:00
Herb Derby
4c3486e6f1 add pixel xl to skpbench
Change-Id: I931292a74e39eb06715ce3dde6a4662474a23df6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322322
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-10-05 18:34:18 +00:00
Jim Van Verth
bd0881cb58 Revert "Remove use of legacy display globals."
This reverts commit c1916c34fe.

Reason for revert: Bots unhappy

Original change's description:
> Remove use of legacy display globals.
>
> In the ongoing effort to remove the display globals from Skia, allow
> their use only if SK_LEGACY_SURFACE_PROPS is defined. Do not define this
> in a normal Skia build and remove all use from Skia code.
>
> Change-Id: I9ff550f5db246b9024aac687a1bc01321f1be4c8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319343
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

TBR=djsollen@google.com,bungeman@google.com,herb@google.com,reed@google.com

Change-Id: I365d2b1d19241a90130bc1b59663651817966f63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322400
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-10-05 16:34:15 +00:00
Ben Wagner
c1916c34fe Remove use of legacy display globals.
In the ongoing effort to remove the display globals from Skia, allow
their use only if SK_LEGACY_SURFACE_PROPS is defined. Do not define this
in a normal Skia build and remove all use from Skia code.

Change-Id: I9ff550f5db246b9024aac687a1bc01321f1be4c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319343
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-10-05 15:53:10 +00:00
Herb Derby
a80ce1a36d remove SkMakeSpan use ctor parameter deduction
Change-Id: I3a1b12f7eb906fe105eb7e9f6bc10e3745f61528
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320264
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-10-02 01:41:03 +00:00
Greg Daniel
280a4de999 Fix vulkan input usage flag for VulkanWindowContext.
Change-Id: I8ab093c68e0c70d78722589bcfd28934f2cf5cb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321517
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-01 20:20:22 +00:00
Chris Dalton
4c1fcdb4e8 Don't cast emscripten pointers when assembling WebGL interface
Since we are now referencing the exact methods instead of calling
GetProcAddress, there is no need to cast the function pointers. This
also catches a bug where the emscripten signatures for glWaitSync and
glClientWaitSync did not match the OpenGL API.

Change-Id: If365a8f6090961cb4b44146d87e102430bc5b30f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320659
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-09-30 14:31:07 +00:00
Brian Salomon
718ae76d5b Add sample count field to GrD3DTextureResourceInfo.
Remove separate constructor arg from GrBackendRenderTarget.

Add appropriate checks in onWrap functions in GrD3DGpu to limit to
previous functionality.

Bug: skia:9832

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: Ieba398d4bc00d18fdb0adffcda81f1a166db24b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320757
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-30 14:03:39 +00:00
Brian Salomon
57fd923c20 Add sample count to GrVkImageInfo.
Pre-req for allowing rendering to an externally created MSSA VkImage.


Bug: skia:9832

Cq-Include-Trybots: luci.skia.skia.primary:Test-Debian10-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All-Vulkan,Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Release-All-Vulkan,Test-Win10-Clang-ShuttleA-GPU-RadeonHD7770-x86_64-Release-All-Vulkan,Test-Android-Clang-GalaxyS9-GPU-MaliG72-arm64-Release-All-Android_Vulkan,Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Release-All-Android_Vulkan,Test-Android-Clang-GalaxyS20-GPU-MaliG77-arm64-Release-All-Android_Vulkan,Test-Android-Clang-Pixel4XL-GPU-Adreno640-arm64-Release-All-Android_Vulkan,Test-Android-Clang-P30-GPU-MaliG76-arm64-Release-All-Android_Vulkan
Change-Id: Ibf41944c6946dda7e27bdcd509ecd04976fc9ade
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320262
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-29 18:36:58 +00:00
Greg Daniel
427d8ebf30 Fix offscreen drawing when cleaning up vulkan viewer.
When using offscreen draws, we save the "previous" frame in fLastImage
in viewer. However this image holds a ref to the GrContext. When we
were destroying the vulkan context we thought we were destroying the
GrContext before the VkDevice but fLastImage was keeping it alive.

This changes makes sure to reset fLastImage when we are done with it.

Change-Id: Ib70e069a261f939217436a9f052d7565581cd230
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320263
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2020-09-28 19:41:03 +00:00
Chris Dalton
9278f10795 Add "AllPathsVolatile" skpbench bots
Also adds GalaxyS20 to the mix, which wasn't running skpbench
previously.

Also removes the skpbench logic to fail if we don't recognize the
hardware or have specific scripts for it. We don't have time to reverse
engineer every new piece of hardware we want to run on and the general
android script is quite helpful already.

Bug: skia:10419
Change-Id: I0e139cdd4bc2e7ca0e2e14c715d319664fa8c949
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319143
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-09-24 19:50:34 +00:00
Ravi Mistry
15a4b183c8 Add digital micrography svg to the RecreateSKPs bot
Bug: skia:10752
Change-Id: I15d6bb189d44eddbd8bbe2133a2bd705f5313a75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319028
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2020-09-24 17:20:42 +00:00
Adlai Holler
cf43fc6768 Revert "Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext""
This reverts commit ff13ffbeac.

Reason for revert: Blink in g3

Original change's description:
> Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
>
> This reverts commit 89bdc90ac8.
>
> Reason for revert: Fix metal
>
> Original change's description:
> > Revert "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
> >
> > This reverts commit d2daa94ede.
> >
> > Reason for revert: Metaru
> >
> > Original change's description:
> > > Take GrContext private, GrDDLContext inherit from GrRecordingContext
> > >
> > > Woo!
> > >
> > > Change-Id: I8d201b709343dc18cad31ea740575285dd035f35
> > > Docs-Preview: https://skia.org/?cl=317436
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317436
> > > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Adlai Holler <adlai@google.com>
> >
> > TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
> >
> > Change-Id: I9b58dee285fbdc49ebc8e76df5da0fe224cf9787
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318758
> > Reviewed-by: Adlai Holler <adlai@google.com>
> > Commit-Queue: Adlai Holler <adlai@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
>
>
> Change-Id: Id4b10795193a904cd4ed8c36e60e74abe3b6702a
> Docs-Preview: https://skia.org/?cl=318759
> Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac10.15.5-Clang-arm64-Debug-iOS_Metal,Build-Mac-Clang-x86_64-Debug-Metal
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318759
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Adlai Holler <adlai@google.com>

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

Change-Id: Ib20fe933120d56b72efaec73a0bedec60bc28def
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319184
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-09-24 11:44:49 +00:00
Jim Van Verth
1b89eb742a Add AMD allocator to D3D12 backend.
Adds base class GrD3DAlloc and GrD3DMemoryAllocator, and a reference
to a GrD3DMemoryAllocator in GrBackendContext and a reference to a
GrD3DAlloc in GrD3DTextureResourceInfo. Internally, we override this
base class to define the AMD memory allocator.

Change-Id: I033924b0247ea330969b1398f25985e7a84aec11
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317243
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-09-23 21:22:52 +00:00
Adlai Holler
ff13ffbeac Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
This reverts commit 89bdc90ac8.

Reason for revert: Fix metal

Original change's description:
> Revert "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
>
> This reverts commit d2daa94ede.
>
> Reason for revert: Metaru
>
> Original change's description:
> > Take GrContext private, GrDDLContext inherit from GrRecordingContext
> >
> > Woo!
> >
> > Change-Id: I8d201b709343dc18cad31ea740575285dd035f35
> > Docs-Preview: https://skia.org/?cl=317436
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317436
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Adlai Holler <adlai@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
>
> Change-Id: I9b58dee285fbdc49ebc8e76df5da0fe224cf9787
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318758
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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


Change-Id: Id4b10795193a904cd4ed8c36e60e74abe3b6702a
Docs-Preview: https://skia.org/?cl=318759
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac10.15.5-Clang-arm64-Debug-iOS_Metal,Build-Mac-Clang-x86_64-Debug-Metal
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318759
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-09-23 21:17:47 +00:00
Adlai Holler
7b97b3cb2b Reland "Migrate metal tools away from GrContext"
This reverts commit 18f4b1c7e3.

Reason for revert: Fixed iOS

Original change's description:
> Revert "Migrate metal tools away from GrContext"
>
> This reverts commit 3eb813e0cc.
>
> Reason for revert: Broke iOS
>
> Original change's description:
> > Migrate metal tools away from GrContext
> >
> > Change-Id: I73a73ca5d088c35acd23be3336d8d1e3e859a82e
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318760
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Auto-Submit: Adlai Holler <adlai@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
>
> Change-Id: Idf74c936cfe8481e18455dcc0faa21155884b198
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319017
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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


Change-Id: I6e14a333be4a960af0434bbcb6ce9a1a2271dca6
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac-Clang-arm64-Debug-iOS_Metal,Test-iOS-Clang-iPhone11-GPU-AppleA13-arm64-Debug-All-Metal,Test-Mac10.13-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Debug-All-Metal,Test-Mac10.13-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Debug-All-DDL3_Metal
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319018
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-09-23 19:11:07 +00:00
Chris Dalton
d1e6716f6a Add an "allPathsVolatile" option for testing
Bug: skia:10419
Change-Id: I4bb2dc515448d8c87329ade90d24bf78ca1d7938
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319097
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-09-23 19:02:27 +00:00
Adlai Holler
18f4b1c7e3 Revert "Migrate metal tools away from GrContext"
This reverts commit 3eb813e0cc.

Reason for revert: Broke iOS

Original change's description:
> Migrate metal tools away from GrContext
> 
> Change-Id: I73a73ca5d088c35acd23be3336d8d1e3e859a82e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318760
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Auto-Submit: Adlai Holler <adlai@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Idf74c936cfe8481e18455dcc0faa21155884b198
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319017
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-09-23 12:59:32 +00:00
Adlai Holler
3eb813e0cc Migrate metal tools away from GrContext
Change-Id: I73a73ca5d088c35acd23be3336d8d1e3e859a82e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318760
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-09-22 22:33:09 +00:00
Adlai Holler
89bdc90ac8 Revert "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
This reverts commit d2daa94ede.

Reason for revert: Metaru

Original change's description:
> Take GrContext private, GrDDLContext inherit from GrRecordingContext
> 
> Woo!
> 
> Change-Id: I8d201b709343dc18cad31ea740575285dd035f35
> Docs-Preview: https://skia.org/?cl=317436
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317436
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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

Change-Id: I9b58dee285fbdc49ebc8e76df5da0fe224cf9787
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318758
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-09-22 20:50:01 +00:00
Adlai Holler
d2daa94ede Take GrContext private, GrDDLContext inherit from GrRecordingContext
Woo!

Change-Id: I8d201b709343dc18cad31ea740575285dd035f35
Docs-Preview: https://skia.org/?cl=317436
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317436
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-09-22 20:03:19 +00:00
Florin Malita
8b5ed02eb0 Fix skia_use_ffmpeg builds
... post https://skia-review.googlesource.com/c/skia/+/317109

Change-Id: I7286fd6d7598a50a1db452f04a28317c600f4984
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318477
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-09-22 14:25:10 +00:00
Jim Van Verth
5fba9ae0cb Revert "Reland "Use Microsoft's ComPtr to wrap D3D12 objects.""
This reverts commit b8ae7fa12a.

Reason for revert: Introduced a memory leak

Original change's description:
> Reland "Use Microsoft's ComPtr to wrap D3D12 objects."
> 
> This is a reland of 0ef049177f
> 
> Original change's description:
> > Use Microsoft's ComPtr to wrap D3D12 objects.
> > 
> > Change-Id: I4bd173428a2b65f0bc1994fb794ef9d4d68d5ba0
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314957
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
> 
> Change-Id: Id0199db4061c67ed53da35e74dc31a004744be95
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315655
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I3f8744668558f6b8f4f367eeeeff2f6aa2c36992
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318209
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-09-21 22:02:12 +00:00
Chris Dalton
31634288fd Add gms that test limited hw tessellation segments
Adds variations of trickycubicstrokes and widebuttcaps that limit the
max number of hardware tessellation segments to 5. This exercises our
stroking logic for splitting curves and joins when they require more
segments than are supported by the hardware.

Bug: skia:10419
Change-Id: Ie52374b89e30bfa021b2de74e3cd32e02ab734d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317268
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-17 23:48:44 +00:00
Michael Ludwig
e4b79699ef Use SkClipOp::kIntersect instead of kReplace_ClipOp
This fixes the perf bot crashes from https://skia-review.googlesource.com/c/skia/+/317209
and removes a few other instances of kReplace_ClipOp that are equivalent to the
still supported SkClipOp::kIntersect op. Other than the benchmark case, the GPU
clip stack wasn't hitting these cases but they do need to be updated when the deprecated
ops are fully removed.

At this point, the remaining uses of deprecated clip ops are all in unit tests that
specifically test a clip stack (raster, conservative, or skclipstack) that specifically
supports expanded clip ops and the tests are testing those operations. They can remain
until we remove full support.

Bug: skia:10208
Change-Id: I5703bf43fd41b6addf329190a70c5429d5971240
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317380
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-09-16 18:37:37 +00:00
Mike Klein
d85b15942c in fm_bot, use -foo to remove a source
We're not using -foo today to do anything but print a "sorry" error.
Might as well make it something productive.

In this case, it happens that Codec_PngRoundTrip is flaky on my laptop;
I'm guessing the blame belongs with CoreGraphics.  Anyway, this lets me
skip it but run all other tests with a line like

    tests -Codec_PngRoundTrip b=cpu

Change-Id: I479a71575eadfc1f870a3c48c130b2b57797ac54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317316
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-16 16:38:08 +00:00
Nathaniel Nifong
0b448daafb Add a method of returning the list of commands that use an image
Change-Id: I3c94f7b6faa71ab0cbeccddd2032b657e350c9b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316843
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-09-16 15:57:40 +00:00
Brian Salomon
c2a9a9716e New version of SkImage::MakeFromYUVAPixmaps()
Takes SkYUVAPixmaps. Still implemented in terms of SkYUVAIndex[4]
internally.

Replace all internal use cases except wacky_yuv_formats.

Takes GrRecordingContext rather than GrContext.

SkVideoDecoder updated to take GrRecordingContext.

Bug: skia:10632

Change-Id: I6e9b9b6a4f11333bce6f87c1ebff0acb297f6540
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316837
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-15 16:13:50 +00:00
Adlai Holler
302e8fb771 Downgrade SkImage to GrImageContext
We still occasionally downcast, so this is not airtight,
but it (1) allows us to know where we are downcasting and
(2) lets us move away from GrContext (and hopefully remove
it sooner than later.)

All three canaries are currently broken =( so here we go!

Bug: skia:104662
Change-Id: I84efe132574690b62ea512e194e4f9e318e9c050
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316218
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-14 17:01:07 +00:00
Mike Klein
c1cc1d85ab bazel baby steps
A few first steps toward a Bazel build.

To try it out, I think just

    $ bazel test ...

I added third_party to .bazelignore to prevent Bazel from looking there.
It can handle external dependencies itself, so no need to poke into what
we sync from DEPS.  Some of those have Bazel configs and we don't want
to be building them yet.

I've started by with libpng using new_git_repository(), mostly because
it's small, with a mildly complex build, and needs dependencies of its
own, zlib.  Mysteriously zlib is built-in to Bazel, so that was easy.

Next up is probably a dependency that does support Bazel, using
git_repository().  That should make sure we can handle the full mix.

Change-Id: I5775a1b254d341b9a90630aa1cc433a24167f2fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316636
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2020-09-14 15:18:32 +00:00
John Stiles
d836f84ab8 Generate SkSL golden output files from test inputs during the build.
Golden SkSL outputs are intended to eventually replace the majority of
our unit tests, since they can automatically update themselves when we
change implementation details of the compiler.

If you change the compiler output without updating the Golden files, the
CheckGeneratedFiles housekeeper will be triggered. Set
`skia_compile_processors` or `skia_compile_sksl_tests` to true in your
GN args to regenerate them.

Almost all of the tests from SkSLFPTests.cpp and SkSLGLSLTests.cpp can
be migrated into separate unit-test .fp/.sksl files in a followup CL.

hcm@ has signed off on removing the copyright boilerplate preamble from
our unit test files.

Change-Id: I9e24a944bbac8f8efd62c92481b022a0b1ecdd0b
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316336
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-09-14 14:54:12 +00:00
Greg Daniel
d358cbebd4 Add support for plumbing GrDstSampleType through Ops and Pipeline creation.
This CL adds a new type GrDstSampleType to say how we will sample the dst.

We add tracking of the GrDstSampleType in the recording of GrOps and
then during execution passing the information along to the GrPipeline.

In general the tracking of GrDstSampleType is a global state of a GrOpsTask
so it is kept separate fro the DstProxyView which is more specific to a
single Op on the GrOpsTask.

Bug: skia:10409
Change-Id: Ie843c31f2e48a887daf96cee99ed159b196cb545
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315645
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-11 14:42:34 +00:00
Mike Reed
81606b5d97 remove unused (and bit-rotting) Lua support
Change-Id: I1ee2d21b79e929e5976825ae75aa4db960b034c9
Docs-Preview: https://skia.org/?cl=315856
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315856
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-09-09 14:33:32 +00:00
Nathaniel Nifong
2b1b2b2e8e Add a short description for concat and setmatrix saying whether it's a translate or something else
Change-Id: I3bb849f9e09a71ad5609840420f8f8d803e56634
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315737
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-09-09 14:16:42 +00:00
Jim Van Verth
b8ae7fa12a Reland "Use Microsoft's ComPtr to wrap D3D12 objects."
This is a reland of 0ef049177f

Original change's description:
> Use Microsoft's ComPtr to wrap D3D12 objects.
> 
> Change-Id: I4bd173428a2b65f0bc1994fb794ef9d4d68d5ba0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314957
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

Change-Id: Id0199db4061c67ed53da35e74dc31a004744be95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315655
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-09-08 22:04:05 +00:00
Jim Van Verth
bbbc28e0ba Revert "Use Microsoft's ComPtr to wrap D3D12 objects."
This reverts commit 0ef049177f.

Reason for revert: Looks like this is introducing a memory leak.

Original change's description:
> Use Microsoft's ComPtr to wrap D3D12 objects.
> 
> Change-Id: I4bd173428a2b65f0bc1994fb794ef9d4d68d5ba0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314957
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com

Change-Id: Ib0333c00a7f8c3650bd2b077cbdfb6926c5870f4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315653
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-09-08 19:09:24 +00:00
Jim Van Verth
0ef049177f Use Microsoft's ComPtr to wrap D3D12 objects.
Change-Id: I4bd173428a2b65f0bc1994fb794ef9d4d68d5ba0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314957
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-09-08 17:22:50 +00:00
Brian Salomon
59c60b0cb3 Reland "Add idea of DataType to SkYUVAPixmapInfo."
This is a reland of ed63444587

Original change's description:
> Add idea of DataType to SkYUVAPixmapInfo.
> 
> DataType describes the data type of YUVA channels
> independent of how they are grouped into planes.
> 
> Adds mapping functions between SkColorType/channel count
> and DataType.
> 
> SkYUVAPixmapInfo can be constructed from DataType and will
> choose appropriate SkColorTypes for each plane.
> 
> Valid SkYUVAPixmapInfos now have the same DataType for each
> plane (could relax this in the future, esp for alpha plane).
> 
> SkYUVAPixmapInfo::SupportedDataTypes specifies the supported
> combinations of SkYUVAInfo::PlanarConfig and
> kYUVAPixmapInfo::DataType supported by a GrContext (based on
> supported texture formats).
> 
> SkImageGenerator/SkCodec YUVA query API now takes a
> SupportedDataTypes.
> 
> Change-Id: I8791234638e6ba3396d1e7960b7bc210edc6dd57
> Bug: skia:10632
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314276
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:10632
Change-Id: I35b55b7477c11c822fdb3729a9f84acff1eb785d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315284
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-03 18:05:17 +00:00
Kevin Lubick
a1c2117004 [canvaskit] Add drawRect4f as example 'fast path' API
I added 3 tests, one using the drawRect API naively,
one using drawRect with a Malloc'd array, and one using
the drawRect4f.

rough local measurements:
 - [baseline with tip of tree code]: 50ms
 - naive drawRect: 40ms
 - drawRect with malloc: 28ms
 - drawRect4f: 27ms

I also tried the benchmarks locally with taking in paint
as a const reference. I did not see any changes, but that
could just be small sample size. I plan to land the code
as is for now, collect a bit of data in Perf and then try
landing the const reference stuff and see if we get
something measurable.

To aid this, I added in a helper list of tests to only run
some benchmarks easily.

Change-Id: I2d8c5296e93f05be45fc12059955fb9d9e339d83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315143
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-09-03 14:53:42 +00:00
Kevin Lubick
f8823b5726 Reland "[canvaskit] Change SkRects to be arrays, not objects."
This is a reland of bdc214a50e

The CPU version of SkottieWasm is timing out for reasons unknown,
but the GPU version is happy. I think we can get rid of the CPU
version of the job since it has been more or less superseded by
the SkottieFrames one (and the latter is more stable).

Original change's description:
> [canvaskit] Change SkRects to be arrays, not objects.
>
> This changes several APIs, so there are lots of breaking
> notes in the Changelog.
>
> This made the "draw 100 colored regions" benchmark about
> 20% faster (1ms -> .8ms).
>
> In theory, rendering should stay the same.
>
> Change-Id: Ib80b15e2d980ad5d568fff4460d2b529766c1b36
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312491
> Reviewed-by: Nathaniel Nifong <nifong@google.com>

Change-Id: I674aba85ecfb30b72e94cbaf89b2d97bfae3b7a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315142
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-09-03 14:31:38 +00:00
John Stiles
7571f9e490 Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'.
Mechanically updated via Xcode "Replace Regular Expression":

  typedef (.*) INHERITED;
    -->
  using INHERITED = $1;

The ClangTidy approach generated an even larger CL which would have
required a significant amount of hand-tweaking to be usable.

Change-Id: I671dc9d9efdf6d60151325c8d4d13fad7e10a15b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314999
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-03 03:41:26 +00:00
Michael Ludwig
c7fa895e50 Revert "Add idea of DataType to SkYUVAPixmapInfo."
This reverts commit ed63444587.

Reason for revert: trying to unblock android roller, which incorrectly thinks this has a merge conflict: https://b.corp.google.com/issues/167576324

Original change's description:
> Add idea of DataType to SkYUVAPixmapInfo.
> 
> DataType describes the data type of YUVA channels
> independent of how they are grouped into planes.
> 
> Adds mapping functions between SkColorType/channel count
> and DataType.
> 
> SkYUVAPixmapInfo can be constructed from DataType and will
> choose appropriate SkColorTypes for each plane.
> 
> Valid SkYUVAPixmapInfos now have the same DataType for each
> plane (could relax this in the future, esp for alpha plane).
> 
> SkYUVAPixmapInfo::SupportedDataTypes specifies the supported
> combinations of SkYUVAInfo::PlanarConfig and
> kYUVAPixmapInfo::DataType supported by a GrContext (based on
> supported texture formats).
> 
> SkImageGenerator/SkCodec YUVA query API now takes a
> SupportedDataTypes.
> 
> Change-Id: I8791234638e6ba3396d1e7960b7bc210edc6dd57
> Bug: skia:10632
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314276
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I72c39539a4766f10cac3ca3cdef6c503a8319ff1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314895
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-09-02 21:26:39 +00:00
Michael Ludwig
1f49ceb404 Revert "[canvaskit] Change SkRects to be arrays, not objects."
Revert submission 314622

Reason for revert: breaking wasm bots
Reverted Changes:
Ia1ba13814:[canvaskit] Replace RRect objects with TypedArrays...
Ib80b15e2d:[canvaskit] Change SkRects to be arrays, not objec...
I790b2d6fc:[canvaskit] Add drawRect4f as example 'fast path' ...

Change-Id: Ie6e4c57ba412ca9ff8e4446b06681b51029da2d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314893
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-09-02 21:21:36 +00:00
Michael Ludwig
55289ae4c6 Revert "[canvaskit] Add drawRect4f as example 'fast path' API"
Revert submission 314622

Reason for revert: breaking wasm bots
Reverted Changes:
Ia1ba13814:[canvaskit] Replace RRect objects with TypedArrays...
Ib80b15e2d:[canvaskit] Change SkRects to be arrays, not objec...
I790b2d6fc:[canvaskit] Add drawRect4f as example 'fast path' ...

Change-Id: I295791532a2d27bff41f706fa8ed37e0499c27d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314892
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-09-02 21:21:20 +00:00