[core] Moved Painter::setup() to Painter ctor

This commit is contained in:
Bruno de Oliveira Abinader
2015-10-20 12:11:58 -07:00
parent ad3078e73d
commit 0045eef00a
3 changed files with 3 additions and 7 deletions

View File

@@ -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) {

View File

@@ -43,6 +43,7 @@
using namespace mbgl;
Painter::Painter(MapData& data_) : data(data_) {
setup();
}
Painter::~Painter() {

View File

@@ -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);