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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
#pragma once
#include "drape_frontend/frame_values.hpp"
#include "drape_frontend/transit_scheme_builder.hpp"
#include "shaders/program_manager.hpp"
#include "drape/pointers.hpp"
#include "geometry/screenbase.hpp"
#include <functional>
namespace dp
{
class GraphicsContext;
} // namespace dp
namespace df
{
class DebugRectRenderer;
class OverlayTree;
class PostprocessRenderer;
class TransitSchemeRenderer
{
public:
void AddRenderData(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng,
ref_ptr<dp::OverlayTree> tree, TransitRenderData && renderData);
bool IsSchemeVisible(int zoomLevel) const;
void RenderTransit(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng,
ScreenBase const & screen, ref_ptr<PostprocessRenderer> postprocessRenderer,
FrameValues const & frameValues, ref_ptr<DebugRectRenderer> debugRectRenderer);
void CollectOverlays(ref_ptr<dp::OverlayTree> tree, ScreenBase const & modelView);
void ClearContextDependentResources(ref_ptr<dp::OverlayTree> tree);
void Clear(MwmSet::MwmId const & mwmId, ref_ptr<dp::OverlayTree> tree);
private:
void PrepareRenderData(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng,
ref_ptr<dp::OverlayTree> tree,
std::vector<TransitRenderData> & currentRenderData,
TransitRenderData && newRenderData);
void ClearRenderData(MwmSet::MwmId const & mwmId, ref_ptr<dp::OverlayTree> tree,
std::vector<TransitRenderData> & renderData);
using TRemovePredicate = std::function<bool(TransitRenderData const &)>;
void ClearRenderData(TRemovePredicate const & predicate, ref_ptr<dp::OverlayTree> tree,
std::vector<TransitRenderData> & renderData);
void RemoveOverlays(ref_ptr<dp::OverlayTree> tree, std::vector<TransitRenderData> & renderData);
void CollectOverlays(ref_ptr<dp::OverlayTree> tree, ScreenBase const & modelView,
std::vector<TransitRenderData> & renderData);
void RenderLines(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng, ScreenBase const & screen,
FrameValues const & frameValues, float pixelHalfWidth);
void RenderLinesCaps(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng,
ScreenBase const & screen, FrameValues const & frameValues, float pixelHalfWidth);
void RenderMarkers(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng, ScreenBase const & screen,
FrameValues const & frameValues, float pixelHalfWidth);
void RenderText(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng, ScreenBase const & screen,
FrameValues const & frameValues, ref_ptr<DebugRectRenderer> debugRectRenderer);
void RenderStubs(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng, ScreenBase const & screen,
FrameValues const & frameValues, ref_ptr<DebugRectRenderer> debugRectRenderer);
bool HasRenderData() const;
uint32_t m_lastRecacheId = 0;
std::vector<TransitRenderData> m_linesRenderData;
std::vector<TransitRenderData> m_linesCapsRenderData;
std::vector<TransitRenderData> m_markersRenderData;
std::vector<TransitRenderData> m_textRenderData;
std::vector<TransitRenderData> m_colorSymbolRenderData;
};
} // namespace df
|