Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Archiving for MapLibre + MetalANGLE #45

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@
[submodule "maplibre-gl-js"]
path = maplibre-gl-js
url = https://github.com/maplibre/maplibre-gl-js.git
[submodule "platform/ios/platform/ios/vendor/metalangle"]
path = platform/ios/platform/ios/vendor/metalangle
url = https://github.com/kakashidinho/metalangle.git
4 changes: 2 additions & 2 deletions platform/ios/ios.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set_target_properties(mbgl-core PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC
if(MBGL_WITH_OPENGL)
target_compile_definitions(
mbgl-core
PUBLIC MBGL_USE_GLES2 GLES_SILENCE_DEPRECATION
PUBLIC MBGL_USE_GLES2
)
target_sources(
mbgl-core
Expand All @@ -32,7 +32,7 @@ if(MBGL_WITH_OPENGL)
)
target_link_libraries(
mbgl-core
PRIVATE "-framework GLKit" "-framework OpenGLES"
PRIVATE "-framework MetalANGLE"
)
endif()

Expand Down
3 changes: 2 additions & 1 deletion platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN

@class MGLMapView;
@class MGLStyle;
@class MGLContext;

typedef struct MGLStyleLayerDrawingContext {
CGSize size;
Expand All @@ -30,7 +31,7 @@ MGL_EXPORT
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#if TARGET_OS_IPHONE
@property (nonatomic, readonly) EAGLContext *context;
@property (nonatomic, readonly) MGLContext *context;
#else
@property (nonatomic, readonly) CGLContextObj context;
#endif
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ - (MGLMapView *)mapView {
}

#if TARGET_OS_IPHONE
- (EAGLContext *)context {
- (MGLContext *)context {
return self.mapView.context;
}
#else
Expand Down
14 changes: 10 additions & 4 deletions platform/ios/platform/ios/ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@
35E79F201D41266300957B9E /* MGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E79F1F1D41266300957B9E /* MGLStyleLayer_Private.h */; };
35E79F211D41266300957B9E /* MGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E79F1F1D41266300957B9E /* MGLStyleLayer_Private.h */; };
3E6465D62065767A00685536 /* LimeGreenStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E6465D42065767A00685536 /* LimeGreenStyleLayer.m */; };
3E8770612074297100B7E842 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 554180411D2E97DE00012372 /* OpenGLES.framework */; };
3EA93369F61CF70AFA50465D /* MGLRendererConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EA931BC4F087E166D538F21 /* MGLRendererConfiguration.m */; };
3EA934623AD0000B7D99C3FB /* MGLRendererConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA9337830C7738BF7F5493C /* MGLRendererConfiguration.h */; };
3EA9363147E77DD29FA06063 /* MGLRendererConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA9337830C7738BF7F5493C /* MGLRendererConfiguration.h */; };
Expand Down Expand Up @@ -370,6 +369,7 @@
A4DE3DCB23038C98005B3473 /* MGLMockGestureRecognizers.h in Sources */ = {isa = PBXBuildFile; fileRef = A4DE3DCA23038A7F005B3473 /* MGLMockGestureRecognizers.h */; };
A4DE3DCC23038CCA005B3473 /* MGLMockGestureRecognizers.m in Sources */ = {isa = PBXBuildFile; fileRef = A4DE3DC823038A07005B3473 /* MGLMockGestureRecognizers.m */; };
A4F3FB1D2254865900A30170 /* missing_icon.json in Resources */ = {isa = PBXBuildFile; fileRef = A4F3FB1C2254865900A30170 /* missing_icon.json */; };
AC3302A425EEEDB0004890E9 /* MetalANGLE.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC3302A325EEEDB0004890E9 /* MetalANGLE.framework */; };
CA0B3C022329DE9A00E4B493 /* MGLTestAssertionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = CAAA65D82321BBA900F08A39 /* MGLTestAssertionHandler.m */; };
CA0C27922076C804001CE5B7 /* MGLShapeSourceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0C27912076C804001CE5B7 /* MGLShapeSourceTests.m */; };
CA0C27942076CA19001CE5B7 /* MGLMapViewIntegrationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0C27932076CA19001CE5B7 /* MGLMapViewIntegrationTest.m */; };
Expand Down Expand Up @@ -406,6 +406,8 @@
CAFB3C15234505D500399265 /* MGLMapSnapshotter_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = CAFB3C13234505D500399265 /* MGLMapSnapshotter_Private.h */; };
CF75A91522D85E860058A5C4 /* MGLLoggingConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = CF75A91422D85E860058A5C4 /* MGLLoggingConfiguration.mm */; };
CF75A91622D85E860058A5C4 /* MGLLoggingConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = CF75A91422D85E860058A5C4 /* MGLLoggingConfiguration.mm */; };
D77F9D3D25F856CE00292F45 /* MetalANGLE.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D77F9D3C25F856CE00292F45 /* MetalANGLE.framework */; };
D77F9D3E25F856CE00292F45 /* MetalANGLE.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D77F9D3C25F856CE00292F45 /* MetalANGLE.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
DA00FC8E1D5EEB0D009AABC8 /* MGLAttributionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA00FC8C1D5EEB0D009AABC8 /* MGLAttributionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
DA00FC8F1D5EEB0D009AABC8 /* MGLAttributionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA00FC8C1D5EEB0D009AABC8 /* MGLAttributionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
DA00FC901D5EEB0D009AABC8 /* MGLAttributionInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA00FC8D1D5EEB0D009AABC8 /* MGLAttributionInfo.mm */; };
Expand All @@ -428,7 +430,6 @@
DA1DC99F1CB6E088006E619F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA1DC99E1CB6E088006E619F /* Assets.xcassets */; };
DA1F8F3D1EBD287B00367E42 /* MGLDocumentationGuideTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA1F8F3C1EBD287B00367E42 /* MGLDocumentationGuideTests.swift */; };
DA2784FC1DF02FF4001D5B8D /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA2784FB1DF02FF4001D5B8D /* Media.xcassets */; };
DA27C24E1CBB3811000B0ECD /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA27C24D1CBB3811000B0ECD /* GLKit.framework */; };
DA27C24F1CBB4C11000B0ECD /* MGLAccountManager_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8847FF1CBAFA6200AB86E3 /* MGLAccountManager_Private.h */; };
DA2DBBCE1D51E80400D38FF9 /* MGLStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA2DBBCD1D51E80400D38FF9 /* MGLStyleLayerTests.m */; };
DA2E88611CC0382C00F24E7B /* MGLGeometryTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA2E885C1CC0382C00F24E7B /* MGLGeometryTests.mm */; };
Expand Down Expand Up @@ -712,6 +713,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
D77F9D3E25F856CE00292F45 /* MetalANGLE.framework in Embed Frameworks */,
CA94E5FC237D21030037AEA0 /* Mapbox.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
Expand Down Expand Up @@ -1011,6 +1013,7 @@
A4DE3DC823038A07005B3473 /* MGLMockGestureRecognizers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLMockGestureRecognizers.m; sourceTree = "<group>"; };
A4DE3DCA23038A7F005B3473 /* MGLMockGestureRecognizers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLMockGestureRecognizers.h; sourceTree = "<group>"; };
A4F3FB1C2254865900A30170 /* missing_icon.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = missing_icon.json; sourceTree = "<group>"; };
AC3302A325EEEDB0004890E9 /* MetalANGLE.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = MetalANGLE.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CA0C27912076C804001CE5B7 /* MGLShapeSourceTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLShapeSourceTests.m; sourceTree = "<group>"; };
CA0C27932076CA19001CE5B7 /* MGLMapViewIntegrationTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLMapViewIntegrationTest.m; sourceTree = "<group>"; wrapsLines = 0; };
CA0C27952076CA50001CE5B7 /* MGLMapViewIntegrationTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLMapViewIntegrationTest.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1038,6 +1041,7 @@
CAE7AD5420F46EF5003B6782 /* MGLMapSnapshotterSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MGLMapSnapshotterSwiftTests.swift; sourceTree = "<group>"; };
CAFB3C13234505D500399265 /* MGLMapSnapshotter_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLMapSnapshotter_Private.h; sourceTree = "<group>"; };
CF75A91422D85E860058A5C4 /* MGLLoggingConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLLoggingConfiguration.mm; sourceTree = "<group>"; };
D77F9D3C25F856CE00292F45 /* MetalANGLE.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = MetalANGLE.framework; sourceTree = BUILT_PRODUCTS_DIR; };
DA00FC8C1D5EEB0D009AABC8 /* MGLAttributionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAttributionInfo.h; sourceTree = "<group>"; };
DA00FC8D1D5EEB0D009AABC8 /* MGLAttributionInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLAttributionInfo.mm; sourceTree = "<group>"; };
DA0CD58F1CF56F6A00A5F5A5 /* MGLFeatureTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLFeatureTests.mm; path = ../../darwin/test/MGLFeatureTests.mm; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1321,6 +1325,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D77F9D3D25F856CE00292F45 /* MetalANGLE.framework in Frameworks */,
CA94E5FB237D21030037AEA0 /* Mapbox.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -1343,12 +1348,12 @@
files = (
DA0BDD202407C12600DAA576 /* libmbgl-core.a in Frameworks */,
CAB369E5237471D600592F74 /* libz.tbd in Frameworks */,
AC3302A425EEEDB0004890E9 /* MetalANGLE.framework in Frameworks */,
DA35D9CE240920AB0013ECB0 /* libmbgl-vendor-csscolorparser.a in Frameworks */,
358B3DBB2359EA0F007BEB26 /* libmbgl-vendor-icu.a in Frameworks */,
DA35D9D1240920B60013ECB0 /* libmbgl-vendor-parsedate.a in Frameworks */,
358B3DB92359E4A0007BEB26 /* libsqlite3.tbd in Frameworks */,
96802766226556C5006BA4A1 /* libmbxaccounts.a in Frameworks */,
DA27C24E1CBB3811000B0ECD /* GLKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -1370,7 +1375,6 @@
buildActionMask = 2147483647;
files = (
DAA4E4081CBB6C9500178DFB /* Mapbox.framework in Frameworks */,
3E8770612074297100B7E842 /* OpenGLES.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1772,6 +1776,8 @@
DA1DC9921CB6DF24006E619F /* Frameworks */ = {
isa = PBXGroup;
children = (
D77F9D3C25F856CE00292F45 /* MetalANGLE.framework */,
AC3302A325EEEDB0004890E9 /* MetalANGLE.framework */,
DA27C24D1CBB3811000B0ECD /* GLKit.framework */,
DA4A26961CB6E795000B7809 /* Mapbox.framework */,
554180411D2E97DE00012372 /* OpenGLES.framework */,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion platform/ios/platform/ios/src/MGLMapView+Impl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#import <mbgl/gfx/renderer_backend.hpp>
#import <mbgl/map/map_observer.hpp>
#import <mbgl/util/image.hpp>
#import <MetalANGLE/MGLContext.h>

#import <UIKit/UIView.h>
#import <UIKit/UIImage.h>
Expand All @@ -18,7 +19,7 @@ class MGLMapViewImpl : public mbgl::MapObserver {
virtual mbgl::gfx::RendererBackend& getRendererBackend() = 0;

// Returns a handle to the OpenGL context object if this view is rendered with OpenGL.
virtual EAGLContext* getEAGLContext() {
virtual MGLContext* getEAGLContext() {
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion platform/ios/platform/ios/src/MGLMapView+OpenGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class MGLMapViewOpenGLImpl final : public MGLMapViewImpl,
return *this;
}

EAGLContext* getEAGLContext() override;
MGLContext* getEAGLContext() override;
void setOpaque(bool) override;
void display() override;
void setPresentsWithTransaction(bool) override;
Expand Down
79 changes: 15 additions & 64 deletions platform/ios/platform/ios/src/MGLMapView+OpenGL.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@

#include <mbgl/gl/renderable_resource.hpp>

#import <GLKit/GLKit.h>
#import <OpenGLES/EAGL.h>
#import <QuartzCore/CAEAGLLayer.h>

@interface MGLMapViewImplDelegate : NSObject <GLKViewDelegate>
@interface MGLMapViewImplDelegate : NSObject <MGLKViewDelegate>
@end

@implementation MGLMapViewImplDelegate {
Expand All @@ -22,7 +18,7 @@ - (instancetype)initWithImpl:(MGLMapViewOpenGLImpl*)impl {
return self;
}

- (void)glkView:(nonnull GLKView*)view drawInRect:(CGRect)rect {
- (void)mglkView:(MGLKView *)view drawInRect:(CGRect)rect {
_impl->render();
}

Expand Down Expand Up @@ -60,8 +56,8 @@ void bind() override {

public:
MGLMapViewImplDelegate* delegate = nil;
GLKView *glView = nil;
EAGLContext *context = nil;
MGLKView *glView = nil;
MGLContext *context = nil;
const bool atLeastiOS_12_2_0;

// We count how often the context was activated/deactivated so that we can truly deactivate it
Expand All @@ -77,8 +73,8 @@ void bind() override {

MGLMapViewOpenGLImpl::~MGLMapViewOpenGLImpl() {
auto& resource = getResource<MGLMapViewOpenGLRenderableResource>();
if (resource.context && [[EAGLContext currentContext] isEqual:resource.context]) {
[EAGLContext setCurrentContext:nil];
if (resource.context && [[MGLContext currentContext] isEqual:resource.context]) {
[MGLContext setCurrentContext:nil];
}
}

Expand All @@ -89,9 +85,7 @@ void bind() override {
}

void MGLMapViewOpenGLImpl::setPresentsWithTransaction(const bool value) {
auto& resource = getResource<MGLMapViewOpenGLRenderableResource>();
CAEAGLLayer* eaglLayer = MGL_OBJC_DYNAMIC_CAST(resource.glView.layer, CAEAGLLayer);
eaglLayer.presentsWithTransaction = value;
// No-op on Metal.
}

void MGLMapViewOpenGLImpl::display() {
Expand Down Expand Up @@ -124,22 +118,20 @@ void bind() override {
}

if (!resource.context) {
resource.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
resource.context = [[MGLContext alloc] initWithAPI:kMGLRenderingAPIOpenGLES2];
assert(resource.context);
}

resource.glView = [[GLKView alloc] initWithFrame:mapView.bounds context:resource.context];
resource.glView = [[MGLKView alloc] initWithFrame:mapView.bounds context:resource.context];
resource.glView.delegate = resource.delegate;
resource.glView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
resource.glView.contentScaleFactor = contentScaleFactor();
resource.glView.contentMode = UIViewContentModeCenter;
resource.glView.drawableStencilFormat = GLKViewDrawableStencilFormat8;
resource.glView.drawableDepthFormat = GLKViewDrawableDepthFormat16;
resource.glView.drawableStencilFormat = MGLDrawableStencilFormat8;
resource.glView.drawableDepthFormat = MGLDrawableDepthFormat16;
resource.glView.opaque = mapView.opaque;
resource.glView.layer.opaque = mapView.opaque;
resource.glView.enableSetNeedsDisplay = NO;
CAEAGLLayer* eaglLayer = MGL_OBJC_DYNAMIC_CAST(resource.glView.layer, CAEAGLLayer);
eaglLayer.presentsWithTransaction = NO;

[mapView insertSubview:resource.glView atIndex:0];
}
Expand All @@ -150,49 +142,8 @@ void bind() override {
}

void MGLMapViewOpenGLImpl::deleteView() {
auto& resource = getResource<MGLMapViewOpenGLRenderableResource>();
[resource.glView deleteDrawable];
}

#ifdef MGL_RECREATE_GL_IN_AN_EMERGENCY
// See https://github.com/mapbox/mapbox-gl-native/issues/14232
void MGLMapViewOpenGLImpl::emergencyRecreateGL() {
auto& resource = getResource<MGLMapViewOpenGLRenderableResource>();
MGLLogError(@"Rendering took too long - creating GL views");

CAEAGLLayer* eaglLayer = MGL_OBJC_DYNAMIC_CAST(resource.glView.layer, CAEAGLLayer);
eaglLayer.presentsWithTransaction = NO;

[mapView pauseRendering:nil];

// Just performing a pauseRendering:/resumeRendering: pair isn't sufficient - in this case
// we can still get errors when calling bindDrawable. Here we completely
// recreate the GLKView

[mapView.userLocationAnnotationView removeFromSuperview];
[resource.glView removeFromSuperview];

// Recreate the view
resource.glView = nil;
createView();

if (mapView.annotationContainerView) {
[resource.glView insertSubview:mapView.annotationContainerView atIndex:0];
}

[mapView updateUserLocationAnnotationView];

// Do not bind...yet

if (mapView.window) {
[mapView resumeRendering:nil];
eaglLayer = MGL_OBJC_DYNAMIC_CAST(resource.glView.layer, CAEAGLLayer);
eaglLayer.presentsWithTransaction = mapView.enablePresentsWithTransaction;
} else {
MGLLogDebug(@"No window - skipping resumeRendering");
}
// No-op on Metal
}
#endif

mbgl::gl::ProcAddress MGLMapViewOpenGLImpl::getExtensionFunctionPointer(const char* name) {
static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengles"));
Expand All @@ -210,7 +161,7 @@ void bind() override {
return;
}

[EAGLContext setCurrentContext:resource.context];
[MGLContext setCurrentContext:resource.context];
}

void MGLMapViewOpenGLImpl::deactivate() {
Expand All @@ -219,7 +170,7 @@ void bind() override {
return;
}

[EAGLContext setCurrentContext:nil];
[MGLContext setCurrentContext:nil];
}

/// This function is called before we start rendering, when iOS invokes our rendering method.
Expand Down Expand Up @@ -257,7 +208,7 @@ void bind() override {
static_cast<uint32_t>(mapView.bounds.size.height * scaleFactor) };
}

EAGLContext* MGLMapViewOpenGLImpl::getEAGLContext() {
MGLContext* MGLMapViewOpenGLImpl::getEAGLContext() {
auto& resource = getResource<MGLMapViewOpenGLRenderableResource>();
return resource.context;
}
2 changes: 1 addition & 1 deletion platform/ios/platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ - (void)didBecomeActive:(NSNotification *)notification

#pragma mark - GL / display link wake/sleep

- (EAGLContext *)context {
- (MGLContext *)context {
return _mbglView->getEAGLContext();
}

Expand Down
4 changes: 3 additions & 1 deletion platform/ios/platform/ios/src/MGLMapView_Private.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#import "MGLMapView.h"
#import "MGLUserLocationAnnotationView.h"
#import "MGLAnnotationContainerView.h"
#import <MetalANGLE/MGLContext.h>
#import <MetalANGLE/MGLKView.h>

#include <mbgl/util/size.hpp>

Expand All @@ -24,7 +26,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const _Nonnull MGLUnderlyingMapUna
@interface MGLMapView (Private)

/// The map view’s OpenGL rendering context.
@property (nonatomic, readonly, nullable) EAGLContext *context;
@property (nonatomic, readonly, nullable) MGLContext *context;

/// Currently shown popover representing the selected annotation.
@property (nonatomic, nonnull) UIView<MGLCalloutView> *calloutViewForSelectedAnnotation;
Expand Down
1 change: 1 addition & 0 deletions platform/ios/platform/ios/vendor/metalangle
Submodule metalangle added at cb3915
6 changes: 2 additions & 4 deletions src/mbgl/gl/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,8 @@ UniqueTexture Context::createUniqueTexture() {
}

bool Context::supportsVertexArrays() const {
return vertexArray &&
vertexArray->genVertexArrays &&
vertexArray->bindVertexArray &&
vertexArray->deleteVertexArrays;
// TODO: Metal: Metal does not work with vertex arrays.
return false;
}

VertexArray Context::createVertexArray() {
Expand Down
Loading