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

Side by Side Diff: experimental/iOSSampleApp/Shared/skia_ios.mm

Issue 1054073003: Minimal Changes to run tests on iOS (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 #import <UIKit/UIKit.h> 1 #import <UIKit/UIKit.h>
2 #include "SkApplication.h" 2 #include "SkApplication.h"
3 3
4 int main(int argc, char *argv[]) { 4 int main(int argc, char *argv[]) {
5 signal(SIGPIPE, SIG_IGN); 5 signal(SIGPIPE, SIG_IGN);
6 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 6 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
7 application_init(); 7 application_init();
8
8 // Identify the documents directory 9 // Identify the documents directory
9 NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 10 NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
10 NSString *docsDir = [dirPaths objectAtIndex:0]; 11 NSString *docsDir = [dirPaths objectAtIndex:0];
11 const char *d = [docsDir UTF8String]; 12 NSString *resourceDir = [docsDir stringByAppendingString:@"/resources"];
12 IOS_launch_type launchType = set_cmd_line_args(argc, argv, d); 13 const char *d = [resourceDir UTF8String];
13 int retVal = launchType == kApplication__iOSLaunchType 14
14 ? UIApplicationMain(argc, argv, nil, nil) : (int) launchType; 15 // change to the dcouments directory. To allow the 'writePath' flag to use r elative paths.
16 NSFileManager *filemgr = [NSFileManager defaultManager];
17 int retVal = 99;
18 if ([filemgr changeCurrentDirectoryPath: docsDir] == YES)
19 {
20 IOS_launch_type launchType = set_cmd_line_args(argc, argv, d);
21 retVal = launchType == kApplication__iOSLaunchType
22 ? UIApplicationMain(argc, argv, nil, nil) : (int) launchType;
23 }
15 application_term(); 24 application_term();
25 [filemgr release];
16 [pool release]; 26 [pool release];
17 return retVal; 27 return retVal;
18 } 28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698