Improve Graphics::dirty() to avoid flipping unnecessary she::Display areas

This commit is contained in:
David Capello 2017-11-03 09:36:12 -03:00
parent f07359d71c
commit 73605749e6
2 changed files with 9 additions and 4 deletions

View File

@ -464,6 +464,14 @@ gfx::Size Graphics::doUIStringAlgorithm(const std::string& str, gfx::Color fg, g
return calculatedSize;
}
void Graphics::dirty(const gfx::Rect& bounds)
{
gfx::Rect rc = m_surface->getClipBounds();
rc = rc.createIntersection(bounds);
if (!rc.isEmpty())
m_dirtyBounds |= rc;
}
//////////////////////////////////////////////////////////////////////
// ScreenGraphics

View File

@ -101,10 +101,7 @@ namespace ui {
private:
gfx::Size doUIStringAlgorithm(const std::string& str, gfx::Color fg, gfx::Color bg, const gfx::Rect& rc, int align, bool draw);
void dirty(const gfx::Rect& bounds) {
m_dirtyBounds |= bounds;
}
void dirty(const gfx::Rect& bounds);
she::Surface* m_surface;
int m_dx;