forked from organicmaps/organicmaps
Added rendering invalidation
This commit is contained in:
parent
cad3a4536f
commit
5ff1caa2fa
8 changed files with 34 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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, ());
|
||||
}
|
||||
|
|
|
@ -38,7 +38,8 @@ public:
|
|||
RemoveRoute,
|
||||
FlushRoute,
|
||||
UpdateMapStyle,
|
||||
InvalidateTextures
|
||||
InvalidateTextures,
|
||||
Invalidate
|
||||
};
|
||||
|
||||
virtual ~Message() {}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -394,6 +394,8 @@ typedef NS_ENUM(NSUInteger, UserTouchesAction)
|
|||
self.controlsManager.menuState = self.menuRestoreState;
|
||||
|
||||
[self refreshAd];
|
||||
|
||||
GetFramework().InvalidateRendering();
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -263,6 +263,8 @@ public:
|
|||
|
||||
void ResetLastTapEvent();
|
||||
|
||||
void InvalidateRendering();
|
||||
|
||||
private:
|
||||
struct TapEventData
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue