Fix build when webgpu feature is not enabled (#36804)

Fix winit_minimal build breakage

Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
webbeef 2025-05-02 04:33:28 -07:00 committed by GitHub
parent 00b40bbdaf
commit e25e63b587
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

View file

@ -371,6 +371,7 @@ pub struct Constellation<STF, SWF> {
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,

View file

@ -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,
};

View file

@ -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;