[core] Moved Painter::setup() to Painter ctor
This commit is contained in:
@@ -243,11 +243,7 @@ bool MapContext::renderSync(const TransformState& state, const FrameData& frame)
|
||||
// Cleanup OpenGL objects that we abandoned since the last render call.
|
||||
glObjectStore.performCleanup();
|
||||
|
||||
if (!painter) {
|
||||
painter = std::make_unique<Painter>(data);
|
||||
painter->setup();
|
||||
}
|
||||
|
||||
if (!painter) painter = std::make_unique<Painter>(data);
|
||||
painter->render(*style, transformState, frame, data.getAnimationTime());
|
||||
|
||||
if (data.mode == MapMode::Still) {
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
using namespace mbgl;
|
||||
|
||||
Painter::Painter(MapData& data_) : data(data_) {
|
||||
setup();
|
||||
}
|
||||
|
||||
Painter::~Painter() {
|
||||
|
||||
@@ -79,8 +79,6 @@ public:
|
||||
Painter(MapData& data);
|
||||
~Painter();
|
||||
|
||||
void setup();
|
||||
|
||||
// Renders the backdrop of the OpenGL view. This also paints in areas where we don't have any
|
||||
// tiles whatsoever.
|
||||
void clear();
|
||||
@@ -132,6 +130,7 @@ public:
|
||||
bool needsAnimation() const;
|
||||
|
||||
private:
|
||||
void setup();
|
||||
void setupShaders();
|
||||
mat4 translatedMatrix(const mat4& matrix, const std::array<float, 2> &translation, const TileID &id, TranslateAnchorType anchor);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user