aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmarshallnz <jcmarsha@gmail.com>2014-02-10 13:14:00 +1300
committerjmarshallnz <jcmarsha@gmail.com>2014-02-10 13:14:00 +1300
commit699163e7b67de1c6ec6429dd9ebe94f48779b7be (patch)
tree6428a9176766d954091ccd9447b835613db453c8
parent79140d73fda67567b6624d936ebbf1bdeea08845 (diff)
parent92179e97d9efd92f21c10f0f323f6c4c7d2c43e6 (diff)
Merge pull request #4078 from afedchin/fix_gui_3d
[3d] fix stretched gui in sbs/ou mode when using hq scalers
-rw-r--r--xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp8
-rw-r--r--xbmc/cores/VideoRenderers/WinRenderer.cpp5
-rw-r--r--xbmc/rendering/RenderSystem.h1
-rw-r--r--xbmc/rendering/dx/RenderSystemDX.cpp8
-rw-r--r--xbmc/rendering/dx/RenderSystemDX.h1
5 files changed, 23 insertions, 0 deletions
diff --git a/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp b/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp
index f619cba69d..17e9415447 100644
--- a/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp
+++ b/xbmc/cores/VideoRenderers/VideoShaders/WinVideoFilter.cpp
@@ -203,6 +203,10 @@ bool CWinShader::Execute(std::vector<LPDIRECT3DSURFACE9> *vecRT, unsigned int ve
oldRT->Release();
}
+ // MSDN says: Setting a new render target will cause the viewport
+ // to be set to the full size of the new render target.
+ // So we need restore our viewport
+ g_Windowing.RestoreViewPort();
return true;
}
@@ -769,6 +773,10 @@ bool CConvolutionShaderSeparable::ClearIntermediateRenderTarget()
currentRT->Release();
intermediateRT->Release();
+ // MSDN says: Setting a new render target will cause the viewport
+ // to be set to the full size of the new render target.
+ // So we need restore our viewport
+ g_Windowing.RestoreViewPort();
return true;
}
diff --git a/xbmc/cores/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoRenderers/WinRenderer.cpp
index df7f27ba16..cc8fa4cdb7 100644
--- a/xbmc/cores/VideoRenderers/WinRenderer.cpp
+++ b/xbmc/cores/VideoRenderers/WinRenderer.cpp
@@ -954,6 +954,11 @@ void CWinRenderer::Stage1()
// Restore the render target
pD3DDevice->SetRenderTarget(0, oldRT);
+ // MSDN says: Setting a new render target will cause the viewport
+ // to be set to the full size of the new render target.
+ // So we need restore our viewport
+ g_Windowing.RestoreViewPort();
+
oldRT->Release();
newRT->Release();
}
diff --git a/xbmc/rendering/RenderSystem.h b/xbmc/rendering/RenderSystem.h
index 2bceb67190..fa64ebae36 100644
--- a/xbmc/rendering/RenderSystem.h
+++ b/xbmc/rendering/RenderSystem.h
@@ -108,6 +108,7 @@ public:
virtual void SetViewPort(CRect& viewPort) = 0;
virtual void GetViewPort(CRect& viewPort) = 0;
+ virtual void RestoreViewPort() {};
virtual void SetScissors(const CRect &rect) = 0;
virtual void ResetScissors() = 0;
diff --git a/xbmc/rendering/dx/RenderSystemDX.cpp b/xbmc/rendering/dx/RenderSystemDX.cpp
index 654c23fbd9..527ba8b8a6 100644
--- a/xbmc/rendering/dx/RenderSystemDX.cpp
+++ b/xbmc/rendering/dx/RenderSystemDX.cpp
@@ -954,6 +954,14 @@ void CRenderSystemDX::SetViewPort(CRect& viewPort)
m_pD3DDevice->SetViewport(&m_viewPort);
}
+void CRenderSystemDX::RestoreViewPort()
+{
+ if (!m_bRenderCreated)
+ return;
+
+ m_pD3DDevice->SetViewport(&m_viewPort);
+}
+
void CRenderSystemDX::SetScissors(const CRect& rect)
{
if (!m_bRenderCreated)
diff --git a/xbmc/rendering/dx/RenderSystemDX.h b/xbmc/rendering/dx/RenderSystemDX.h
index 197fc8f3af..0697bed8be 100644
--- a/xbmc/rendering/dx/RenderSystemDX.h
+++ b/xbmc/rendering/dx/RenderSystemDX.h
@@ -61,6 +61,7 @@ public:
virtual void SetViewPort(CRect& viewPort);
virtual void GetViewPort(CRect& viewPort);
+ virtual void RestoreViewPort();
virtual void SetScissors(const CRect &rect);
virtual void ResetScissors();