summaryrefslogtreecommitdiff
path: root/platform/macos/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-02-27 18:33:16 +0100
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-03-23 14:50:11 -0700
commit8e5214144ec4f3a4fb40b7a7e4d8f09fd10dbb78 (patch)
treecf79b67b4af670438cbc79a524be82e88da83904 /platform/macos/src
parentd7227e13a7a87cf50a4c8c1f0615fc565f5a2679 (diff)
downloadqtlocation-mapboxgl-8e5214144ec4f3a4fb40b7a7e4d8f09fd10dbb78.tar.gz
[core] Ensure that a BackendScope exists when doing GL calls
Diffstat (limited to 'platform/macos/src')
-rw-r--r--platform/macos/src/MGLMapView.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index 028d41ceda..ef1c0f3bc1 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -29,6 +29,7 @@
#import <mbgl/gl/extension.hpp>
#import <mbgl/gl/context.hpp>
#import <mbgl/map/backend.hpp>
+#import <mbgl/map/backend_scope.hpp>
#import <mbgl/sprite/sprite_image.hpp>
#import <mbgl/storage/default_file_source.hpp>
#import <mbgl/storage/network_status.hpp>
@@ -780,6 +781,8 @@ public:
return reinterpret_cast<mbgl::gl::glProc>(symbol);
});
+ // The OpenGL implementation automatically enables the OpenGL context for us.
+ mbgl::BackendScope scope { *_mbglView, mbgl::BackendScope::ScopeType::Implicit };
_mbglView->updateViewBinding();
_mbglMap->render(*_mbglView);
@@ -2872,7 +2875,8 @@ public:
fbo = mbgl::gl::value::BindFramebuffer::Get();
getContext().bindFramebuffer.setCurrentValue(fbo);
getContext().viewport.setCurrentValue(getViewport());
- assert(mbgl::gl::value::Viewport::Get() == getContext().viewport.getCurrentValue());
+ auto actualViewport = mbgl::gl::value::Viewport::Get();
+ assert(actualViewport == getContext().viewport.getCurrentValue());
}
void bind() override {