mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-18 18:38:05 +08:00
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:
committed by
Keavon Chambers
parent
457c465342
commit
fc10575dfa
@@ -31,7 +31,6 @@ fn handle_response(response: Response) {
|
||||
let response_type = response.to_string();
|
||||
match response {
|
||||
Response::Document(doc) => match doc {
|
||||
DocumentResponse::UpdateCanvas { document } => send_response(response_type, &[document]),
|
||||
DocumentResponse::ExpandFolder { path, children } => {
|
||||
let children = children
|
||||
.iter()
|
||||
@@ -41,7 +40,9 @@ fn handle_response(response: Response) {
|
||||
send_response(response_type, &[path_to_string(path), children])
|
||||
}
|
||||
DocumentResponse::CollapseFolder { path } => send_response(response_type, &[path_to_string(path)]),
|
||||
DocumentResponse::DocumentChanged => log::error!("Wasm wrapper got request to update the document"),
|
||||
},
|
||||
Response::Tool(ToolResponse::UpdateCanvas { document }) => send_response(response_type, &[document]),
|
||||
Response::Tool(ToolResponse::SetActiveTool { tool_name }) => send_response(response_type, &[tool_name]),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user