summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-07-18 15:58:09 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-07-19 09:31:07 -0700
commit72b7e39074056eb5317fe98660488a0b0a13fbe9 (patch)
tree16dd04c55c9f37ce23b4d45f272bd1206e2c6382 /src
parent8c908b33d7ccb34401854d4370cb61f522ad7866 (diff)
downloadqtlocation-mapboxgl-72b7e39074056eb5317fe98660488a0b0a13fbe9.tar.gz
[core] Inline Painter::renderPass
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/renderer/painter.cpp77
-rw-r--r--src/mbgl/renderer/painter.hpp6
2 files changed, 42 insertions, 41 deletions
diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp
index 903229dfeb..7d101f1530 100644
--- a/src/mbgl/renderer/painter.cpp
+++ b/src/mbgl/renderer/painter.cpp
@@ -259,17 +259,51 @@ void Painter::render(RenderStyle& style, const FrameData& frame_, View& view) {
// - OPAQUE PASS -------------------------------------------------------------------------------
// Render everything top-to-bottom by using reverse iterators. Render opaque objects first.
- renderPass(parameters,
- RenderPass::Opaque,
- order.rbegin(), order.rend(),
- 0, 1);
+ {
+ pass = RenderPass::Opaque;
+ MBGL_DEBUG_GROUP(context, "opaque");
+
+ if (debug::renderTree) {
+ Log::Info(Event::Render, "%*s%s {", indent++ * 4, "", "opaque");
+ }
+
+ uint32_t i = 0;
+ for (auto it = order.rbegin(); it != order.rend(); ++it, ++i) {
+ currentLayer = i;
+ if (it->layer.hasRenderPass(pass)) {
+ MBGL_DEBUG_GROUP(context, it->layer.getID());
+ it->layer.render(*this, parameters, it->source);
+ }
+ }
+
+ if (debug::renderTree) {
+ Log::Info(Event::Render, "%*s%s", --indent * 4, "", "}");
+ }
+ }
// - TRANSLUCENT PASS --------------------------------------------------------------------------
// Make a second pass, rendering translucent objects. This time, we render bottom-to-top.
- renderPass(parameters,
- RenderPass::Translucent,
- order.begin(), order.end(),
- static_cast<uint32_t>(order.size()) - 1, -1);
+ {
+ pass = RenderPass::Translucent;
+ MBGL_DEBUG_GROUP(context, "translucent");
+
+ if (debug::renderTree) {
+ Log::Info(Event::Render, "%*s%s {", indent++ * 4, "", "translucent");
+ }
+
+ uint32_t i = static_cast<uint32_t>(order.size()) - 1;
+ for (auto it = order.begin(); it != order.end(); ++it, --i) {
+ currentLayer = i;
+ if (it->layer.hasRenderPass(pass)) {
+ MBGL_DEBUG_GROUP(context, it->layer.getID());
+ it->layer.render(*this, parameters, it->source);
+ }
+ }
+
+ if (debug::renderTree) {
+ Log::Info(Event::Render, "%*s%s", --indent * 4, "", "}");
+ }
+ }
if (debug::renderTree) { Log::Info(Event::Render, "}"); indent--; }
@@ -325,33 +359,6 @@ void Painter::render(RenderStyle& style, const FrameData& frame_, View& view) {
}
}
-template <class Iterator>
-void Painter::renderPass(PaintParameters& parameters,
- RenderPass pass_,
- Iterator it, Iterator end,
- uint32_t i, int8_t increment) {
- pass = pass_;
-
- MBGL_DEBUG_GROUP(context, pass == RenderPass::Opaque ? "opaque" : "translucent");
-
- if (debug::renderTree) {
- Log::Info(Event::Render, "%*s%s {", indent++ * 4, "",
- pass == RenderPass::Opaque ? "opaque" : "translucent");
- }
-
- for (; it != end; ++it, i += increment) {
- currentLayer = i;
- if (it->layer.hasRenderPass(pass)) {
- MBGL_DEBUG_GROUP(context, it->layer.getID());
- it->layer.render(*this, parameters, it->source);
- }
- }
-
- if (debug::renderTree) {
- Log::Info(Event::Render, "%*s%s", --indent * 4, "", "}");
- }
-}
-
mat4 Painter::matrixForTile(const UnwrappedTileID& tileID) {
mat4 matrix;
state.matrixFor(matrix, tileID);
diff --git a/src/mbgl/renderer/painter.hpp b/src/mbgl/renderer/painter.hpp
index 63f38a1fee..0b4d9e5fa9 100644
--- a/src/mbgl/renderer/painter.hpp
+++ b/src/mbgl/renderer/painter.hpp
@@ -55,12 +55,6 @@ public:
void cleanup();
bool needsAnimation() const;
- template <class Iterator>
- void renderPass(PaintParameters&,
- RenderPass,
- Iterator it, Iterator end,
- uint32_t i, int8_t increment);
-
mat4 matrixForTile(const UnwrappedTileID&);
gl::DepthMode depthModeForSublayer(uint8_t n, gl::DepthMode::Mask) const;
gl::StencilMode stencilModeForClipping(const ClipID&) const;