summaryrefslogtreecommitdiff
path: root/platform/android/src/native_map_view.cpp
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/android/src/native_map_view.cpp
parent3f0f4575e77ef289ca209323c0000cf743ab9db2 (diff)
downloadqtlocation-mapboxgl-a84aa453a9124867cb285f012abd97077ab2a019.tar.gz
[core] Privatize OpenGL/Context headers
Diffstat (limited to 'platform/android/src/native_map_view.cpp')
-rwxr-xr-xplatform/android/src/native_map_view.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp
index eeb4620c2e..4547eeff21 100755
--- a/platform/android/src/native_map_view.cpp
+++ b/platform/android/src/native_map_view.cpp
@@ -14,7 +14,6 @@
#include <jni/jni.hpp>
-#include <mbgl/gl/context.hpp>
#include <mbgl/map/backend_scope.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/event.hpp>
@@ -100,8 +99,8 @@ NativeMapView::~NativeMapView() {
* From mbgl::View
*/
void NativeMapView::bind() {
- getContext().bindFramebuffer = 0;
- getContext().viewport = { 0, 0, getFramebufferSize() };
+ setFramebufferBinding(0);
+ setViewportSize(getFramebufferSize());
}
/**
@@ -284,18 +283,17 @@ void NativeMapView::render(jni::JNIEnv& env) {
BackendScope guard(*this);
if (framebufferSizeChanged) {
- getContext().viewport = { 0, 0, getFramebufferSize() };
+ setViewportSize(getFramebufferSize());
framebufferSizeChanged = false;
}
- updateViewBinding();
map->render(*this);
if(snapshot){
snapshot = false;
// take snapshot
- auto image = getContext().readFramebuffer<mbgl::PremultipliedImage>(getFramebufferSize());
+ auto image = readFramebuffer(getFramebufferSize());
auto bitmap = Bitmap::CreateBitmap(env, std::move(image));
// invoke Mapview#OnSnapshotReady
@@ -1421,11 +1419,9 @@ mbgl::Size NativeMapView::getFramebufferSize() const {
return { static_cast<uint32_t>(fbWidth), static_cast<uint32_t>(fbHeight) };
}
-void NativeMapView::updateViewBinding() {
- getContext().bindFramebuffer.setCurrentValue(0);
- assert(mbgl::gl::value::BindFramebuffer::Get() == getContext().bindFramebuffer.getCurrentValue());
- getContext().viewport.setCurrentValue({ 0, 0, getFramebufferSize() });
- assert(mbgl::gl::value::Viewport::Get() == getContext().viewport.getCurrentValue());
+void NativeMapView::updateAssumedState() {
+ assumeFramebufferBinding(0);
+ assumeViewportSize(getFramebufferSize());
}
void NativeMapView::updateFps() {