[all] Merge View into RendererBackend

This commit is contained in:
John Firebaugh
2017-07-21 16:36:31 -07:00
parent 32bd1d54fa
commit d4cb498d7a
33 changed files with 53 additions and 98 deletions

View File

@@ -17,8 +17,6 @@
namespace mbgl {
class Backend;
class View;
class FileSource;
class Scheduler;
class RendererFrontend;

View File

@@ -1,18 +0,0 @@
#pragma once
namespace mbgl {
class Map;
class View {
public:
virtual ~View() = default;
// Called when this View is used for rendering. Implementations should ensure that a renderable
// object is bound and glClear/glDraw* calls can be done. They should also make sure that
// calling .bind() repeatedly is a no-op and that the appropriate gl::Context values are
// set to the current state.
virtual void bind() = 0;
};
} // namespace mbgl

View File

@@ -20,7 +20,6 @@ class RenderedQueryOptions;
class Scheduler;
class SourceQueryOptions;
class UpdateParameters;
class View;
class Renderer {
public:
@@ -31,7 +30,7 @@ public:
void setObserver(RendererObserver*);
void render(View& view, const UpdateParameters&);
void render(const UpdateParameters&);
// Feature queries
std::vector<Feature> queryRenderedFeatures(const ScreenLineString&, const RenderedQueryOptions& options = {}) const;

View File

@@ -1,6 +1,5 @@
#pragma once
#include <mbgl/map/view.hpp>
#include <mbgl/renderer/backend_scope.hpp>
#include <mbgl/util/image.hpp>
#include <mbgl/util/size.hpp>
@@ -30,6 +29,12 @@ public:
// Called prior to rendering to update the internally assumed OpenGL state.
virtual void updateAssumedState() = 0;
// Called when this backend is used for rendering. Implementations should ensure that a renderable
// object is bound and glClear/glDraw* calls can be done. They should also make sure that
// calling .bind() repeatedly is a no-op and that the appropriate gl::Context values are
// set to the current state.
virtual void bind() = 0;
protected:
// Called with the name of an OpenGL extension that should be loaded. RendererBackend implementations
// must call the API-specific version that obtains the function pointer for this function,