summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/painter_line.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-11-07 12:26:05 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-11-08 08:09:29 -0800
commit1db2ffbc1b69069eca39f786cacc45dbb02c3052 (patch)
tree9d6ed2a7302492f41c52ea3fdeadabf6466b0d8d /src/mbgl/renderer/painter_line.cpp
parent66bdbc3b969083b9d647abdf72784be64a125949 (diff)
downloadqtlocation-mapboxgl-1db2ffbc1b69069eca39f786cacc45dbb02c3052.tar.gz
[core] Use gl::Program to resolve some rough edges in the GL binding types
* Extract `ignore` util to separate header. * `Segment` now tracks offset and length of indices, rather than primitives. This is more natural. * Introduce `VertexVector` and `IndexVector` types. These types carry information about the intended draw mode (`Triangles`, `LineStrip`, etc.), and ensure that elements are always appended in a group size appropriate for that draw mode, for both indexed and unindexed rendering. * `Program`, rather than `Drawable`, is now the unifying object for draw calls. `Program` is the best place to type check the draw call, because it is typed to carry information about the intended primitive, vertex type, attributes, and uniforms. * Use the debug shaders for debug tile rendering, like gl-js. * Fix the draw mode for background. It was drawing triangle strips with a triangles array. Surprised this didn’t cause issues. Now it’s type checked.
Diffstat (limited to 'src/mbgl/renderer/painter_line.cpp')
-rw-r--r--src/mbgl/renderer/painter_line.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mbgl/renderer/painter_line.cpp b/src/mbgl/renderer/painter_line.cpp
index 7f9556fd3f..a495edc428 100644
--- a/src/mbgl/renderer/painter_line.cpp
+++ b/src/mbgl/renderer/painter_line.cpp
@@ -24,18 +24,17 @@ void Painter::renderLine(PaintParameters& parameters,
const auto& properties = layer.impl->paint;
auto draw = [&] (auto& program, auto&& uniformValues) {
- context.draw({
+ program.draw(
+ context,
+ gl::Triangles(),
depthModeForSublayer(0, gl::DepthMode::ReadOnly),
stencilModeForClipping(tile.clip),
colorModeForRenderPass(),
- program,
std::move(uniformValues),
- gl::Segmented<gl::Triangles>(
- *bucket.vertexBuffer,
- *bucket.indexBuffer,
- bucket.segments
- )
- });
+ *bucket.vertexBuffer,
+ *bucket.indexBuffer,
+ bucket.segments
+ );
};
if (!properties.lineDasharray.value.from.empty()) {