Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios, macos] MGLMapView size check for OpenGL 2.0 ES minimum texture …
Browse files Browse the repository at this point in the history
…size
  • Loading branch information
brunoabinader committed Apr 10, 2017
1 parent aeeda02 commit f044cb4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,11 @@ - (void)commonInit

- (mbgl::Size)size
{
return { static_cast<uint32_t>(self.bounds.size.width),
static_cast<uint32_t>(self.bounds.size.height) };
// check for minimum texture size supported by OpenGL ES 2.0
//
CGSize size = CGSizeMake(MAX(self.bounds.size.width, 64), MAX(self.bounds.size.height, 64));
return { static_cast<uint32_t>(size.width),
static_cast<uint32_t>(size.height) };
}

- (mbgl::Size)framebufferSize
Expand Down
7 changes: 5 additions & 2 deletions platform/macos/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,11 @@ - (void)commonInit {
}

- (mbgl::Size)size {
return { static_cast<uint32_t>(self.bounds.size.width),
static_cast<uint32_t>(self.bounds.size.height) };
// check for minimum texture size supported by OpenGL ES 2.0
//
CGSize size = CGSizeMake(MAX(self.bounds.size.width, 64), MAX(self.bounds.size.height, 64));
return { static_cast<uint32_t>(size.width),
static_cast<uint32_t>(size.height) };
}

- (mbgl::Size)framebufferSize {
Expand Down

0 comments on commit f044cb4

Please sign in to comment.