diff options
author | 2014-07-11 12:14:51 -0700 | |
---|---|---|
committer | 2014-07-11 12:14:51 -0700 | |
commit | 936b73424f7393994be832376287da988a52b993 (patch) | |
tree | 593058a39c92a62ab13de099542884aa307f6848 /experimental/iOSSampleApp/Shared/skia_ios.mm | |
parent | bc9205be0a1094e312da098348601398c210dc5a (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/iOSSampleApp/Shared/skia_ios.mm')
-rw-r--r-- | experimental/iOSSampleApp/Shared/skia_ios.mm | 11 |
1 files changed, 8 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; |