mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
WIP a
This commit is contained in:
parent
96722fde4b
commit
7e76aace1b
@ -1575,10 +1575,17 @@
|
||||
|
||||
(def ^:private default-context-options
|
||||
#js {:antialias false
|
||||
:depth true
|
||||
;; Depth is not needed for 2D canvas rendering and can add driver work.
|
||||
:depth false
|
||||
:stencil true
|
||||
:alpha true
|
||||
"preserveDrawingBuffer" true})
|
||||
;; Preserving the drawing buffer forces extra GPU/driver work and can
|
||||
;; stall every frame; we re-render explicitly so it is unnecessary for
|
||||
;; the viewport and hurts FPS during interactions like drag.
|
||||
"preserveDrawingBuffer" false
|
||||
;; Hint the browser/ANGLE to reduce compositor-induced stalls.
|
||||
"desynchronized" true
|
||||
"powerPreference" "high-performance"})
|
||||
|
||||
(defn resize-viewbox
|
||||
[width height]
|
||||
|
||||
@ -1768,6 +1768,7 @@ impl RenderState {
|
||||
|
||||
performance::end_measure!("start_render_loop");
|
||||
performance::end_timed_log!("start_render_loop", _start);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -1826,7 +1827,12 @@ impl RenderState {
|
||||
// still need to flush every rAF so the user sees the updated
|
||||
// shape position — render_from_cache is not in the loop here.
|
||||
if !self.options.is_viewport_interaction() {
|
||||
self.flush_and_submit();
|
||||
// self.gpu_state.context.flush_and_submit();
|
||||
if self.options.is_interactive_transform() {
|
||||
self.gpu_state.context.flush_and_submit();
|
||||
} else {
|
||||
self.flush_and_submit();
|
||||
}
|
||||
} else {
|
||||
self.gpu_state.context.flush_and_submit();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user