diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index ad89c435717..f3a15d7708d 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -371,6 +371,7 @@ pub struct Constellation { mem_profiler_chan: mem::ProfilerChan, /// A single WebRender document the constellation operates on. + #[cfg(feature = "webgpu")] webrender_document: DocumentId, /// Webrender related objects required by WebGPU threads @@ -715,6 +716,7 @@ where phantom: PhantomData, webdriver: WebDriverData::new(), document_states: HashMap::new(), + #[cfg(feature = "webgpu")] webrender_document: state.webrender_document, #[cfg(feature = "webgpu")] webrender_wgpu, diff --git a/components/script/canvas_context.rs b/components/script/canvas_context.rs index 0a7545e9594..7dfdf48e3f5 100644 --- a/components/script/canvas_context.rs +++ b/components/script/canvas_context.rs @@ -14,8 +14,10 @@ use crate::dom::bindings::codegen::UnionTypes::HTMLCanvasElementOrOffscreenCanva use crate::dom::bindings::inheritance::Castable; use crate::dom::htmlcanvaselement::HTMLCanvasElement; use crate::dom::node::{Node, NodeDamage}; +#[cfg(feature = "webgpu")] +use crate::dom::types::GPUCanvasContext; use crate::dom::types::{ - CanvasRenderingContext2D, GPUCanvasContext, OffscreenCanvas, OffscreenCanvasRenderingContext2D, + CanvasRenderingContext2D, OffscreenCanvas, OffscreenCanvasRenderingContext2D, WebGL2RenderingContext, WebGLRenderingContext, }; diff --git a/components/script/dom/gpucanvascontext.rs b/components/script/dom/gpucanvascontext.rs index 2bdabf3e0ab..f47e1dfddd1 100644 --- a/components/script/dom/gpucanvascontext.rs +++ b/components/script/dom/gpucanvascontext.rs @@ -3,6 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use dom_struct::dom_struct; +use webrender_api::ImageKey; use crate::dom::bindings::codegen::Bindings::GPUCanvasContextBinding::GPUCanvasContextMethods; use crate::dom::bindings::codegen::UnionTypes;