#include #include #include namespace mbgl { static gfx::VertexVector> tileVertices() { gfx::VertexVector> result; result.emplace_back(gfx::Vertex({{{ 0, 0 }}})); result.emplace_back(gfx::Vertex({{{ util::EXTENT, 0 }}})); result.emplace_back(gfx::Vertex({{{ 0, util::EXTENT }}})); result.emplace_back(gfx::Vertex({{{ util::EXTENT, util::EXTENT }}})); return result; } static gfx::IndexVector quadTriangleIndices() { gfx::IndexVector result; result.emplace_back(0, 1, 2); result.emplace_back(1, 2, 3); return result; } static gfx::IndexVector tileLineStripIndices() { gfx::IndexVector result; result.emplace_back(0); result.emplace_back(1); result.emplace_back(3); result.emplace_back(2); result.emplace_back(0); return result; } static gfx::VertexVector rasterVertices() { gfx::VertexVector result; result.emplace_back(RasterProgram::layoutVertex({ 0, 0 }, { 0, 0 })); result.emplace_back(RasterProgram::layoutVertex({ util::EXTENT, 0 }, { util::EXTENT, 0 })); result.emplace_back(RasterProgram::layoutVertex({ 0, util::EXTENT }, { 0, util::EXTENT })); result.emplace_back(RasterProgram::layoutVertex({ util::EXTENT, util::EXTENT }, { util::EXTENT, util::EXTENT })); return result; } static gfx::VertexVector heatmapTextureVertices() { gfx::VertexVector result; result.emplace_back(HeatmapTextureProgram::layoutVertex({ 0, 0 })); result.emplace_back(HeatmapTextureProgram::layoutVertex({ 1, 0 })); result.emplace_back(HeatmapTextureProgram::layoutVertex({ 0, 1 })); result.emplace_back(HeatmapTextureProgram::layoutVertex({ 1, 1 })); return result; } RenderStaticData::RenderStaticData(gfx::Context& context, float pixelRatio, const optional& programCacheDir) : tileVertexBuffer(context.createVertexBuffer(tileVertices())), rasterVertexBuffer(context.createVertexBuffer(rasterVertices())), heatmapTextureVertexBuffer(context.createVertexBuffer(heatmapTextureVertices())), quadTriangleIndexBuffer(context.createIndexBuffer(quadTriangleIndices())), tileBorderIndexBuffer(context.createIndexBuffer(tileLineStripIndices())), programs(context, ProgramParameters { pixelRatio, false, programCacheDir }) #ifndef NDEBUG , overdrawPrograms(context, ProgramParameters { pixelRatio, true, programCacheDir }) #endif { tileTriangleSegments.emplace_back(0, 0, 4, 6); tileBorderSegments.emplace_back(0, 0, 4, 5); rasterSegments.emplace_back(0, 0, 4, 6); heatmapTextureSegments.emplace_back(0, 0, 4, 6); } } // namespace mbgl