Commit Graph

2795 Commits

Author SHA1 Message Date
Jim Van Verth
3a5974f68d Add Direct3D compile bots
Bug: skia:9935
Change-Id: I6d9c14ac674dee89a5a8ba726d99b4423c40eb9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274861
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-03-04 17:36:24 +00:00
Jim Van Verth
888ba8b3da Initialize D3D format table.
Set up the expected formats we'll want.
Doesn't include YUV formats just yet.

Bug: skia:9935
Change-Id: I934a7ef006b5a218a5f637774aea5f082202cd3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273877
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-28 15:01:31 +00:00
Jim Van Verth
c86c83cd80 Add DXGI_FORMAT to BackendFormat.
First steps to getting D3D texture format caps set up.

Bug: skia:9935
Change-Id: I905aaedd7d5fcc8b5137fcc8d8189e93260c9359
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273797
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-02-27 21:24:46 +00:00
Jim Van Verth
8ec13300cd Fill in more D3DCaps
Bug: skia:9935
Change-Id: Id8b851afdd97f8405dbb405e3f142f86dbe1de31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273003
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-02-26 18:26:45 +00:00
Brian Salomon
d8575452eb Add GrContextOption for GL error checking, shader, and program success.
Small behavior change: will not check for shader success and program
linking success over the command buffer in a debug build.

Also fail gracefully if stencil renderbuffer allocation fails.

Bug: skia:9938
Bug: chromium:1040186
Change-Id: I623f09d306261d28070078268f6242f92d65fd5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273276
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-02-25 21:00:19 +00:00
Shachar Langbeheim
c43a6c54b1 Remove docs for macros that don't exist in the code.
Change-Id: Ibabe3f1f9663ec36b5128bdb6f1cfeb7b8e09e8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272896
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-02-24 19:44:45 +00:00
Jim Van Verth
03b8ab225f Reland "Create D3D device and queue"
This is a reland of 29dc430f43

Original change's description:
> Create D3D device and queue
> 
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

Bug: skia:9935
Change-Id: I1c8797e09cdeb3694ea7f47b2236ab7d91d9519f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272996
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-02-24 17:41:55 +00:00
Leandro Lovisolo
16656fc96c Revert "Create D3D device and queue"
This reverts commit 29dc430f43.

Reason for revert: This is breaking the Google3 autoroller due to header file d3d12.h not being available on google3.

Original change's description:
> Create D3D device and queue
> 
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: I3857444cae52cc2338258c46b974ae5496bbaedc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272726
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
2020-02-21 22:49:12 +00:00
Jim Van Verth
29dc430f43 Create D3D device and queue
Bug: skia:9935
Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-02-21 19:49:52 +00:00
Jim Van Verth
b01e12b716 Start adding D3D backend
Bug: skia:
Change-Id: Id24ed653adb80fe9b2ad597a34e459eb91ca53ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271057
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-18 20:14:15 +00:00
Robert Phillips
b3c061aa4f Add createBackendFormat and createFBO0 helper methods to SkSurfaceCharacterization
These make it easier for clients to create new surface characterizations that differ only a little from an existing surface characterization.

Change-Id: Iebd0b32ae941d3f91427927108d092cb5864b09f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270444
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-13 18:55:22 +00:00
Brian Salomon
a56a746b7e Remove GrSurfaceDesc
Replace with SkISize.
Also change some const SkISize& params to just SkISize.

Change-Id: I3c72d961662eefeda545fba17d63e877cd5ca813
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269374
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-02-07 19:48:13 +00:00
Robert Phillips
99044e1a6a Update wacky_yuv_formats GM to demonstrate YUV resizing on the GPU
Change-Id: Idd2b75ca84c1d7984aa983820b4325fbbda2b753
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266203
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-29 14:16:36 +00:00
Stephen White
f03c116021 Roll dawn and adjust for new SwapChain API.
Split GrDawnImageInfo into GrDawnTextureInfo and GrDawnRenderTargetInfo.
The former holds only a wgpu::Texture, and the latter holds only a
wgpu::TextureView. This split is necessary because Dawn SwapChains now
vend TextureViews, not Textures.

The TextureView held by GrDawnRenderTargetInfo is always 1-mip, since
it's a requirement for rendering to a texture in Dawn.

Change-Id: Id6e99b5e4bf18f97e939170856a665e2038253ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254810
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-28 18:26:44 +00:00
Stephen White
3c0a50f038 Implement support for framebufferOnly render targets.
This reflects Dawn and Metal functionality.
Implement a FramebufferOnly flag on GrSurface and GrBackendRenderTarget.
Forward the state from GrBackendRenderTarget to GrSurface.
Check the GrSurface flag in GrGpu::readPixels() and GrGpu::writePixels()
and early-return.

