VideoTimer should use RenderPolicy::NeedRedraw to check the "dirtyRect" status.

This commit is contained in:
rachytski 2012-01-02 18:59:04 +04:00 committed by Alex Zolotarev
parent 431a4f85c5
commit 9768db8af6
8 changed files with 16 additions and 2 deletions

View file

@ -6,7 +6,6 @@
#include "../../../../../indexer/drawing_rules.hpp"
#include "../../../../../map/partial_render_policy.hpp"
#include "../../../../../map/framework.hpp"
#include "../../../../../std/shared_ptr.hpp"

View file

@ -104,6 +104,7 @@ BasicRenderPolicy::BasicRenderPolicy(VideoTimer * videoTimer,
m_windowHandle.reset(new WindowHandle());
m_windowHandle->setUpdatesEnabled(false);
m_windowHandle->setRenderPolicy(this);
m_windowHandle->setVideoTimer(videoTimer);
m_windowHandle->setRenderContext(primaryRC);
}

View file

@ -127,6 +127,7 @@ RenderPolicyMT::RenderPolicyMT(VideoTimer * videoTimer,
m_windowHandle.reset(new WindowHandle());
m_windowHandle->setUpdatesEnabled(false);
m_windowHandle->setRenderPolicy(this);
m_windowHandle->setVideoTimer(videoTimer);
m_windowHandle->setRenderContext(primaryRC);

View file

@ -128,6 +128,7 @@ RenderPolicyST::RenderPolicyST(VideoTimer * videoTimer,
m_windowHandle.reset(new WindowHandle());
m_windowHandle->setUpdatesEnabled(false);
m_windowHandle->setRenderPolicy(this);
m_windowHandle->setVideoTimer(videoTimer);
m_windowHandle->setRenderContext(primaryRC);

View file

@ -155,6 +155,7 @@ TilingRenderPolicyMT::TilingRenderPolicyMT(VideoTimer * videoTimer,
m_windowHandle.reset(new WindowHandle());
m_windowHandle->setUpdatesEnabled(false);
m_windowHandle->setRenderPolicy(this);
m_windowHandle->setVideoTimer(videoTimer);
m_windowHandle->setRenderContext(primaryRC);
}

View file

@ -175,6 +175,7 @@ TilingRenderPolicyST::TilingRenderPolicyST(VideoTimer * videoTimer,
m_windowHandle.reset(new WindowHandle());
m_windowHandle->setUpdatesEnabled(false);
m_windowHandle->setRenderPolicy(this);
m_windowHandle->setVideoTimer(videoTimer);
m_windowHandle->setRenderContext(primaryRC);
}

View file

@ -1,4 +1,5 @@
#include "window_handle.hpp"
#include "render_policy.hpp"
WindowHandle::WindowHandle() :
m_hasPendingUpdates(false),
@ -8,6 +9,11 @@ WindowHandle::WindowHandle() :
{
}
void WindowHandle::setRenderPolicy(RenderPolicy * renderPolicy)
{
m_renderPolicy = renderPolicy;
}
void WindowHandle::setVideoTimer(VideoTimer * videoTimer)
{
m_videoTimer = videoTimer;
@ -18,7 +24,7 @@ void WindowHandle::setVideoTimer(VideoTimer * videoTimer)
void WindowHandle::checkedFrameFn()
{
if (needRedraw())
if (m_renderPolicy->NeedRedraw())
m_stallsCount = 0;
else
++m_stallsCount;

View file

@ -16,9 +16,12 @@ namespace yg
}
}
class RenderPolicy;
class WindowHandle
{
shared_ptr<yg::gl::RenderContext> m_renderContext;
RenderPolicy * m_renderPolicy;
bool m_hasPendingUpdates;
bool m_isUpdatesEnabled;
@ -33,6 +36,7 @@ public:
WindowHandle();
virtual ~WindowHandle();
void setRenderPolicy(RenderPolicy * renderPolicy);
void setVideoTimer(VideoTimer * videoTimer);
void checkedFrameFn();