Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3158)

Unified Diff: experimental/iOSSampleApp/Shared/skia_ios.mm

Issue 373383003: ios fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: only build gyp on ios Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | experimental/iOSShell/iOSShell-Info.plist » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/iOSSampleApp/Shared/skia_ios.mm
diff --git a/experimental/iOSSampleApp/Shared/skia_ios.mm b/experimental/iOSSampleApp/Shared/skia_ios.mm
index 65b3e8a034cc1c1ca9c97622091811bf3096eeb5..4fce1392d81fc692044b9dfadb4cb61ad6de83dd 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;
« no previous file with comments | « no previous file | experimental/iOSShell/iOSShell-Info.plist » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698