Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
982F2A6C27BADE17003C81F4 /* PartiallyMockedMapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 982F2A6B27BADE17003C81F4 /* PartiallyMockedMapView.m */; };
F269303B2BB389BF00BF17C4 /* assets in Resources */ = {isa = PBXBuildFile; fileRef = F269303A2BB389BF00BF17C4 /* assets */; };
F7151F13265D7ED70028CB91 /* GoogleMapsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */; };
FC8F35FC8CD533B128950487 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F267F68029D1A4E2E4C572A7 /* libPods-RunnerTests.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
F26930352BB36EF300BF17C4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
proxyType = 1;
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
remoteInfo = Runner;
};
F7151F15265D7ED70028CB91 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
Expand Down Expand Up @@ -68,6 +76,8 @@
E52C6A6210A56F027C582EF9 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
EA0E91726245EDC22B97E8B9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
F267F68029D1A4E2E4C572A7 /* libPods-RunnerTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
F269302F2BB36EF300BF17C4 /* RunnerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
F269303A2BB389BF00BF17C4 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; path = assets; sourceTree = "<group>"; };
F7151F10265D7ED70028CB91 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GoogleMapsTests.m; sourceTree = "<group>"; };
F7151F14265D7ED70028CB91 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand All @@ -82,6 +92,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F269302C2BB36EF300BF17C4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
F7151F0D265D7ED70028CB91 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -132,6 +149,7 @@
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
F7151F10265D7ED70028CB91 /* RunnerTests.xctest */,
F269302F2BB36EF300BF17C4 /* RunnerUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -174,6 +192,7 @@
F7151F11265D7ED70028CB91 /* RunnerTests */ = {
isa = PBXGroup;
children = (
F269303A2BB389BF00BF17C4 /* assets */,
F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */,
982F2A6A27BADE17003C81F4 /* PartiallyMockedMapView.h */,
982F2A6B27BADE17003C81F4 /* PartiallyMockedMapView.m */,
Expand Down Expand Up @@ -207,6 +226,24 @@
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
F269302E2BB36EF300BF17C4 /* RunnerUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = F26930392BB36EF300BF17C4 /* Build configuration list for PBXNativeTarget "RunnerUITests" */;
buildPhases = (
F269302B2BB36EF300BF17C4 /* Sources */,
F269302C2BB36EF300BF17C4 /* Frameworks */,
F269302D2BB36EF300BF17C4 /* Resources */,
);
buildRules = (
);
dependencies = (
F26930362BB36EF300BF17C4 /* PBXTargetDependency */,
);
name = RunnerUITests;
productName = RunnerUITests;
productReference = F269302F2BB36EF300BF17C4 /* RunnerUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
F7151F0F265D7ED70028CB91 /* RunnerTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = F7151F19265D7ED70028CB91 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
Expand All @@ -232,12 +269,17 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1530;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "The Flutter Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
};
F269302E2BB36EF300BF17C4 = {
CreatedOnToolsVersion = 15.3;
TestTargetID = 97C146ED1CF9000F007C117D;
};
F7151F0F265D7ED70028CB91 = {
CreatedOnToolsVersion = 12.5;
ProvisioningStyle = Automatic;
Expand All @@ -260,6 +302,7 @@
targets = (
97C146ED1CF9000F007C117D /* Runner */,
F7151F0F265D7ED70028CB91 /* RunnerTests */,
F269302E2BB36EF300BF17C4 /* RunnerUITests */,
);
};
/* End PBXProject section */
Expand All @@ -276,10 +319,18 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F269302D2BB36EF300BF17C4 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
F7151F0E265D7ED70028CB91 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F269303B2BB389BF00BF17C4 /* assets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -390,6 +441,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
F269302B2BB36EF300BF17C4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
F7151F0C265D7ED70028CB91 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -402,6 +460,11 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
F26930362BB36EF300BF17C4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 97C146ED1CF9000F007C117D /* Runner */;
targetProxy = F26930352BB36EF300BF17C4 /* PBXContainerItemProxy */;
};
F7151F16265D7ED70028CB91 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 97C146ED1CF9000F007C117D /* Runner */;
Expand Down Expand Up @@ -543,7 +606,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = S8QB4VV633;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -589,13 +652,74 @@
};
name = Release;
};
F26930372BB36EF300BF17C4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = S8QB4VV633;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = Runner;
};
name = Debug;
};
F26930382BB36EF300BF17C4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = S8QB4VV633;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = Runner;
};
name = Release;
};
F7151F17265D7ED70028CB91 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E52C6A6210A56F027C582EF9 /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = S8QB4VV633;
Comment thread
LouiseHsu marked this conversation as resolved.
Outdated
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 arm64";
INFOPLIST_FILE = RunnerTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -650,6 +774,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
F26930392BB36EF300BF17C4 /* Build configuration list for PBXNativeTarget "RunnerUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F26930372BB36EF300BF17C4 /* Debug */,
F26930382BB36EF300BF17C4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
F7151F19265D7ED70028CB91 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ @interface FLTGoogleMapFactory (Test)
@interface GoogleMapsTests : XCTestCase
@end