Change-Id: I27d3c9c912b366791bfd0e1db49638d8925742f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262802
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-01-23 16:34:06 +00:00
Greg Daniel
b58a3c7331 Remove fConfig from GrSurfaceDesc.
Bug: skia:6718
Change-Id: I586e10c828d5d0a0b3e46d8efd7400991b98d5c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265978
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-01-23 15:53:36 +00:00
Greg Daniel
d51fa2f1e3 Remove GrPixelConfig from GrSurface and GrSurfaceProxy.
This also requires us to compute a scratch key from backend format instead of config.

Bug: skia:6718
Change-Id: I6bf4c5ba8188e354ddc5307ebf2ca10080df27cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265768
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-23 01:14:32 +00:00
Brian Salomon
87c314210a Add functions for GL_NV_fence to GrGLInterface.
Also add macro for ALL_COMPLETED

We plan to use this with ANGLE ES2 contexts.

Change-Id: I6c967fa9b9aefc41c31cd806aece8533f846f940
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265756
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-01-22 16:02:45 +00:00
Robert Phillips
b0855273ab Add SkImage::CompressionType::kBC1_RGBA8_UNORM support
This is mainly so we can test the compression code on macOS.

Bug: skia:9680
Change-Id: Ie0a2eacfe9100ee4ce4cc94c878d3032d6985832
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264480
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-16 21:45:33 +00:00
Robert Phillips
c558f72165 Compressed texture API cleanup
Change-Id: I020bf6e79b5511adbd89931120feb76f359d83aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264056
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-13 21:11:21 +00:00
Brian Salomon
ccb6142956 Allow implicit conversion from GrSamplerState::Filter to GrSamplerState
constexprify GrSamplerState

