| // Copyright 2019 The Chromium Authors |
| // 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/ |
| |
| enum GPUCanvasAlphaMode { |
| "opaque", |
| "premultiplied", |
| }; |
| |
| enum GPUCanvasToneMappingMode { |
| "standard", |
| "extended", |
| }; |
| |
| dictionary GPUCanvasToneMapping { |
| GPUCanvasToneMappingMode mode = "standard"; |
| }; |
| |
| dictionary GPUCanvasConfiguration { |
| required GPUDevice device; |
| required GPUTextureFormat format; |
| GPUTextureUsageFlags usage = 16; // GPUTextureUsage.RENDER_ATTACHMENT |
| sequence<GPUTextureFormat> viewFormats = []; |
| PredefinedColorSpace colorSpace = "srgb"; |
| GPUCanvasAlphaMode alphaMode = "opaque"; |
| [RuntimeEnabled=WebGPUHDR] GPUCanvasToneMapping toneMapping = {}; |
| // TODO(https://crbug.com/333967627): Remove support for this older version |
| // of the API once the new API lands. |
| [RuntimeEnabled=CanvasHDR] CanvasHighDynamicRangeOptions hdrOptions; |
| }; |