@interface FLTTileProviderController (Testing)
- (UIImage*)handleResultTile:(nullable UIImage*)tileImage;
@end

@implementation GoogleMapsTests

- (void)testPlugin {
Expand Down Expand Up @@ -62,4 +66,20 @@ - (void)testMapsServiceSync {
XCTAssertEqual(factory1.sharedMapServices, factory2.sharedMapServices);
}

- (void)testWideGamutImagesProperlyHandled {
Comment thread
LouiseHsu marked this conversation as resolved.
Outdated
FLTTileProviderController *controller = [[FLTTileProviderController alloc] init];

UIImage *wideGamutImage = [UIImage imageWithContentsOfFile:@"assets/widegamut.png"];

UIImage *downsampledImage = [controller handleResultTile:wideGamutImage];

CGImageRef imageRef = downsampledImage.CGImage;
CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
bool isFloat = (bitmapInfo && kCGBitmapFloatComponents);
Comment thread
LouiseHsu marked this conversation as resolved.
Outdated
size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef);

XCTAssert(isFloat == false);
Comment thread
LouiseHsu marked this conversation as resolved.
Outdated
XCTAssert(bitsPerComponent != 16);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the value actually gonna be?

@LouiseHsu LouiseHsu Mar 27, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-wide gamut imgs are 8 bit, changed to test that instead

}

@end
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,31 @@ - (instancetype)init:(FlutterMethodChannel *)methodChannel

#pragma mark - GMSTileLayer method

- (UIImage *)handleResultTile:(nullable UIImage*)tile {
CGImageRef imageRef = tile.CGImage;
CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
bool isFloat = (bitmapInfo && kCGBitmapFloatComponents);
Comment thread
LouiseHsu marked this conversation as resolved.
Outdated
size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef);

// Engine use f16 pixel format for wide gamut images
// If it is wide gamut, we want to downsample it
if (isFloat & (bitsPerComponent == 16)) {
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context =
CGBitmapContextCreate(nil, tile.size.width, tile.size.height, 8, 0,
colorSpace, kCGImageAlphaPremultipliedLast);
CGContextDrawImage(context,
CGRectMake(0, 0, tile.size.width, tile.size.height),
tile.CGImage);
CGImageRef image = CGBitmapContextCreateImage(context);
tile = [UIImage imageWithCGImage:image];
CGImageRelease(image);
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);
}
return tile;
}

- (void)requestTileForX:(NSUInteger)x
y:(NSUInteger)y
zoom:(NSUInteger)zoom
Expand All @@ -137,7 +162,7 @@ - (void)requestTileForX:(NSUInteger)x
if (typedData == nil) {
tileImage = kGMSTileLayerNoTile;
} else {
tileImage = [UIImage imageWithData:typedData.data];
tileImage = [self handleResultTile:[UIImage imageWithData:typedData.data]];
}
} else {
if ([result isKindOfClass:[FlutterError class]]) {
Expand All @@ -150,7 +175,6 @@ - (void)requestTileForX:(NSUInteger)x
}
tileImage = kGMSTileLayerNoTile;
}

[receiver receiveTileWithX:x y:y zoom:zoom image:tileImage];
}];
});
Expand Down