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);
|
(*it1).rectangle.clip(renderRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!rectangles.empty()) {
|
||||||
// Execute draw calls.
|
// Execute draw calls.
|
||||||
for (DrawCallIterator it = c->_drawCallsQueue.begin(); it != c->_drawCallsQueue.end(); ++it) {
|
for (DrawCallIterator it = c->_drawCallsQueue.begin(); it != c->_drawCallsQueue.end(); ++it) {
|
||||||
Common::Rect drawCallRegion = (*it)->getDirtyRegion();
|
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
|
#if TGL_DIRTY_RECT_SHOW
|
||||||
// Draw debug rectangles.
|
// Draw debug rectangles.
|
||||||
// Note: white rectangles are rectangle that contained other 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->enableBlending(blendingEnabled);
|
||||||
c->fb->enableAlphaTest(alphaTestEnabled);
|
c->fb->enableAlphaTest(alphaTestEnabled);
|
||||||
#endif
|
#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);
|
tglDisposeResources(c);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue