mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-23 06:24:06 +00:00
Add a complexity limit on displaying layer thumbnails to improve performance (#2828)
* Skip complex layer thumbnails * Set Raster<GPU> to have usize::MAX render complexity * Code review --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
ceffcfd8df
commit
13ad814639
4 changed files with 77 additions and 2 deletions
|
@ -10,6 +10,7 @@ use graphene_core::instances::Instance;
|
|||
use graphene_core::math::quad::Quad;
|
||||
use graphene_core::raster::Image;
|
||||
use graphene_core::raster_types::{CPU, GPU, RasterDataTable};
|
||||
use graphene_core::render_complexity::RenderComplexity;
|
||||
use graphene_core::transform::{Footprint, Transform};
|
||||
use graphene_core::uuid::{NodeId, generate_uuid};
|
||||
use graphene_core::vector::VectorDataTable;
|
||||
|
@ -204,7 +205,7 @@ pub struct RenderMetadata {
|
|||
}
|
||||
|
||||
// TODO: Rename to "Graphical"
|
||||
pub trait GraphicElementRendered: BoundingBox {
|
||||
pub trait GraphicElementRendered: BoundingBox + RenderComplexity {
|
||||
fn render_svg(&self, render: &mut SvgRender, render_params: &RenderParams);
|
||||
|
||||
#[cfg(feature = "vello")]
|
||||
|
@ -1151,7 +1152,7 @@ impl GraphicElementRendered for GraphicElement {
|
|||
}
|
||||
|
||||
/// Used to stop rust complaining about upstream traits adding display implementations to `Option<Color>`. This would not be an issue as we control that crate.
|
||||
trait Primitive: std::fmt::Display + BoundingBox {}
|
||||
trait Primitive: std::fmt::Display + BoundingBox + RenderComplexity {}
|
||||
impl Primitive for String {}
|
||||
impl Primitive for bool {}
|
||||
impl Primitive for f32 {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue