aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2014-07-11 12:14:51 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-11 12:14:51 -0700
commit936b73424f7393994be832376287da988a52b993 (patch)
tree593058a39c92a62ab13de099542884aa307f6848 /experimental
parentbc9205be0a1094e312da098348601398c210dc5a (diff)
ios fixes
skia_ios.mm Get the app's Documents directory and pass use it to set the resource path. This is a quick hack which will be replaced by a new application that is a tiny shim around a command line tool. SkImageEncoder.h SkForceLinking.cpp SkImageDecoder_CG.cpp Add support for FORCE_LINKING so iOS sees the PNG encoder and others. SkFloatBits.cpp SkPoint.cpp Handle denormalized numbers that are floored by the iOS ARM processor. SkImageDecoder_iOS.mm Remove empty encoder factory. SkTouchGesture.cpp Return early on empty state on touch rather than aborting (crashing) JpegTest.cpp Hal via stackoverflow.com says partial jpegs can be gray as well. skia_test.cpp Remove crash handler call for now to avoid link failure. OverwriteLine.h Remove fancy line overwrite for iOS. Resources.cpp Add interface to set resource directory based on runtime query. BUG=skia:2736 skia:2737 skia:2738 R=reed@google.com, halcanary@google.com, mtklein@google.com, tfarina@chromium.org Author: caryclark@google.com Review URL: https://codereview.chromium.org/373383003
Diffstat (limited to 'experimental')
-rw-r--r--experimental/iOSSampleApp/Shared/skia_ios.mm11
-rw-r--r--experimental/iOSShell/iOSShell-Info.plist43
2 files changed, 51 insertions, 3 deletions
diff --git a/experimental/iOSSampleApp/Shared/skia_ios.mm b/experimental/iOSSampleApp/Shared/skia_ios.mm
index 65b3e8a034..4fce1392d8 100644
--- a/experimental/iOSSampleApp/Shared/skia_ios.mm
+++ b/experimental/iOSSampleApp/Shared/skia_ios.mm
@@ -1,14 +1,19 @@
#import <UIKit/UIKit.h>
#include "SkApplication.h"
-extern void save_args(int argc, char *argv[]);
+extern bool set_cmd_line_args(int argc, char *argv[], const char* dir);
int main(int argc, char *argv[]) {
signal(SIGPIPE, SIG_IGN);
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
application_init();
- save_args(argc, argv);
- int retVal = UIApplicationMain(argc, argv, nil, nil);
+ // Identify the documents directory
+ NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ NSString *docsDir = [dirPaths objectAtIndex:0];
+ const char *d = [docsDir UTF8String];
+
+ bool ranCommand = set_cmd_line_args(argc, argv, d);
+ int retVal = ranCommand ? 0 : UIApplicationMain(argc, argv, nil, nil);
application_term();
[pool release];
return retVal;
diff --git a/experimental/iOSShell/iOSShell-Info.plist b/experimental/iOSShell/iOSShell-Info.plist
new file mode 100644
index 0000000000..69b62efd1c
--- /dev/null
+++ b/experimental/iOSShell/iOSShell-Info.plist
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.google.iOSShell</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>NSMainNibFile</key>
+ <string>MainWindow_iPhone</string>
+ <key>NSMainNibFile~ipad</key>
+ <string>MainWindow_iPad</string>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>