blob: 571a627a49d35caf0d87e36b94c0236d40677f94 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#pragma once
#include "drape_frontend/tile_key.hpp"
#include "drape/pointers.hpp"
#include "drape/glstate.hpp"
#include "drape/render_bucket.hpp"
#include "std/vector.hpp"
#include "std/set.hpp"
class ScreenBase;
namespace dp { class OverlayTree; }
namespace df
{
class RenderGroup
{
public:
RenderGroup(dp::GLState const & state, TileKey const & tileKey);
~RenderGroup();
void Update(ScreenBase const & modelView);
void CollectOverlay(dp::RefPointer<dp::OverlayTree> tree);
void Render(ScreenBase const & screen);
void PrepareForAdd(size_t countForAdd);
void AddBucket(dp::TransferPointer<dp::RenderBucket> bucket);
dp::GLState const & GetState() const { return m_state; }
TileKey const & GetTileKey() const { return m_tileKey; }
bool IsEmpty() const { return m_renderBuckets.empty(); }
void DeleteLater() const { m_pendingOnDelete = true; }
bool IsPendingOnDelete() const { return m_pendingOnDelete; }
bool IsLess(RenderGroup const & other) const;
private:
dp::GLState m_state;
TileKey m_tileKey;
vector<dp::MasterPointer<dp::RenderBucket> > m_renderBuckets;
mutable bool m_pendingOnDelete;
};
class RenderBucketComparator
{
public:
RenderBucketComparator(set<TileKey> const & activeTiles);
void ResetInternalState();
bool operator()(RenderGroup const * l, RenderGroup const * r);
private:
set<TileKey> const & m_activeTiles;
bool m_needGroupMergeOperation;
bool m_needBucketsMergeOperation;
};
} // namespace df
|