Added rendering invalidation

This commit is contained in:
r.kuznetsov 2015-11-12 17:33:35 +03:00
parent cad3a4536f
commit 5ff1caa2fa
8 changed files with 34 additions and 1 deletions

View file

@ -96,6 +96,13 @@ void DrapeEngine::Resize(int w, int h)
ResizeImpl(w, h);
}
void DrapeEngine::Invalidate()
{
m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread,
make_unique_dp<InvalidateMessage>(),
MessagePriority::High);
}
void DrapeEngine::AddTouchEvent(TouchEvent const & event)
{
AddUserEvent(event);

View file

@ -62,6 +62,7 @@ public:
~DrapeEngine();
void Resize(int w, int h);
void Invalidate();
void AddTouchEvent(TouchEvent const & event);
void Scale(double factor, m2::PointD const & pxPoint, bool isAnim);

View file

@ -381,6 +381,12 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
break;
}
case Message::Invalidate:
{
// Do nothing here, new frame will be rendered because of this message processing.
break;
}
default:
ASSERT(false, ());
}

View file

@ -38,7 +38,8 @@ public:
RemoveRoute,
FlushRoute,
UpdateMapStyle,
InvalidateTextures
InvalidateTextures,
Invalidate
};
virtual ~Message() {}

View file

@ -588,4 +588,12 @@ public:
Type GetType() const override { return Message::InvalidateTextures; }
};
class InvalidateMessage : public Message
{
public:
InvalidateMessage(){}
Type GetType() const override { return Message::Invalidate; }
};
} // namespace df

View file

@ -394,6 +394,8 @@ typedef NS_ENUM(NSUInteger, UserTouchesAction)
self.controlsManager.menuState = self.menuRestoreState;
[self refreshAd];
GetFramework().InvalidateRendering();
}
- (void)viewDidLoad

View file

@ -1625,6 +1625,12 @@ void Framework::ResetLastTapEvent()
m_lastTapEvent.reset();
}
void Framework::InvalidateRendering()
{
if (m_drapeEngine != nullptr)
m_drapeEngine->Invalidate();
}
UserMark const * Framework::OnTapEventImpl(m2::PointD pxPoint, bool isLong, bool isMyPosition, FeatureID feature)
{
if (isMyPosition)

View file

@ -263,6 +263,8 @@ public:
void ResetLastTapEvent();
void InvalidateRendering();
private:
struct TapEventData
{