Makes the Metal backend more consistent with the other backends,
and allows new init parameters to be added without significantly
changing API.
Added updated sk_cf_obj because I needed some of its functionality.
Bug: skia:10804
Change-Id: I6f1dd1c03ddc4c4b702ea75eff14bc0f98ab5ad2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334426
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Sometimes it's helpful to think about subsampling separately from
how the channels are spread across planes.
Bug: skia:10632
Change-Id: Ib03f71195f9706ef6def418b1f2125c29e0cf738
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334102
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Especially while I'm fiddling with the implementation, we don't
want the user to be surprised when using DDLs also triggers
this other codepath.
Bug: skia:10877
Change-Id: I660ea08189fff45acd7a45df12e15c45f607758a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332720
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
This simplifies our world a little bit.
Bug: skia:10877
Change-Id: I2fb27cd53e9fda0f279c046f6eaa50fd02774e72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332604
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: I93fdeaa3ea6be73619f82859bb53aa88fae3262b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329962
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This is everything except for literally removing the class.
Change-Id: I2f16caf865d1bcf9c0f267aed73313c0676a73bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327222
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This is desired for a short term memory improvement on low memory
devices.
Bug: chromium:1138979
Change-Id: I7df41a9c4d21b7a7f62b738e6358b36dd262f77d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327345
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit fea12238ed.
Reason for revert: MSAN/SwiftShader failure
Original change's description:
> New variant of SkImage::MakeFromYUVATextures.
>
> Takes a new type GrYUVATextures. This a set of GrBackendTextures and
> SkYUVAInfo that have been pre-validated to be compatible.
>
> Bug: skia:10632
>
> Change-Id: Id252f8662ede0f268e88fd40dc1b0b8f4ab6345f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317762
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: I5350d4f9b1eda0503fb0af9db8575a734bdc811f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327922
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Takes a new type GrYUVATextures. This a set of GrBackendTextures and
SkYUVAInfo that have been pre-validated to be compatible.
Bug: skia:10632
Change-Id: Id252f8662ede0f268e88fd40dc1b0b8f4ab6345f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317762
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Cut & paste with some reorganization of includes & forward-decls.
Next up is GrContextPriv.
Change-Id: I72d2d95c62692e3b37608517b796c0041ffedea3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326157
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Cut & paste job, but I did replace some cases of just calling
inherited implementations with using-statements. There are
other methods on this class that are using-statements and
that pattern is cleaner.
Change-Id: Ie369c643e44bdb8f82dfffcf45c1f65d48606899
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
The call order here is a little weird – it could use some refactoring
but for now it's just a cut-and-paste job.
Change-Id: I931493a421f7fd1df69f0c47055b90a2996c7dc3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325459
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
This is pretty much just cutting & pasting the code naïvely,
but it's the safe way to go so that we don't impact the
order of events during this housekeeping.
Change-Id: I8d9f2ffb560b34fd1a8d9603174ff1f17803e447
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324619
Commit-Queue: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Once triangulated paths are added this will no longer just be storing proxy views.
Bug: 1108408
Change-Id: I82fa47b0b85f738d9a25330c29bc2892c9bfeda4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323999
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Currently there is nothing using these formats, but this change just adds
them along with a quaries about their properties. They will be used in a
follow up change.
Bug: skia:10727
Change-Id: Iaaf13baf372799d47c65bd974fd204a32be57617
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322622
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
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>
This will allow us in a follow on change to put in a "fake" gl stencil
format for the wrapped FBO.
Bug: skia:10727
Change-Id: Iba1eca5114b34d25e6a220591d28a20f7b36b12b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321545
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Instead of being passed separately.
Check sample count in various onWrap methods in GrMtlGpu.
Bug: skia:9832
Cq-Include-Trybots: luci.skia.skia.primary:Test-iOS-Clang-iPhone8-GPU-AppleA11-arm64-Release-All-Metal,Test-iOS-Clang-iPhone7-GPU-PowerVRGT7600-arm64-Release-All-Metal,Test-iOS-Clang-iPadPro-GPU-PowerVRGT7800-arm64-Release-All-Metal,Test-iOS-Clang-iPhone11-GPU-AppleA13-arm64-Release-All-Metal,Test-iOS-Clang-iPhone6-GPU-PowerVRGX6450-arm64-Release-All-Metal,Test-Mac10.15-Clang-MacBookAir7.2-GPU-IntelHD6000-x86_64-Release-All-Metal
Change-Id: If5813db95b07f5d272e80920486f461cc5a587fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320956
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
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>
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>
We had lots of checks just checking defined but we always define
GR_TEST_UTILS
Change-Id: I588c50ddd91f71618a96ab6c9eda2050b423f611
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319682
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
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>
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>
Passing in VK_IMAGE_LAYOUT_UNDEFINED will tell Skia to not update the
layout when doing the state change.
Bug: skia:10742
Change-Id: Ic59b7c95d3a73e29dcd6eec16a2fd138e1a1d95f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318204
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
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>
This CL is also imperfect and incomplete but, although currently unused, it sketches in how the threadSafeProxyCache will be plumbed through the GrContexts and GrResourceCache.
Bug: 1108408
Change-Id: Idb012b6efd49291de69bd88e4b4c531458a3e553
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317360
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
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>