GPUCanvasContext: unconfigure() method

Khả dụng hạn chế

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

Phương thức unconfigure() của giao diện GPUCanvasContext xóa bất kỳ cấu hình ngữ cảnh nào đã được đặt trước đó, và hủy bất kỳ texture nào được trả về qua getCurrentTexture() khi ngữ cảnh canvas đã được cấu hình.

Cú pháp

js
unconfigure()

Tham số

Không có.

Giá trị trả về

None (undefined).

Ví dụ

js
const canvas = document.querySelector("#gpuCanvas");
const context = canvas.getContext("webgpu");

context.configure({
  device,
  format: navigator.gpu.getPreferredCanvasFormat(),
  alphaMode: "premultiplied",
});

// Later on
context.unconfigure();

Thông số kỹ thuật

Thông số kỹ thuật
WebGPU
# dom-gpucanvascontext-unconfigure

Tương thích trình duyệt

Xem thêm