diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/chromium/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h b/chromium/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h index 54a2a400aaa..fa8c2642026 100644 --- a/chromium/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h +++ b/chromium/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h @@ -29,14 +29,19 @@ class GPUSwapChain : public DawnObjectImpl, GPUDevice*, WGPUTextureUsage, WGPUTextureFormat, - SkFilterQuality); + cc::PaintFlags::FilterQuality, + IntSize); ~GPUSwapChain() override; void Trace(Visitor* visitor) const override; void Neuter(); cc::Layer* CcLayer(); - void SetFilterQuality(SkFilterQuality); + void SetFilterQuality(cc::PaintFlags::FilterQuality); + + const gfx::Size& Size() const { return swap_buffers_->Size(); } + + viz::ResourceFormat Format() const { return swap_buffers_->Format(); } // Returns a StaticBitmapImage backed by a texture containing the current // contents of the front buffer. This is done without any pixel copies. The @@ -48,6 +53,10 @@ class GPUSwapChain : public DawnObjectImpl, // encapsulate an external mailbox, synctoken and release callback. scoped_refptr<CanvasResource> ExportCanvasResource(); + // Copies the back buffer to given shared image resource provider which must + // be webgpu compatible. Returns true on success. + bool CopyToResourceProvider(CanvasResourceProvider*); + // gpu_swap_chain.idl GPUTexture* getCurrentTexture(); @@ -62,6 +71,7 @@ class GPUSwapChain : public DawnObjectImpl, Member<GPUCanvasContext> context_; WGPUTextureUsage usage_; WGPUTextureFormat format_; + const IntSize size_; Member<GPUTexture> texture_; }; |