[core] Split style image collection from SpriteAtlas

This commit is contained in:
Ivo van Dongen
2017-05-12 23:19:00 +03:00
committed by John Firebaugh
parent c80f3e9d29
commit cc9f040a2d
33 changed files with 677 additions and 413 deletions

View File

@@ -6,14 +6,14 @@
- (nullable instancetype)initWithMGLStyleImage:(const mbgl::style::Image *)styleImage
{
CGImageRef image = CGImageFromMGLPremultipliedImage(styleImage->image.clone());
CGImageRef image = CGImageFromMGLPremultipliedImage(styleImage->getImage().clone());
if (!image) {
return nil;
}
if (self = [self initWithCGImage:image scale:styleImage->pixelRatio orientation:UIImageOrientationUp])
if (self = [self initWithCGImage:image scale:styleImage->getPixelRatio() orientation:UIImageOrientationUp])
{
if (styleImage->sdf)
if (styleImage->isSdf())
{
self = [self imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}

View File

@@ -16,7 +16,7 @@
}
- (nullable instancetype)initWithMGLStyleImage:(const mbgl::style::Image *)styleImage {
CGImageRef image = CGImageFromMGLPremultipliedImage(styleImage->image.clone());
CGImageRef image = CGImageFromMGLPremultipliedImage(styleImage->getImage().clone());
if (!image) {
return nil;
}
@@ -25,7 +25,7 @@
CGImageRelease(image);
if (self = [self initWithSize:NSMakeSize(styleImage->getWidth(), styleImage->getHeight())]) {
[self addRepresentation:rep];
[self setTemplate:styleImage->sdf];
[self setTemplate:styleImage->isSdf()];
}
return self;
}