summaryrefslogtreecommitdiff
path: root/platform/darwin
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin')
-rw-r--r--platform/darwin/src/MGLOpenGLStyleLayer.mm2
-rw-r--r--platform/darwin/src/MGLRendererFrontend.h10
-rw-r--r--platform/darwin/src/headless_backend_cgl.mm (renamed from platform/darwin/src/headless_backend_cgl.cpp)9
-rw-r--r--platform/darwin/src/headless_backend_eagl.mm8
4 files changed, 11 insertions, 18 deletions
diff --git a/platform/darwin/src/MGLOpenGLStyleLayer.mm b/platform/darwin/src/MGLOpenGLStyleLayer.mm
index 945348cb03..b010e363b3 100644
--- a/platform/darwin/src/MGLOpenGLStyleLayer.mm
+++ b/platform/darwin/src/MGLOpenGLStyleLayer.mm
@@ -191,7 +191,7 @@ private:
causing the `-drawInMapView:withContext:` method to be called.
*/
- (void)setNeedsDisplay {
- [self.style.mapView setNeedsGLDisplay];
+ [self.style.mapView setNeedsRerender];
}
@end
diff --git a/platform/darwin/src/MGLRendererFrontend.h b/platform/darwin/src/MGLRendererFrontend.h
index ead6ad2660..1358f5fafa 100644
--- a/platform/darwin/src/MGLRendererFrontend.h
+++ b/platform/darwin/src/MGLRendererFrontend.h
@@ -1,7 +1,7 @@
#include <mbgl/gfx/backend_scope.hpp>
#include <mbgl/renderer/renderer.hpp>
#include <mbgl/renderer/renderer_frontend.hpp>
-#include <mbgl/gl/renderer_backend.hpp>
+#include <mbgl/gfx/renderer_backend.hpp>
#include <mbgl/util/async_task.hpp>
#include <mbgl/util/optional.hpp>
@@ -13,13 +13,13 @@
class MGLRenderFrontend : public mbgl::RendererFrontend
{
public:
- MGLRenderFrontend(std::unique_ptr<mbgl::Renderer> renderer_, MGLMapView* nativeView_, mbgl::gl::RendererBackend& mbglBackend_, bool async = false)
+ MGLRenderFrontend(std::unique_ptr<mbgl::Renderer> renderer_, MGLMapView* nativeView_, mbgl::gfx::RendererBackend& mbglBackend_, bool async = false)
: renderer(std::move(renderer_))
, nativeView(nativeView_)
, mbglBackend(mbglBackend_) {
if (async) {
asyncInvalidate.emplace([&]() {
- [nativeView setNeedsGLDisplay];
+ [nativeView setNeedsRerender];
});
}
}
@@ -35,7 +35,7 @@ public:
if (asyncInvalidate) {
asyncInvalidate->send();
} else {
- [nativeView setNeedsGLDisplay];
+ [nativeView setNeedsRerender];
}
}
@@ -69,7 +69,7 @@ public:
private:
std::unique_ptr<mbgl::Renderer> renderer;
__weak MGLMapView *nativeView = nullptr;
- mbgl::gl::RendererBackend& mbglBackend;
+ mbgl::gfx::RendererBackend& mbglBackend;
std::shared_ptr<mbgl::UpdateParameters> updateParameters;
mbgl::optional<mbgl::util::AsyncTask> asyncInvalidate;
};
diff --git a/platform/darwin/src/headless_backend_cgl.cpp b/platform/darwin/src/headless_backend_cgl.mm
index a21bcad9d0..4d13f6f705 100644
--- a/platform/darwin/src/headless_backend_cgl.cpp
+++ b/platform/darwin/src/headless_backend_cgl.mm
@@ -2,6 +2,7 @@
#include <mbgl/util/logging.hpp>
#include <OpenGL/OpenGL.h>
+#include <Foundation/NSString.h>
#include <CoreFoundation/CoreFoundation.h>
#include <string>
@@ -92,12 +93,8 @@ public:
throw std::runtime_error("Failed to load OpenGL framework.");
}
- CFStringRef str =
- CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII);
- void* symbol = CFBundleGetFunctionPointerForName(framework, str);
- CFRelease(str);
-
- return reinterpret_cast<gl::ProcAddress>(symbol);
+ return reinterpret_cast<gl::ProcAddress>(CFBundleGetFunctionPointerForName(
+ framework, (__bridge CFStringRef)[NSString stringWithUTF8String:name]));
}
void activateContext() final {
diff --git a/platform/darwin/src/headless_backend_eagl.mm b/platform/darwin/src/headless_backend_eagl.mm
index 4ccc485313..f2c7d8c2fb 100644
--- a/platform/darwin/src/headless_backend_eagl.mm
+++ b/platform/darwin/src/headless_backend_eagl.mm
@@ -26,12 +26,8 @@ public:
throw std::runtime_error("Failed to load OpenGL framework.");
}
- CFStringRef str =
- CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII);
- void* symbol = CFBundleGetFunctionPointerForName(framework, str);
- CFRelease(str);
-
- return reinterpret_cast<gl::ProcAddress>(symbol);
+ return reinterpret_cast<gl::ProcAddress>(CFBundleGetFunctionPointerForName(
+ framework, (__bridge CFStringRef)[NSString stringWithUTF8String:name]));
}
void activateContext() final {