Skip to content

Commit

Permalink
Correctly gate imports and remove some more useless imports
Browse files Browse the repository at this point in the history
  • Loading branch information
DJMcNab committed Oct 3, 2024
1 parent d74d3d4 commit 456095d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 29 deletions.
2 changes: 1 addition & 1 deletion examples/headless/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use vello::wgpu::{
self, BufferDescriptor, BufferUsages, CommandEncoderDescriptor, Extent3d, ImageCopyBuffer,
TextureDescriptor, TextureFormat, TextureUsages,
};
use vello::{block_on_wgpu, RendererOptions, Scene};
use vello::{util::block_on_wgpu, RendererOptions, Scene};

fn main() -> Result<()> {
#[cfg(not(target_arch = "wasm32"))]
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_sdl2/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::num::NonZeroUsize;
use vello::kurbo::{Affine, Circle, Ellipse, Line, RoundedRect, Stroke};
use vello::peniko::Color;
use vello::util::{RenderContext, RenderSurface};
use vello::{AaConfig, DebugLayers, Renderer, RendererOptions, Scene};
use vello::{low_level::DebugLayers, AaConfig, Renderer, RendererOptions, Scene};

use vello::wgpu;

Expand Down
2 changes: 1 addition & 1 deletion examples/with_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ impl<'s> ApplicationHandler<UserEvent> for VelloApp<'s> {
// it requires more async wiring for the readback. See
// [#gpu > async on wasm](https://xi.zulipchat.com/#narrow/stream/197075-gpu/topic/async.20on.20wasm)
if self.async_pipeline && cfg!(not(target_arch = "wasm32")) {
self.scene_complexity = vello::block_on_wgpu(
self.scene_complexity = vello::util::block_on_wgpu(
&device_handle.device,
self.renderers[surface.dev_id]
.as_mut()
Expand Down
43 changes: 18 additions & 25 deletions vello/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,35 +86,11 @@ mod recording;
mod render;
mod scene;
mod shaders;
#[cfg(feature = "wgpu")]
mod wgpu_engine;

#[cfg(feature = "wgpu")]
use std::{num::NonZeroUsize, sync::Arc};

use debug::DebugLayers;
/// Styling and composition primitives.
pub use peniko;
/// 2D geometry, with a focus on curves.
pub use peniko::kurbo;

use recording::{BindType, ImageFormat, ImageProxy, Recording, ResourceProxy, ShaderId};
use render::Render;
use shaders::FullShaders;
pub use skrifa;
use vello_encoding::BumpAllocators;
pub use vello_encoding::Glyph;

#[cfg(feature = "wgpu")]
pub use wgpu;

#[cfg(feature = "wgpu")]
pub mod util;

pub use scene::{DrawGlyphs, Scene};
use thiserror::Error;
#[cfg(feature = "wgpu")]
pub use util::block_on_wgpu;
mod wgpu_engine;

pub mod low_level {
//! Utilities which can be used to create an alternative Vello renderer to [`Renderer`][crate::Renderer].
Expand All @@ -131,7 +107,24 @@ pub mod low_level {
/// Temporary export, used in `with_winit` for stats
pub use vello_encoding::BumpAllocators;
}
/// Styling and composition primitives.
pub use peniko;
/// 2D geometry, with a focus on curves.
pub use peniko::kurbo;
pub use skrifa;

#[cfg(feature = "wgpu")]
pub use wgpu;

pub use scene::{DrawGlyphs, Scene};
pub use vello_encoding::Glyph;

use debug::DebugLayers;
use low_level::*;
use thiserror::Error;

#[cfg(feature = "wgpu")]
use std::{num::NonZeroUsize, sync::Arc};
#[cfg(feature = "wgpu")]
use vello_encoding::Resolver;
#[cfg(feature = "wgpu")]
Expand Down
2 changes: 1 addition & 1 deletion vello_tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use vello::wgpu::{
self, BufferDescriptor, BufferUsages, CommandEncoderDescriptor, Extent3d, ImageCopyBuffer,
TextureDescriptor, TextureFormat, TextureUsages,
};
use vello::{block_on_wgpu, util::RenderContext, AaConfig, RendererOptions, Scene};
use vello::{util::block_on_wgpu, util::RenderContext, AaConfig, RendererOptions, Scene};

mod compare;
mod snapshot;
Expand Down

0 comments on commit 456095d

Please sign in to comment.