blob: ec55b1c83fe5958db1e51b3ab13b960ddef27683 [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://gpuweb.github.io/gpuweb/
[
ActiveScriptWrappable,
Exposed(Window WebGPU, Worker WebGPU)
] interface GPUCanvasContext {
[ImplementedAs=getHTMLOrOffscreenCanvas] readonly attribute (HTMLCanvasElement or OffscreenCanvas) canvas;
GPUTextureFormat getPreferredFormat(GPUAdapter adapter);
[RaisesException] void configure(GPUCanvasConfiguration descriptor);
void unconfigure();
[RaisesException] GPUTexture getCurrentTexture();
// Deprecated
[RaisesException] GPUSwapChain configureSwapChain(GPUCanvasConfiguration descriptor);
[CallWith=ExecutionContext] GPUTextureFormat getSwapChainPreferredFormat(GPUAdapter adapter);
};