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.
This commit is contained in:
David Capello 2019-06-10 17:43:38 -03:00
parent 8e193b592a
commit 922505e8af

View File

@ -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);