From 922505e8af9e64b77acdf4df710d20c4bdca0b5e Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 10 Jun 2019 17:43:38 -0300 Subject: [PATCH] Fix performance problem after viewing an huge sprite When we were viewing an huge sprite, a temporal buffer (os::Surface*) used to render it would increase its size to the size of the canvas. After that, whatever other sprite that we saw (even for the smallest one) we were unnecessary clearing the entire (huge) internal buffer with os::Surface::clear() on each render. This problem was visible only using the new render engine. --- src/app/ui/editor/editor.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/ui/editor/editor.cpp b/src/app/ui/editor/editor.cpp index 548058a28..dc8715315 100644 --- a/src/app/ui/editor/editor.cpp +++ b/src/app/ui/editor/editor.cpp @@ -668,9 +668,6 @@ void Editor::drawOneSpriteUnclippedRect(ui::Graphics* g, const gfx::Rect& sprite } if (tmp->nativeHandle()) { - if (newEngine) - tmp->clear(); // TODO why we need this? - convert_image_to_surface(rendered.get(), m_sprite->palette(m_frame), tmp, 0, 0, 0, 0, rc2.w, rc2.h);