passing separate clipRect parameter into DrawModel function. closes #315

This commit is contained in:
rachytski 2011-08-29 13:43:47 +03:00 committed by Alex Zolotarev
parent 3e2378f52e
commit 2ae492f3a7
7 changed files with 22 additions and 14 deletions

View file

@ -144,9 +144,9 @@ BenchmarkFramework<TModel>::BenchmarkFramework(shared_ptr<WindowHandle> const &
Settings::Get("IsBenchmarkingMT", isBenchmarkingMT);
if (isBenchmarkingMT)
base_type::SetRenderPolicy(make_shared_ptr(new BenchmarkTilingRenderPolicyMT(wh, bind(&base_type::DrawModel, this, _1, _2, _3, _4))));
base_type::SetRenderPolicy(make_shared_ptr(new BenchmarkTilingRenderPolicyMT(wh, bind(&base_type::DrawModel, this, _1, _2, _3, _4, _5))));
else
base_type::SetRenderPolicy(make_shared_ptr(new RenderPolicyST(wh, bind(&base_type::DrawModel, this, _1, _2, _3, _4))));
base_type::SetRenderPolicy(make_shared_ptr(new RenderPolicyST(wh, bind(&base_type::DrawModel, this, _1, _2, _3, _4, _5))));
m_startTime = my::FormatCurrentTime();

View file

@ -85,8 +85,8 @@ Framework<TModel>::Framework(shared_ptr<WindowHandle> windowHandle,
{
// on Android policy is created in AndroidFramework
#ifndef OMIM_OS_ANDROID
// SetRenderPolicy(make_shared_ptr(new RenderPolicyST(windowHandle, bind(&this_type::DrawModel, this, _1, _2, _3, _4))));
SetRenderPolicy(make_shared_ptr(new TilingRenderPolicyMT(windowHandle, bind(&this_type::DrawModel, this, _1, _2, _3, _4))));
// SetRenderPolicy(make_shared_ptr(new RenderPolicyST(windowHandle, bind(&this_type::DrawModel, this, _1, _2, _3, _4, _5))));
SetRenderPolicy(make_shared_ptr(new TilingRenderPolicyMT(windowHandle, bind(&this_type::DrawModel, this, _1, _2, _3, _4, _5))));
#endif
m_informationDisplay.setBottomShift(bottomShift);
#ifdef DRAW_TOUCH_POINTS
@ -290,9 +290,10 @@ template <typename TModel>
void Framework<TModel>::DrawModel(shared_ptr<PaintEvent> const & e,
ScreenBase const & screen,
m2::RectD const & selectRect,
m2::RectD const & clipRect,
int scaleLevel)
{
fwork::DrawProcessor doDraw(selectRect, screen, e, scaleLevel);
fwork::DrawProcessor doDraw(clipRect, screen, e, scaleLevel);
try
{

View file

@ -184,6 +184,7 @@ public:
void DrawModel(shared_ptr<PaintEvent> const & e,
ScreenBase const & screen,
m2::RectD const & selectRect,
m2::RectD const & clipRect,
int scaleLevel);
void Search(string const & text, SearchCallbackT callback);

View file

@ -26,7 +26,7 @@ class RenderPolicy
{
public:
typedef function<void(shared_ptr<PaintEvent>, ScreenBase const &, m2::RectD const &, int)> TRenderFn;
typedef function<void(shared_ptr<PaintEvent>, ScreenBase const &, m2::RectD const &, m2::RectD const &, int)> TRenderFn;
private:

View file

@ -37,7 +37,8 @@ void RenderPolicyST::DrawFrame(shared_ptr<PaintEvent> const & e,
e->drawer()->screen()->setInfoLayer(infoLayer);
e->drawer()->screen()->clear(bgColor());
renderFn()(e, s, s.GlobalRect(), scales::GetScaleLevel(glbRect));
renderFn()(e, s, s.GlobalRect(), s.GlobalRect(), scales::GetScaleLevel(glbRect));
infoLayer->draw(e->drawer()->screen().get(), math::Identity<double, 3>());
e->drawer()->screen()->resetInfoLayer();

View file

@ -145,16 +145,18 @@ void TileRenderer::DrawTile(core::CommandsQueue::Environment const & env,
*/
frameScreen.SetFromRect(rectInfo.m_rect);
m2::RectD selectionRect;
m2::RectD selectRect;
m2::RectD clipRect;
double const inflationSize = 24 * drawer->VisualScale();
//frameScreen.PtoG(m2::Inflate(m2::RectD(renderRect), inflationSize, inflationSize), selectionRect);
frameScreen.PtoG(m2::RectD(renderRect), selectionRect);
frameScreen.PtoG(m2::Inflate(m2::RectD(renderRect), inflationSize, inflationSize), clipRect);
frameScreen.PtoG(m2::RectD(renderRect), selectRect);
m_renderFn(
paintEvent,
frameScreen,
selectionRect,
selectRect,
clipRect,
rectInfo.m_drawScale
);

View file

@ -113,15 +113,18 @@ void TilingRenderPolicyST::DrawFrame(shared_ptr<PaintEvent> const & e, ScreenBas
m_tileScreen.SetFromRect(ri.m_rect);
m2::RectD selectionRect;
m2::RectD selectRect;
m2::RectD clipRect;
double inflationSize = 24 * GetPlatform().VisualScale();
m_tileScreen.PtoG(m2::Inflate(m2::RectD(renderRect), inflationSize, inflationSize), selectionRect);
m_tileScreen.PtoG(m2::RectD(renderRect), selectRect);
m_tileScreen.PtoG(m2::Inflate(m2::RectD(renderRect), inflationSize, inflationSize), clipRect);
renderFn()(paintEvent,
m_tileScreen,
selectionRect,
selectRect,
clipRect,
ri.m_drawScale);
m_tileDrawer->endFrame();