diff --git a/gyp/SampleApp.gyp b/gyp/SampleApp.gyp index 753d3744c..e54dbe0b3 100644 --- a/gyp/SampleApp.gyp +++ b/gyp/SampleApp.gyp @@ -210,7 +210,6 @@ '../experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig', '../experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig', '../experimental/iOSSampleApp/iOSSampleApp-Info.plist', - '../experimental/iOSSampleApp/iOSSampleApp_Prefix.pch', '../experimental/iOSSampleApp/Shared/SkOptionListController.h', '../experimental/iOSSampleApp/Shared/SkOptionListController.mm', '../experimental/iOSSampleApp/Shared/SkUIRootViewController.h', @@ -248,21 +247,6 @@ '../experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig', ], 'link_settings': { - 'variables': { - 'ios_sdk_version%': '5.1', - }, - 'conditions' : [ - [ 'skia_arch_type == "x86"', { - 'variables': { - 'ios_sdk_dir%': '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator', - }, - }], - [ 'skia_arch_type == "arm"', { - 'variables': { - 'ios_sdk_dir%': '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS', - }, - }], - ], 'libraries': [ '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/CoreFoundation.framework', '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/CoreGraphics.framework', @@ -271,6 +255,8 @@ '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/Foundation.framework', '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/QuartzCore.framework', '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/OpenGLES.framework', + '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/ImageIO.framework', + '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/MobileCoreServices.framework', ], }, 'include_dirs' : [ @@ -279,7 +265,6 @@ '../experimental/iOSSampleApp/iPhone', '../include/utils/ios', ], - 'xcode_config_file': '../experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig', 'mac_bundle_resources' : [ '../experimental/iOSSampleApp/iPad/MainWindow_iPad.xib', '../experimental/iOSSampleApp/iPhone/MainWindow_iPhone.xib', diff --git a/gyp/bench.gyp b/gyp/bench.gyp index 44ebbf2d0..7a413e1d2 100644 --- a/gyp/bench.gyp +++ b/gyp/bench.gyp @@ -57,7 +57,7 @@ 'core.gyp:core', ], 'conditions': [ - [ 'skia_os != "mac"', { + [ 'skia_os not in ["mac", "ios"]', { 'sources!': [ '../bench/BenchSysTimer_mach.h', '../bench/BenchSysTimer_mach.cpp', diff --git a/gyp/common.gypi b/gyp/common.gypi index 4b558f893..b6202262d 100644 --- a/gyp/common.gypi +++ b/gyp/common.gypi @@ -75,7 +75,6 @@ 'Debug': { 'defines': [ 'SK_DEBUG', - 'SK_ENABLE_INST_COUNT', 'GR_DEBUG=1', ], }, diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi index 934eba959..2ec0ef801 100644 --- a/gyp/common_conditions.gypi +++ b/gyp/common_conditions.gypi @@ -219,13 +219,21 @@ 'GCC_OPTIMIZATION_LEVEL': '0', }, }, + 'Release': { + 'xcode_settings': { + 'GCC_OPTIMIZATION_LEVEL': '3', + }, + 'defines': [ 'NDEBUG' ], + }, }, 'xcode_settings': { - 'ARCHS': 'armv7', + 'ARCHS': 'armv6 armv7', 'CODE_SIGNING_REQUIRED': 'NO', 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '', + 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)', 'SYMROOT': '<(DEPTH)/xcodebuild', 'SDKROOT': 'iphoneos', + 'TARGETED_DEVICE_FAMILY': '1,2', 'OTHER_CPLUSPLUSFLAGS': '-fvisibility=hidden -fvisibility-inlines-hidden', }, }, diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi index ee89ca94e..8e4ab80b9 100644 --- a/gyp/common_variables.gypi +++ b/gyp/common_variables.gypi @@ -67,6 +67,11 @@ }, { 'skia_static_initializers%': 1, }], + [ 'skia_arch_type == "x86"', { + 'ios_sdk_dir%': '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator', + }, { + 'ios_sdk_dir%': '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS', + }], ], 'skia_scalar%': 'float', @@ -78,6 +83,7 @@ 'android_make_apk%': 1, 'skia_nacl%': 0, 'skia_gpu%': 1, + 'ios_sdk_version%': '5.1', 'skia_osx_sdkroot%': 'macosx10.6', }, @@ -97,6 +103,8 @@ 'skia_gpu%': '<(skia_gpu)', 'skia_osx_sdkroot%': '<(skia_osx_sdkroot)', 'skia_static_initializers%': '<(skia_static_initializers)', + 'ios_sdk_version%': '<(ios_sdk_version)', + 'ios_sdk_dir%': '<(ios_sdk_dir)', # These are referenced by our .gypi files that list files (e.g. core.gypi) # diff --git a/gyp/core.gyp b/gyp/core.gyp index b565c086a..d4d6abbd1 100644 --- a/gyp/core.gyp +++ b/gyp/core.gyp @@ -57,21 +57,6 @@ '../include/utils/mac/SkCGUtils.h', ], 'link_settings': { - 'variables': { - 'ios_sdk_version%': '5.1', - }, - 'conditions' : [ - [ 'skia_arch_type == "x86"', { - 'variables': { - 'ios_sdk_dir%': '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator', - }, - }], - [ 'skia_arch_type == "arm"', { - 'variables': { - 'ios_sdk_dir%': '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS', - }, - }], - ], 'libraries': [ '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/CoreFoundation.framework', '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/CoreGraphics.framework', @@ -80,6 +65,8 @@ '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/Foundation.framework', '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/QuartzCore.framework', '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/OpenGLES.framework', + '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/ImageIO.framework', + '<(ios_sdk_dir)<(ios_sdk_version).sdk/System/Library/Frameworks/MobileCoreServices.framework', ], }, }], diff --git a/gyp/debugger.gyp b/gyp/debugger.gyp index 3c721236e..94025382f 100644 --- a/gyp/debugger.gyp +++ b/gyp/debugger.gyp @@ -67,7 +67,7 @@ }, }], [ 'skia_os == "mac" and skia_arch_width != 64', { - 'error': '', ], }], + [ 'skia_os == "ios"', { + 'link_settings': { + 'libraries': [ + '<(ios_sdk_dir)<(ios_sdk_version).sdk/usr/lib/libz.dylib', + ], + }, + 'defines': [ 'SK_ZLIB_INCLUDE=', ], + }], [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "android"]', { 'link_settings': { 'libraries': [ '-lz', ], }, 'defines': [ 'SK_ZLIB_INCLUDE=', ], diff --git a/include/core/SkInstCnt.h b/include/core/SkInstCnt.h index 09ce0ca1b..6866be994 100644 --- a/include/core/SkInstCnt.h +++ b/include/core/SkInstCnt.h @@ -18,6 +18,10 @@ * At the end of an application a call to all the "root" objects' * CheckInstanceCount methods should be made */ +#if defined SK_DEBUG && !defined SK_ENABLE_INST_COUNT +#define SK_ENABLE_INST_COUNT +#endif + #ifdef SK_ENABLE_INST_COUNT #include #include "SkTArray.h" diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index eb87181e7..d44c56041 100644 --- a/include/core/SkTypes.h +++ b/include/core/SkTypes.h @@ -185,7 +185,7 @@ typedef uint8_t SkBool8; #define SK_MaxU16 0xFFFF #define SK_MinU16 0 #define SK_MaxS32 0x7FFFFFFF -#define SK_MinS32 0x80000001 +#define SK_MinS32 -SK_MaxS32 #define SK_MaxU32 0xFFFFFFFF #define SK_MinU32 0 #define SK_NaN32 0x80000000 diff --git a/src/ports/SkImageDecoder_CG.cpp b/src/ports/SkImageDecoder_CG.cpp index ac2eb0e03..3930c72f0 100644 --- a/src/ports/SkImageDecoder_CG.cpp +++ b/src/ports/SkImageDecoder_CG.cpp @@ -21,9 +21,7 @@ #ifdef SK_BUILD_FOR_IOS #include #include -//#include // FIXME: hack -- can't figure out how to include this -extern const CFStringRef kUTTypeJPEG __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_3_0); -extern const CFStringRef kUTTypePNG __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_3_0); +#include #endif static void malloc_release_proc(void* info, const void* data, size_t size) { diff --git a/src/views/mac/SkNSView.mm b/src/views/mac/SkNSView.mm index b3c676274..f43af64df 100644 --- a/src/views/mac/SkNSView.mm +++ b/src/views/mac/SkNSView.mm @@ -57,7 +57,9 @@ SK_COMPILE_ASSERT(SK_SUPPORT_GPU, not_implemented_for_non_gpu_build); - (void)resizeSkView:(NSSize)newSize { if (NULL != fWind && (fWind->width() != newSize.width || fWind->height() != newSize.height)) { fWind->resize((int) newSize.width, (int) newSize.height); - glClear(GL_STENCIL_BUFFER_BIT); + if (NULL != fGLContext) { + glClear(GL_STENCIL_BUFFER_BIT); + } [fGLContext update]; } }