From 189d4fd8fad9e3c776873be51938cd31a42b6177 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 20 May 2021 09:47:09 +0200 Subject: BASELINE: Update Chromium to 90.0.4430.221 Change-Id: Iff4d9d18d2fcf1a576f3b1f453010f744a232920 Reviewed-by: Allan Sandfeld Jensen --- .../renderer/modules/webgpu/gpu_canvas_context.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'chromium/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc') diff --git a/chromium/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc b/chromium/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc index bfacc2148b4..50188762c2f 100644 --- a/chromium/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc +++ b/chromium/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc @@ -7,6 +7,7 @@ #include "third_party/blink/renderer/bindings/modules/v8/rendering_context.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_swap_chain_descriptor.h" #include "third_party/blink/renderer/modules/webgpu/dawn_conversions.h" +#include "third_party/blink/renderer/modules/webgpu/gpu_adapter.h" #include "third_party/blink/renderer/modules/webgpu/gpu_device.h" namespace blink { @@ -125,20 +126,38 @@ GPUSwapChain* GPUCanvasContext::configureSwapChain( swapchain_ = MakeGarbageCollected( this, descriptor->device(), usage, format, filter_quality_); + swapchain_->CcLayer()->SetContentsOpaque(!CreationAttributes().alpha); + swapchain_->setLabel(descriptor->label()); + + // If we don't notify the host that something has changed it may never check + // for the new cc::Layer. + Host()->SetNeedsCompositingUpdate(); + return swapchain_; } ScriptPromise GPUCanvasContext::getSwapChainPreferredFormat( ScriptState* script_state, - const GPUDevice* device) { + GPUDevice* device) { ScriptPromiseResolver* resolver = MakeGarbageCollected(script_state); ScriptPromise promise = resolver->Promise(); + device->AddConsoleWarning( + "Passing a GPUDevice to getSwapChainPreferredFormat is deprecated. " + "Pass a GPUAdapter instead, and update the calling code to expect a " + "GPUTextureFormat to be retured instead of a Promise."); + // TODO(crbug.com/1007166): Return actual preferred format for the swap chain. resolver->Resolve("bgra8unorm"); return promise; } +String GPUCanvasContext::getSwapChainPreferredFormat( + const GPUAdapter* adapter) { + // TODO(crbug.com/1007166): Return actual preferred format for the swap chain. + return "bgra8unorm"; +} + } // namespace blink -- cgit v1.2.1