[core] *Tile ↔ *TileData

Tile is now the main base class; RasterTile, VectorTile, etc are its subclasses. GeometryTileData and its subclasses form the piece that's passed to the worker.
This commit is contained in:
John Firebaugh
2016-06-13 10:59:33 -07:00
parent 3ab7c1cca3
commit 5c7dfd948f
58 changed files with 814 additions and 820 deletions

View File

@@ -1,7 +1,7 @@
#include <mbgl/renderer/painter.hpp>
#include <mbgl/renderer/debug_bucket.hpp>
#include <mbgl/renderer/render_tile.hpp>
#include <mbgl/tile/tile_data.hpp>
#include <mbgl/tile/tile.hpp>
#include <mbgl/shader/plain_shader.hpp>
#include <mbgl/util/string.hpp>
#include <mbgl/gl/debugging.hpp>
@@ -16,7 +16,7 @@ void Painter::renderTileDebug(const RenderTile& tile) {
if (frame.debugOptions != MapDebugOptions::NoDebug) {
setClipping(tile.clip);
if (frame.debugOptions & (MapDebugOptions::Timestamps | MapDebugOptions::ParseStatus)) {
renderDebugText(tile.data, tile.matrix);
renderDebugText(tile.tile, tile.matrix);
}
if (frame.debugOptions & MapDebugOptions::TileBorders) {
renderDebugFrame(tile.matrix);
@@ -24,19 +24,19 @@ void Painter::renderTileDebug(const RenderTile& tile) {
}
}
void Painter::renderDebugText(TileData& tileData, const mat4 &matrix) {
void Painter::renderDebugText(Tile& tile, const mat4 &matrix) {
MBGL_DEBUG_GROUP("debug text");
config.depthTest = GL_FALSE;
if (!tileData.debugBucket || tileData.debugBucket->renderable != tileData.isRenderable() ||
tileData.debugBucket->complete != tileData.isComplete() ||
!(tileData.debugBucket->modified == tileData.modified) ||
!(tileData.debugBucket->expires == tileData.expires) ||
tileData.debugBucket->debugMode != frame.debugOptions) {
tileData.debugBucket = std::make_unique<DebugBucket>(
tileData.id, tileData.isRenderable(), tileData.isComplete(), tileData.modified,
tileData.expires, frame.debugOptions);
if (!tile.debugBucket || tile.debugBucket->renderable != tile.isRenderable() ||
tile.debugBucket->complete != tile.isComplete() ||
!(tile.debugBucket->modified == tile.modified) ||
!(tile.debugBucket->expires == tile.expires) ||
tile.debugBucket->debugMode != frame.debugOptions) {
tile.debugBucket = std::make_unique<DebugBucket>(
tile.id, tile.isRenderable(), tile.isComplete(), tile.modified,
tile.expires, frame.debugOptions);
}
config.program = plainShader->getID();
@@ -45,18 +45,18 @@ void Painter::renderDebugText(TileData& tileData, const mat4 &matrix) {
// Draw white outline
plainShader->u_color = {{ 1.0f, 1.0f, 1.0f, 1.0f }};
config.lineWidth = 4.0f * frame.pixelRatio;
tileData.debugBucket->drawLines(*plainShader, store);
tile.debugBucket->drawLines(*plainShader, store);
#ifndef GL_ES_VERSION_2_0
// Draw line "end caps"
MBGL_CHECK_ERROR(glPointSize(2));
tileData.debugBucket->drawPoints(*plainShader, store);
tile.debugBucket->drawPoints(*plainShader, store);
#endif
// Draw black text.
plainShader->u_color = {{ 0.0f, 0.0f, 0.0f, 1.0f }};
config.lineWidth = 2.0f * frame.pixelRatio;
tileData.debugBucket->drawLines(*plainShader, store);
tile.debugBucket->drawLines(*plainShader, store);
config.depthFunc.reset();
config.depthTest = GL_TRUE;