summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-07-21 16:36:31 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-07-26 09:50:38 -0700
commitd4cb498d7abc612029c575fb290eb649a4697d57 (patch)
tree9e9221873a3c51ef538402f1f7dec4055cb828e5 /src
parent32bd1d54fa777035920b58e653905e4592ef187c (diff)
downloadqtlocation-mapboxgl-d4cb498d7abc612029c575fb290eb649a4697d57.tar.gz
[all] Merge View into RendererBackend
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/gl/context.cpp1
-rw-r--r--src/mbgl/gl/context.hpp3
-rw-r--r--src/mbgl/map/transform.cpp1
-rw-r--r--src/mbgl/renderer/layers/render_custom_layer.cpp4
-rw-r--r--src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp4
-rw-r--r--src/mbgl/renderer/paint_parameters.cpp4
-rw-r--r--src/mbgl/renderer/paint_parameters.hpp6
-rw-r--r--src/mbgl/renderer/renderer.cpp4
-rw-r--r--src/mbgl/renderer/renderer_impl.cpp6
-rw-r--r--src/mbgl/renderer/renderer_impl.hpp3
-rw-r--r--src/mbgl/util/offscreen_texture.hpp7
11 files changed, 18 insertions, 25 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index 55dde604d3..e18f1e0bcf 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -1,4 +1,3 @@
-#include <mbgl/map/view.hpp>
#include <mbgl/gl/context.hpp>
#include <mbgl/gl/gl.hpp>
#include <mbgl/gl/debugging_extension.hpp>
diff --git a/src/mbgl/gl/context.hpp b/src/mbgl/gl/context.hpp
index 0dd67d2ed7..9923567276 100644
--- a/src/mbgl/gl/context.hpp
+++ b/src/mbgl/gl/context.hpp
@@ -25,9 +25,6 @@
#include <string>
namespace mbgl {
-
-class View;
-
namespace gl {
constexpr size_t TextureMax = 64;
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp
index ab10b21cc1..2bb25af28f 100644
--- a/src/mbgl/map/transform.cpp
+++ b/src/mbgl/map/transform.cpp
@@ -1,6 +1,5 @@
#include <mbgl/map/camera.hpp>
#include <mbgl/map/transform.hpp>
-#include <mbgl/map/view.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/mat4.hpp>
#include <mbgl/util/math.hpp>
diff --git a/src/mbgl/renderer/layers/render_custom_layer.cpp b/src/mbgl/renderer/layers/render_custom_layer.cpp
index 49f94a699a..ae0c4b026b 100644
--- a/src/mbgl/renderer/layers/render_custom_layer.cpp
+++ b/src/mbgl/renderer/layers/render_custom_layer.cpp
@@ -1,10 +1,10 @@
#include <mbgl/renderer/layers/render_custom_layer.hpp>
#include <mbgl/renderer/paint_parameters.hpp>
#include <mbgl/renderer/backend_scope.hpp>
+#include <mbgl/renderer/renderer_backend.hpp>
#include <mbgl/renderer/bucket.hpp>
#include <mbgl/style/layers/custom_layer_impl.hpp>
#include <mbgl/map/transform_state.hpp>
-#include <mbgl/map/view.hpp>
namespace mbgl {
@@ -70,7 +70,7 @@ void RenderCustomLayer::render(PaintParameters& paintParameters, RenderSource*)
// Reset the view back to our original one, just in case the CustomLayer changed
// the viewport or Framebuffer.
- paintParameters.view.bind();
+ paintParameters.backend.bind();
context.setDirtyState();
}
diff --git a/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp b/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp
index 27ed4d8084..6295f62b21 100644
--- a/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp
+++ b/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp
@@ -4,10 +4,10 @@
#include <mbgl/renderer/paint_parameters.hpp>
#include <mbgl/renderer/image_manager.hpp>
#include <mbgl/renderer/render_static_data.hpp>
+#include <mbgl/renderer/renderer_backend.hpp>
#include <mbgl/programs/programs.hpp>
#include <mbgl/programs/fill_extrusion_program.hpp>
#include <mbgl/tile/tile.hpp>
-#include <mbgl/map/view.hpp>
#include <mbgl/style/layers/fill_extrusion_layer_impl.hpp>
#include <mbgl/geometry/feature_index.hpp>
#include <mbgl/util/math.hpp>
@@ -131,7 +131,7 @@ void RenderFillExtrusionLayer::render(PaintParameters& parameters, RenderSource*
}
}
- parameters.view.bind();
+ parameters.backend.bind();
parameters.context.bindTexture(parameters.staticData.extrusionTexture->getTexture());
mat4 viewportMat;
diff --git a/src/mbgl/renderer/paint_parameters.cpp b/src/mbgl/renderer/paint_parameters.cpp
index fc0bd40aeb..ebdaecd3a3 100644
--- a/src/mbgl/renderer/paint_parameters.cpp
+++ b/src/mbgl/renderer/paint_parameters.cpp
@@ -9,13 +9,13 @@ namespace mbgl {
PaintParameters::PaintParameters(gl::Context& context_,
float pixelRatio_,
GLContextMode contextMode_,
- View& view_,
+ RendererBackend& backend_,
const UpdateParameters& updateParameters,
RenderStyle& style,
RenderStaticData& staticData_,
FrameHistory& frameHistory_)
: context(context_),
- view(view_),
+ backend(backend_),
state(updateParameters.transformState),
evaluatedLight(style.getRenderLight().getEvaluated()),
staticData(staticData_),
diff --git a/src/mbgl/renderer/paint_parameters.hpp b/src/mbgl/renderer/paint_parameters.hpp
index 811a99b58b..e9d3562a75 100644
--- a/src/mbgl/renderer/paint_parameters.hpp
+++ b/src/mbgl/renderer/paint_parameters.hpp
@@ -13,7 +13,7 @@
namespace mbgl {
-class View;
+class RendererBackend;
class UpdateParameters;
class RenderStyle;
class RenderStaticData;
@@ -29,14 +29,14 @@ public:
PaintParameters(gl::Context&,
float pixelRatio,
GLContextMode,
- View&,
+ RendererBackend&,
const UpdateParameters&,
RenderStyle&,
RenderStaticData&,
FrameHistory&);
gl::Context& context;
- View& view;
+ RendererBackend& backend;
const TransformState& state;
const EvaluatedLight& evaluatedLight;
diff --git a/src/mbgl/renderer/renderer.cpp b/src/mbgl/renderer/renderer.cpp
index 3c9715cd50..9f4b897d6e 100644
--- a/src/mbgl/renderer/renderer.cpp
+++ b/src/mbgl/renderer/renderer.cpp
@@ -21,8 +21,8 @@ void Renderer::setObserver(RendererObserver* observer) {
impl->setObserver(observer);
}
-void Renderer::render(View& view, const UpdateParameters& updateParameters) {
- impl->render(view, updateParameters);
+void Renderer::render(const UpdateParameters& updateParameters) {
+ impl->render(updateParameters);
}
std::vector<Feature> Renderer::queryRenderedFeatures(const ScreenLineString& geometry, const RenderedQueryOptions& options) const {
diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp
index 4c45ab167d..dd3c0d41a1 100644
--- a/src/mbgl/renderer/renderer_impl.cpp
+++ b/src/mbgl/renderer/renderer_impl.cpp
@@ -44,7 +44,7 @@ void Renderer::Impl::setObserver(RendererObserver* observer_) {
observer = observer_ ? observer_ : &nullObserver();
}
-void Renderer::Impl::render(View& view, const UpdateParameters& updateParameters) {
+void Renderer::Impl::render(const UpdateParameters& updateParameters) {
// Don't load/render anyting in still mode until explicitly requested.
if (updateParameters.mode == MapMode::Still && !updateParameters.stillImageRequest) return;
@@ -61,7 +61,7 @@ void Renderer::Impl::render(View& view, const UpdateParameters& updateParameters
backend.getContext(),
pixelRatio,
contextMode,
- view,
+ backend,
updateParameters,
*renderStyle,
*staticData,
@@ -137,7 +137,7 @@ void Renderer::Impl::doRender(PaintParameters& parameters) {
// tiles whatsoever.
{
MBGL_DEBUG_GROUP(parameters.context, "clear");
- parameters.view.bind();
+ parameters.backend.bind();
parameters.context.clear((parameters.debugOptions & MapDebugOptions::Overdraw)
? Color::black()
: renderData.backgroundColor,
diff --git a/src/mbgl/renderer/renderer_impl.hpp b/src/mbgl/renderer/renderer_impl.hpp
index 521df6ca63..079b00d0bb 100644
--- a/src/mbgl/renderer/renderer_impl.hpp
+++ b/src/mbgl/renderer/renderer_impl.hpp
@@ -13,7 +13,6 @@
namespace mbgl {
-class View;
class UpdateParameters;
class PaintParameters;
class RenderStyle;
@@ -27,7 +26,7 @@ public:
void setObserver(RendererObserver*);
- void render(View&, const UpdateParameters&);
+ void render(const UpdateParameters&);
std::vector<Feature> queryRenderedFeatures(const ScreenLineString&, const RenderedQueryOptions&) const;
std::vector<Feature> querySourceFeatures(const std::string& sourceID, const SourceQueryOptions&) const;
diff --git a/src/mbgl/util/offscreen_texture.hpp b/src/mbgl/util/offscreen_texture.hpp
index c265700555..0353f3f9c5 100644
--- a/src/mbgl/util/offscreen_texture.hpp
+++ b/src/mbgl/util/offscreen_texture.hpp
@@ -1,6 +1,5 @@
#pragma once
-#include <mbgl/map/view.hpp>
#include <mbgl/util/image.hpp>
namespace mbgl {
@@ -15,16 +14,16 @@ enum class OffscreenTextureAttachment {
Depth,
};
-class OffscreenTexture : public View {
+class OffscreenTexture {
public:
OffscreenTexture(gl::Context&,
Size size = { 256, 256 },
OffscreenTextureAttachment type = OffscreenTextureAttachment::None);
- ~OffscreenTexture() override;
+ ~OffscreenTexture();
OffscreenTexture(OffscreenTexture&&);
OffscreenTexture& operator=(OffscreenTexture&&);
- void bind() override;
+ void bind();
PremultipliedImage readStillImage();