forked from organicmaps/organicmaps
[drape]new messages
This commit is contained in:
parent
3a5f907077
commit
388eb3be14
2 changed files with 54 additions and 2 deletions
|
@ -10,7 +10,11 @@ namespace df
|
|||
// in perfect world GetType never return this type
|
||||
// for this you need call SetType on subclass constructor
|
||||
Unknown,
|
||||
TileReadStarted,
|
||||
TileReadEnded,
|
||||
FlushTile,
|
||||
DropTile,
|
||||
MapShapeReaded,
|
||||
DropCoverage,
|
||||
UpdateCoverage,
|
||||
Resize,
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
#include "../geometry/rect2d.hpp"
|
||||
#include "../geometry/screenbase.hpp"
|
||||
|
||||
#include "../drape/glstate.hpp"
|
||||
#include "../drape/pointers.hpp"
|
||||
|
||||
class VertexArrayBuffer;
|
||||
namespace threads { class IRoutine; }
|
||||
|
||||
namespace df
|
||||
|
@ -16,16 +20,60 @@ namespace df
|
|||
DropCoverageMessage() { SetType(DropCoverage); }
|
||||
};
|
||||
|
||||
class DropTileMessage : public Message
|
||||
class BaseTileMessage : public Message
|
||||
{
|
||||
public:
|
||||
DropTileMessage(const TileKey & tileKey) : m_tileKey(tileKey) {}
|
||||
BaseTileMessage(const TileKey & key, Message::Type type)
|
||||
: m_tileKey(key)
|
||||
{
|
||||
SetType(type);
|
||||
}
|
||||
|
||||
const TileKey & GetKey() const { return m_tileKey; }
|
||||
|
||||
private:
|
||||
TileKey m_tileKey;
|
||||
};
|
||||
|
||||
class TileReadStartMessage : public BaseTileMessage
|
||||
{
|
||||
public:
|
||||
TileReadStartMessage(const TileKey & key)
|
||||
: BaseTileMessage(key, Message::TileReadStarted) {}
|
||||
};
|
||||
|
||||
class TileReadEndMessage : public BaseTileMessage
|
||||
{
|
||||
public:
|
||||
TileReadEndMessage(const TileKey & key)
|
||||
: BaseTileMessage(key, Message::TileReadEnded) {}
|
||||
};
|
||||
|
||||
class DropTileMessage : public BaseTileMessage
|
||||
{
|
||||
public:
|
||||
DropTileMessage(const TileKey & key)
|
||||
: BaseTileMessage(key, Message::DropTile) {}
|
||||
};
|
||||
|
||||
class FlushTileMessage : public BaseTileMessage
|
||||
{
|
||||
public:
|
||||
FlushTileMessage(const TileKey & key, const GLState state, TransferPointer<VertexArrayBuffer> buffer)
|
||||
: BaseTileMessage(key, Message::FlushTile)
|
||||
, m_state(state)
|
||||
, m_buffer(buffer)
|
||||
{
|
||||
}
|
||||
|
||||
const GLState & GetState() const { return m_state; }
|
||||
|
||||
|
||||
private:
|
||||
GLState m_state;
|
||||
TransferPointer<VertexArrayBuffer> m_buffer;
|
||||
};
|
||||
|
||||
class ResizeMessage : public Message
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Add table
Reference in a new issue