Improve rendering efficiency and add caching (#95)

Fixes #84

*Reduce heap allocations
* Add caching for rendering svgs
* Deduplicate UpdateCanvas Responses
This commit is contained in:
TrueDoctor
2021-05-07 02:47:38 -07:00
committed by Keavon Chambers
parent 5f1620b008
commit cb9d34c84d
14 changed files with 123 additions and 73 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ impl fmt::Display for LayerType {
#[repr(C)]
// TODO - Make Copy when possible
pub enum DocumentResponse {
UpdateCanvas { document: String },
DocumentChanged,
CollapseFolder { path: Vec<LayerId> },
ExpandFolder { path: Vec<LayerId>, children: Vec<LayerPanelEntry> },
}
@@ -37,7 +37,7 @@ pub enum DocumentResponse {
impl fmt::Display for DocumentResponse {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
let name = match self {
DocumentResponse::UpdateCanvas { .. } => "UpdateCanvas",
DocumentResponse::DocumentChanged { .. } => "DocumentChanged",
DocumentResponse::CollapseFolder { .. } => "CollapseFolder",
DocumentResponse::ExpandFolder { .. } => "ExpandFolder",
};