mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Fix Vello rendering the infinite canvas without a white background color (#2361)
Fix infinite canvas for vello Remove debugging fill Remove debug log
This commit is contained in:
@@ -8,7 +8,7 @@ use dyn_any::{DynAny, StaticType};
|
||||
use gpu_executor::{ComputePassDimensions, GPUConstant, StorageBufferOptions, TextureBufferOptions, TextureBufferType, ToStorageBuffer, ToUniformBuffer};
|
||||
use graphene_core::application_io::{ApplicationIo, EditorApi, SurfaceHandle};
|
||||
use graphene_core::transform::{Footprint, Transform};
|
||||
use graphene_core::{Cow, Node, SurfaceFrame, Type};
|
||||
use graphene_core::{Color, Cow, Node, SurfaceFrame, Type};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use futures::Future;
|
||||
@@ -133,7 +133,7 @@ pub use graphene_core::renderer::RenderContext;
|
||||
// }
|
||||
|
||||
impl WgpuExecutor {
|
||||
pub async fn render_vello_scene(&self, scene: &Scene, surface: &WgpuSurface, width: u32, height: u32, context: &RenderContext) -> Result<()> {
|
||||
pub async fn render_vello_scene(&self, scene: &Scene, surface: &WgpuSurface, width: u32, height: u32, context: &RenderContext, background: Color) -> Result<()> {
|
||||
let surface = &surface.surface.inner;
|
||||
let surface_caps = surface.get_capabilities(&self.context.adapter);
|
||||
surface.configure(
|
||||
@@ -151,13 +151,14 @@ impl WgpuExecutor {
|
||||
);
|
||||
let surface_texture = surface.get_current_texture()?;
|
||||
|
||||
let [r, g, b, _] = background.to_rgba8_srgb();
|
||||
let render_params = RenderParams {
|
||||
// We are using an explicit opaque color here to eliminate the alpha premultiplication step
|
||||
// which would be required to support a transparent webgpu canvas
|
||||
base_color: vello::peniko::Color::from_rgba8(0x22, 0x22, 0x22, 0xff),
|
||||
base_color: vello::peniko::Color::from_rgba8(r, g, b, 0xff),
|
||||
width,
|
||||
height,
|
||||
antialiasing_method: AaConfig::Msaa8,
|
||||
antialiasing_method: AaConfig::Msaa16,
|
||||
};
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user