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

Unified Diff: experimental/iOSSampleApp/SkSampleUIView.mm

Issue 1382943004: Some iOS fixes to make SampleApp work better. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add missing comma Created 5 years, 2 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 | gyp/SampleApp.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/iOSSampleApp/SkSampleUIView.mm
diff --git a/experimental/iOSSampleApp/SkSampleUIView.mm b/experimental/iOSSampleApp/SkSampleUIView.mm
index f442f5a0741fd2405cfa5a8f4b12b64eced7e1e9..3d82627f3b786b3fc3e4239dc5cbd3ddbc28da7a 100644
--- a/experimental/iOSSampleApp/SkSampleUIView.mm
+++ b/experimental/iOSSampleApp/SkSampleUIView.mm
@@ -316,12 +316,27 @@ static FPSState gFPS;
fRasterLayer.actions = newActions;
[newActions release];
+ // rebuild argc and argv from process info
+ NSArray* arguments = [[NSProcessInfo processInfo] arguments];
+ int argc = [arguments count];
+ char** argv = new char*[argc];
+ for (int i = 0; i < argc; ++i) {
+ NSString* arg = [arguments objectAtIndex:i];
+ int strlen = [arg lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
+ argv[i] = new char[strlen+1];
+ [arg getCString:argv[i] maxLength:strlen+1 encoding:NSUTF8StringEncoding];
+ }
+
fDevManager = new SkiOSDeviceManager(fGL.fFramebuffer);
- static char* kDummyArgv = const_cast<char*>("dummyExecutableName");
- fWind = new SampleWindow(self, 1, &kDummyArgv, fDevManager);
+ fWind = new SampleWindow(self, argc, argv, fDevManager);
fWind->resize(self.frame.size.width, self.frame.size.height,
kN32_SkColorType);
+
+ for (int i = 0; i < argc; ++i) {
+ delete [] argv[i];
+ }
+ delete [] argv;
}
return self;
}
« no previous file with comments | « no previous file | gyp/SampleApp.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698