TINYGL: Skip drawing when there is no dirty rectangle
This commit is contained in:
parent
72389d23df
commit
2fb2d87dc9
1 changed files with 27 additions and 25 deletions
|
@ -188,6 +188,7 @@ void tglPresentBufferDirtyRects(TinyGL::GLContext *c) {
|
|||
(*it1).rectangle.clip(renderRect);
|
||||
}
|
||||
|
||||
if (!rectangles.empty()) {
|
||||
// Execute draw calls.
|
||||
for (DrawCallIterator it = c->_drawCallsQueue.begin(); it != c->_drawCallsQueue.end(); ++it) {
|
||||
Common::Rect drawCallRegion = (*it)->getDirtyRegion();
|
||||
|
@ -198,15 +199,6 @@ void tglPresentBufferDirtyRects(TinyGL::GLContext *c) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Dispose not necessary draw calls.
|
||||
for (DrawCallIterator it = c->_previousFrameDrawCallsQueue.begin(); it != c->_previousFrameDrawCallsQueue.end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
|
||||
c->_previousFrameDrawCallsQueue = c->_drawCallsQueue;
|
||||
c->_drawCallsQueue.clear();
|
||||
|
||||
#if TGL_DIRTY_RECT_SHOW
|
||||
// Draw debug rectangles.
|
||||
// Note: white rectangles are rectangle that contained other rectangles
|
||||
|
@ -225,6 +217,16 @@ void tglPresentBufferDirtyRects(TinyGL::GLContext *c) {
|
|||
c->fb->enableBlending(blendingEnabled);
|
||||
c->fb->enableAlphaTest(alphaTestEnabled);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Dispose not necessary draw calls.
|
||||
for (DrawCallIterator it = c->_previousFrameDrawCallsQueue.begin(); it != c->_previousFrameDrawCallsQueue.end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
|
||||
c->_previousFrameDrawCallsQueue = c->_drawCallsQueue;
|
||||
c->_drawCallsQueue.clear();
|
||||
|
||||
|
||||
tglDisposeResources(c);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue