Permalink
Browse files

fixed: when rendering a capture on the GL backbuffer, mark the region…

… as dirty, prevents the capture from showing up
  • Loading branch information...
1 parent d2ecc7c commit e198a2675d9695935dc5179bce25634e67f075e1 bobo1on1 committed Nov 12, 2012
@@ -25,6 +25,7 @@
#include "settings/Settings.h"
#include "settings/GUISettings.h"
#include "guilib/GraphicContext.h"
+#include "guilib/GUIWindowManager.h"
#include "utils/log.h"
#include "utils/MathUtils.h"
#include "settings/AdvancedSettings.h"
@@ -693,3 +694,9 @@ void CBaseRenderer::SetViewMode(int viewMode)
g_settings.m_currentVideoSettings.m_CustomNonLinStretch = g_settings.m_bNonLinStretch;
g_settings.m_currentVideoSettings.m_CustomVerticalShift = g_settings.m_fVerticalShift;
}
+
+void CBaseRenderer::MarkDirty()
+{
+ g_windowManager.MarkDirty(m_destRect);
+}
+
@@ -106,6 +106,7 @@ class CBaseRenderer
void saveRotatedCoords();//saves the current state of m_rotatedDestCoords
void syncDestRectToRotatedPoints();//sync any changes of m_destRect to m_rotatedDestCoords
void restoreRotatedCoords();//restore the current state of m_rotatedDestCoords from saveRotatedCoords
+ void MarkDirty();
RESOLUTION m_resolution; // the resolution we're running in
unsigned int m_sourceWidth;
@@ -1745,6 +1745,7 @@ bool CLinuxRendererGL::RenderCapture(CRenderCapture* capture)
// new video rect is capture size
m_destRect.SetRect(0, 0, (float)capture->GetWidth(), (float)capture->GetHeight());
+ MarkDirty();
syncDestRectToRotatedPoints();//syncs the changed destRect to m_rotatedDestCoords
//invert Y axis to get non-inverted image
@@ -1316,6 +1316,7 @@ bool CLinuxRendererGLES::RenderCapture(CRenderCapture* capture)
// new video rect is thumbnail size
m_destRect.SetRect(0, 0, (float)capture->GetWidth(), (float)capture->GetHeight());
+ MarkDirty();
syncDestRectToRotatedPoints();//syncs the changed destRect to m_rotatedDestCoords
// clear framebuffer and invert Y axis to get non-inverted image
glDisable(GL_BLEND);
@@ -520,6 +520,11 @@ void CGUIWindowManager::MarkDirty()
m_tracker.MarkDirtyRegion(CRect(0, 0, (float)g_graphicsContext.GetWidth(), (float)g_graphicsContext.GetHeight()));
}
+void CGUIWindowManager::MarkDirty(const CRect& rect)
+{
+ m_tracker.MarkDirtyRegion(rect);
+}
+
void CGUIWindowManager::RenderPass()
{
CGUIWindow* pWindow = GetWindow(GetActiveWindow());
@@ -75,6 +75,10 @@ class CGUIWindowManager
*/
void MarkDirty();
+ /*! \brief Mark a region as dirty, forcing a redraw at the next Render()
+ */
+ void MarkDirty(const CRect& rect);
+
/*! \brief Get the current dirty region
*/
CDirtyRegionList GetDirty() { return m_tracker.GetDirtyRegions(); }

0 comments on commit e198a26

Please sign in to comment.