pass/return GrSamplerState by value (it's 3 bytes).

Remove unused function from GrTexturePriv

Change-Id: Iffecd941500acf5653f01cc88b42ff1d45678b54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263346
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-01-09 17:29:54 +00:00
Brian Salomon
e994380d00 Some GrTypes cleanup.
Remove some unused functions/macros.

Move two functions only used by GrBufferAllocPool there.

We only ever used GrSizeAlignUp with pow 2 alignments. Require that,
rename, move to GrTypesPriv.h (along with GrSizeDivRoundUp).

Change-Id: I1a7248952d1905f16f02de2028d65768b186acee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262061
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-01-03 19:49:07 +00:00
Chris Dalton
37ae4b06e2 Rename GpuPathRenderers::kAll to kDefault
There was never a need to distinguish between "all" and "default".
We can just use kDefalut everywhere. And as we add new path renderers,
we can exclude them from kDefault until they are ready to ship.

Change-Id: I378aa1e195d40daef6a2c54f9c8e829208780ebe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261714
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-12-31 01:01:17 +00:00
Chris Dalton
e1196c5d01 Add a mechanism to insert framebuffer barriers for NVIDIA tessellation
Bug: skia:9739
Change-Id: I4f13110c30af796edded1d0e18860bcb4a6ef925
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261673
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-12-31 00:18:36 +00:00
Chris Dalton
5a2f962313 Add back door support for GLSL tessellation shaders
Implements tessellation support at the Ganesh level, and adds back
door methods for supplying raw GLSL strings directly to the OpenGL
driver. Adds a new gm to verify tessellation is works in GL.

Change-Id: Idfc285b955cbe5e8e6bf0475be8b518b0cc6ed2c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261196
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-12-27 22:34:10 +00:00
Khushal Sagar
988db63351 gpu: Disable dual source blending support on buggy driver versions.
R=bsalomon@google.com

Bug:1027981
Change-Id: I1f0704451fadcd845a0f8845d728f4b8986d88ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261211
Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
2019-12-20 22:56:19 +00:00
Robert Phillips
8f259a0329 Add BC1_RGB8_UNORM support
This is working in the GL and Vulkan back ends. MacOS only supports the RGBA8 variants.
For mobile devices, probably only nVidia GPUs will support this.

Bug: skia:9680
Change-Id: I9d886b72232a031603e93e46059a97a8aa288b3c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261093
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-12-20 21:41:09 +00:00
Brian Salomon
4dea72a987 Reland x3 "Remove most of GrConfig.h"
This change makes this safe for Chrome:
https://skia-review.googlesource.com/c/skia/+/260779

This reverts commit 3f1a98b779.

Change-Id: Ic6886ceabbf626040fc527ea10fe06cbe74a3854
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260783
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-12-18 17:14:45 +00:00
Greg Daniel
3f1a98b779 Reland "Revert "Remove most of GrConfig.h""
This reverts commit 5b9c7ba313.

Reason for revert: Looks to still be breaking chrome

Original change's description:
> Revert "Revert "Remove most of GrConfig.h""
> 
> This reverts commit b0047b57b7.
> 
> Change-Id: I0c6df9e9d5c3984987398d2b7f675005828ab3de
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260697
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Change-Id: Ia9860b39c562368f8a2f84283c52f55593333075
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260642
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-12-17 23:16:58 +00:00
Brian Salomon
5b9c7ba313 Revert "Revert "Remove most of GrConfig.h""
This reverts commit b0047b57b7.

Change-Id: I0c6df9e9d5c3984987398d2b7f675005828ab3de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260697
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-12-17 21:23:48 +00:00
Robert Phillips
b915c94384 Add interface(s) for compressed backend texture support
This is just the API level interface(s) and the backend virtual calls needed to implement them.

Bug: skia:9680
Change-Id: I6c655751e23ce18c6a184c925e8d472902e8a478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-12-17 20:30:06 +00:00
Brian Osman
7b1678a527 Major refactor of runtime effects
Adds SkRuntimeEffect, a ref-counted object to hold SkSL,
a Compiler, and compiled Program, along with uniform info.

Removes the old SkSLFP factory and factory cache types.
Caching is done by simply holding on to the effect (or
the shader/color filter factories, which own an effect).

The effect class is simply ref'd by the factories, the
shader and color filter types, and the FP.

NOTE: Changes to public headers only affect private functions.

Change-Id: I0c1401505cb234e83943ad4ef2db6680f4c69fb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259336
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-12-16 15:59:04 +00:00
Robert Phillips
a27d625ca6 Add compression to Mock backend
Bring the Mock backend up to speed since we're expanding compression support.

Bug: skia:9680
Change-Id: I7fd7bed9351d3534d238feca0add54eced31cb4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259099
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-12-12 15:42:53 +00:00
Brian Salomon
b0047b57b7 Revert "Remove most of GrConfig.h"
This reverts commit 80e334dad8.

Reason for revert: Chrome is including our private headers which means this breaks the Chrome roll:
https://chromium-review.googlesource.com/c/chromium/src/+/1953757

Original change's description:
> Remove most of GrConfig.h
> 
> Change-Id: I0f693bed0778151f93d07cd42c6b597566695ab1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257999
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ie206db9865a7f9a7e334eb248de8cff38dd31d15
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258356
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-12-05 19:52:48 +00:00
Brian Salomon
80e334dad8 Remove most of GrConfig.h
Change-Id: I0f693bed0778151f93d07cd42c6b597566695ab1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257999
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-12-05 18:37:33 +00:00
Greg Daniel
f0e04f0c31 Always destroy resources instead of simply "abandoning" them in Vulkan backend.
This also now requires that when using a vulkan GrContext, the backing VkDevice,
Queue, and Instance must be alive when the GrContext is first destroyed or
abandoned. Additionally any GrBackendTextures created from the GrContext must
be deleted before destroying or abandoning the GrContext.

Bug: skia:9603
Change-Id: Ibf194d2ffdcddd61e34214d7d59a2d9a33c880e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257921
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-12-05 14:45:45 +00:00
Stephen White
a521c962b1 Update dawn.h -> webgpu.h, dawn_cpp.h -> webgpu_cpp.h.
Also fix some compile breakages from recent Skia changes.
No changes to Skia API.

Change-Id: Ifd0b1d89fb4ea3cf1f6a7170f2f74614276364ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257877
Commit-Queue: Stephen White <senorblanco@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-12-04 15:24:16 +00:00
Greg Daniel
ada451ca67 Return a size of 0 for external format GrSurfaces.
This fixes a case where Chrome was hitting the assert in ComputeSize that
colorSize > 0. In general this shouldn't affect our memory/budget tracking
since external textures are generally given to us as wrapped borrowed textures
so they're memory was not counted against our budget to begin with.

Change-Id: I2fd4eaaab52d9c3dc1af3a8f5b59a1b1f3c5dbb7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256656
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-11-26 20:35:34 +00:00
Jim Van Verth
5fab90999f Revert "Rename GLRTFBOIDIs0 to WrapsSwapchainSurface and use for Metal."
This reverts commit b1edfde279.

Reason for revert: senorblanco@ is adding a WriteOnly flag which will
be more appropriate for this functionality.

Original change's description:
> Rename GLRTFBOIDIs0 to WrapsSwapchainSurface and use for Metal.
> 
> This provides a way to indicate that a Metal RenderTarget, and in
> particular a RenderTargetProxy, is framebufferOnly, so it can be
> restricted to certain operations.
> 
> Bug: skia:9573
> TBR: bsalomon@google.com
> Change-Id: I733fae2fce402c375534889346255afe28a57944
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255783
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

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

Bug: skia:9573
Change-Id: Ide775fbbe81114c10fe81e7faa517c20784e8498
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256496
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-11-25 21:49:46 +00:00
Jim Van Verth
b1edfde279 Rename GLRTFBOIDIs0 to WrapsSwapchainSurface and use for Metal.
This provides a way to indicate that a Metal RenderTarget, and in
particular a RenderTargetProxy, is framebufferOnly, so it can be
restricted to certain operations.

Bug: skia:9573
TBR: bsalomon@google.com
Change-Id: I733fae2fce402c375534889346255afe28a57944
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255783
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-22 15:33:33 +00:00
Stephen White
3cc8d4fb7f Dawn: s/dawn::/wgpu::/g.
The new webgpu_cpp.h hotness for native apps brings with it a new
namespace: wgpu. This is a straight substitution.

Note: no Skia API changes.
Change-Id: I12b26417e76838cd8fa2b39b8161cbaa2cd8fa78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251660
Commit-Queue: Stephen White <senorblanco@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-10-30 14:29:46 +00:00
Stephen White
ebe2ac5f95 Dawn: workaround X11 #defines for Always, Success, None.
Dawn uses symbols in its API which Xlib.h #defines, which causes
compile-time conflicts. However, they do need to work in Chrome, so we
work around them the way Chrome does: by redefining them as static
constants (see https://cs.chromium.org/chromium/src/ui/gfx/x/x11.h).

Change-Id: Ibef0fd9976503cd606aa0fa646998df54675efb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250998
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-10-29 20:20:37 +00:00
Brian Salomon
9f2b86c54d More SkISizification in GPU code.
Uses SkISize instead of separate width/height variables in many places.

No functional change.

Change-Id: If87b2c57e43d810f0820c4e3c9ef8e6b8ebd10ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249886
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-22 15:04:07 +00:00
Greg Daniel
a00bcad94b Remove GrPixelConfig version of CompressedDataSize.
Bug: skia:6718
Change-Id: I0f9c7d89e732c59bdbe76ab45d42934029106efb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247684
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-10-11 17:51:05 +00:00
Greg Daniel
7fd7a8aef0 Remove uses of GrPixelConfig version of GrBytesPerPixel.
Bug: skia:6718
Change-Id: I8421f38644567973f0b8de29b745ca9a471583bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247598
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-10-10 20:39:05 +00:00
Greg Daniel
8b6661757a Add new public api on GrContext for computing image size.
This api will replace ComputeTextureSize.

Change-Id: I9befd8706f44250805315bdb13a559cf81c7142d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247337
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-10-09 18:57:20 +00:00
Chris Dalton
38f0a4972a Add GL_QCOM_TILED_RENDERING as an optional interface
Change-Id: I29b53e674cd788ac188295060028bbb7805858a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246281
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-10-07 18:42:01 +00:00
Brian Salomon
9241a6d394 Reland "Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime""
This is a reland of 6fc04f88a8

Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
> 
> This is a reland of ce240cc6fd
> 
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> > 
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> > 
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> > 
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> > 
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> > 
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> > 
> > Bug: chromium:973403
> > Bug: skia:8962
> > 
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:973403, skia:8962
Change-Id: Ie584c1c3ef8021c976f71b708e53871c693cc450
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246057
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-03 19:14:22 +00:00
Ravi Mistry
cb55010652 Revert "Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime""
This reverts commit 6fc04f88a8.

Reason for revert: Chrome roll failure suspect because of:
* https://chromium-review.googlesource.com/c/chromium/src/+/1837131 (22 commits)
* https://chromium-review.googlesource.com/c/chromium/src/+/1837214 (24 commits)

Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
>
> This is a reland of ce240cc6fd
>
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> >
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> >
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> >
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> >
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> >
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> >
> > Bug: chromium:973403
> > Bug: skia:8962
> >
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,brianosman@google.com

Change-Id: I9e01d1b82fb399b94292441d91da51176bb161d9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245956
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2019-10-03 09:19:24 +00:00
Brian Salomon
6fc04f88a8 Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
This is a reland of ce240cc6fd

Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
> 
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
> 
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
> 
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> 
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
> 
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
> 
> Bug: chromium:973403
> Bug: skia:8962
> 
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:973403, skia:8962
Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-03 01:41:35 +00:00