summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-10-12 21:06:50 -0700
committerGitHub <noreply@github.com>2016-10-12 21:06:50 -0700
commitf064744c36d796b2e244ac8da6440c58600f10e9 (patch)
tree5918b28005002cf5b053a8bab8827772d933062e /platform
parenta24e559ac83a47d19e28290c7ded427adeb303a3 (diff)
downloadqtlocation-mapboxgl-f064744c36d796b2e244ac8da6440c58600f10e9.tar.gz
[macos] Fixed compilation error (#6690)
Followup to last-minute refactoring in #6637.
Diffstat (limited to 'platform')
-rw-r--r--platform/macos/src/NSImage+MGLAdditions.mm9
1 files changed, 4 insertions, 5 deletions
diff --git a/platform/macos/src/NSImage+MGLAdditions.mm b/platform/macos/src/NSImage+MGLAdditions.mm
index 7931c0b2a5..7d02271bb3 100644
--- a/platform/macos/src/NSImage+MGLAdditions.mm
+++ b/platform/macos/src/NSImage+MGLAdditions.mm
@@ -2,14 +2,13 @@
@implementation NSImage (MGLAdditions)
-- (std::unique_ptr<mbgl::SpriteImage>)mgl_spriteImage
-{
+- (std::unique_ptr<mbgl::SpriteImage>)mgl_spriteImage {
// Create a bitmap image representation from the image, respecting backing
// scale factor and any resizing done on the image at runtime.
// http://www.cocoabuilder.com/archive/cocoa/82430-nsimage-getting-raw-bitmap-data.html#82431
- [image lockFocus];
+ [self lockFocus];
NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:{ NSZeroPoint, self.size }];
- [image unlockFocus];
+ [self unlockFocus];
// Get the image’s raw pixel data as an RGBA buffer.
std::string pixelString((const char *)rep.bitmapData, rep.pixelsWide * rep.pixelsHigh * 4 /* RGBA */);
@@ -17,7 +16,7 @@
mbgl::PremultipliedImage cPremultipliedImage(rep.pixelsWide, rep.pixelsHigh);
std::copy(rep.bitmapData, rep.bitmapData + cPremultipliedImage.size(), cPremultipliedImage.data.get());
return std::make_unique<mbgl::SpriteImage>(std::move(cPremultipliedImage),
- (float)(rep.pixelsWide / self.size.width));
+ (float)(rep.pixelsWide / self.size.width));
}
@end