summaryrefslogtreecommitdiff
path: root/platform/ios/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-03-22 14:20:35 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-03-28 13:53:19 +0200
commita84aa453a9124867cb285f012abd97077ab2a019 (patch)
tree6181d5a39960df96e6dcd2d5c9d905c537b964fe /platform/ios/src
parent3f0f4575e77ef289ca209323c0000cf743ab9db2 (diff)
downloadqtlocation-mapboxgl-a84aa453a9124867cb285f012abd97077ab2a019.tar.gz
[core] Privatize OpenGL/Context headers
Diffstat (limited to 'platform/ios/src')
-rw-r--r--platform/ios/src/MGLMapView.mm20
1 files changed, 6 insertions, 14 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index e8bc1b4b2a..9bad58801f 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -1,7 +1,6 @@
#import "MGLMapView_Private.h"
#include <mbgl/util/logging.hpp>
-#include <mbgl/gl/context.hpp>
#import <GLKit/GLKit.h>
#import <OpenGLES/EAGL.h>
@@ -869,7 +868,6 @@ public:
// The OpenGL implementation automatically enables the OpenGL context for us.
mbgl::BackendScope scope { *_mbglView, mbgl::BackendScope::ScopeType::Implicit };
- _mbglView->updateViewBinding();
_mbglMap->render(*_mbglView);
[self updateUserLocationAnnotationView];
@@ -5322,31 +5320,25 @@ public:
MBGLView(MGLMapView* nativeView_) : nativeView(nativeView_) {
}
- mbgl::gl::value::Viewport::Type getViewport() const {
- return { 0, 0, nativeView.framebufferSize };
- }
-
/// This function is called before we start rendering, when iOS invokes our rendering method.
/// iOS already sets the correct framebuffer and viewport for us, so we need to update the
/// context state with the anticipated values.
- void updateViewBinding() {
- // We are using 0 as the placeholder value for the GLKView's framebuffer.
- getContext().bindFramebuffer.setCurrentValue(0);
- getContext().viewport.setCurrentValue(getViewport());
- assert(mbgl::gl::value::Viewport::Get() == getContext().viewport.getCurrentValue());
+ void updateAssumedState() override {
+ assumeFramebufferBinding(ImplicitFramebufferBinding);
+ assumeViewportSize(nativeView.framebufferSize);
}
void bind() override {
- if (getContext().bindFramebuffer != 0) {
+ if (!implicitFramebufferBound()) {
// Something modified our state, and we need to bind the original drawable again.
// Doing this also sets the viewport to the full framebuffer.
// Note that in reality, iOS does not use the Framebuffer 0 (it's typically 1), and we
// only use this is a placeholder value.
[nativeView.glView bindDrawable];
- updateViewBinding();
+ updateAssumedState();
} else {
// Our framebuffer is still bound, but the viewport might have changed.
- getContext().viewport = getViewport();
+ setViewportSize(nativeView.framebufferSize);
}
}