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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | gyp/SampleApp.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #import "SkSampleUIView.h" 8 #import "SkSampleUIView.h"
9 9
10 //#define SKGL_CONFIG kEAGLColorFormatRGB565 10 //#define SKGL_CONFIG kEAGLColorFormatRGB565
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 NSMutableDictionary *newActions = [[NSMutableDictionary alloc] initWithO bjectsAndKeys:[NSNull null], @"onOrderIn", 309 NSMutableDictionary *newActions = [[NSMutableDictionary alloc] initWithO bjectsAndKeys:[NSNull null], @"onOrderIn",
310 [NSNull null], @"onOrderOut", 310 [NSNull null], @"onOrderOut",
311 [NSNull null], @"sublayers", 311 [NSNull null], @"sublayers",
312 [NSNull null], @"contents", 312 [NSNull null], @"contents",
313 [NSNull null], @"bounds", 313 [NSNull null], @"bounds",
314 nil]; 314 nil];
315 fGLLayer.actions = newActions; 315 fGLLayer.actions = newActions;
316 fRasterLayer.actions = newActions; 316 fRasterLayer.actions = newActions;
317 [newActions release]; 317 [newActions release];
318 318
319 // rebuild argc and argv from process info
320 NSArray* arguments = [[NSProcessInfo processInfo] arguments];
321 int argc = [arguments count];
322 char** argv = new char*[argc];
323 for (int i = 0; i < argc; ++i) {
324 NSString* arg = [arguments objectAtIndex:i];
325 int strlen = [arg lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
326 argv[i] = new char[strlen+1];
327 [arg getCString:argv[i] maxLength:strlen+1 encoding:NSUTF8StringEnco ding];
328 }
329
319 fDevManager = new SkiOSDeviceManager(fGL.fFramebuffer); 330 fDevManager = new SkiOSDeviceManager(fGL.fFramebuffer);
320 static char* kDummyArgv = const_cast<char*>("dummyExecutableName"); 331 fWind = new SampleWindow(self, argc, argv, fDevManager);
321 fWind = new SampleWindow(self, 1, &kDummyArgv, fDevManager);
322 332
323 fWind->resize(self.frame.size.width, self.frame.size.height, 333 fWind->resize(self.frame.size.width, self.frame.size.height,
324 kN32_SkColorType); 334 kN32_SkColorType);
335
336 for (int i = 0; i < argc; ++i) {
337 delete [] argv[i];
338 }
339 delete [] argv;
325 } 340 }
326 return self; 341 return self;
327 } 342 }
328 343
329 - (void)dealloc { 344 - (void)dealloc {
330 delete fDevManager; 345 delete fDevManager;
331 delete fFPSState; 346 delete fFPSState;
332 self.fRasterLayer = nil; 347 self.fRasterLayer = nil;
333 self.fGLLayer = nil; 348 self.fGLLayer = nil;
334 [fGL.fContext release]; 349 [fGL.fContext release];
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer); 486 glBindRenderbuffer(GL_RENDERBUFFER, fGL.fRenderbuffer);
472 glGetRenderbufferParameteriv(GL_RENDERBUFFER, 487 glGetRenderbufferParameteriv(GL_RENDERBUFFER,
473 GL_RENDERBUFFER_STENCIL_SIZE, 488 GL_RENDERBUFFER_STENCIL_SIZE,
474 &info->fStencilBits); 489 &info->fStencilBits);
475 glGetRenderbufferParameteriv(GL_RENDERBUFFER, 490 glGetRenderbufferParameteriv(GL_RENDERBUFFER,
476 GL_RENDERBUFFER_SAMPLES_APPLE, 491 GL_RENDERBUFFER_SAMPLES_APPLE,
477 &info->fSampleCount); 492 &info->fSampleCount);
478 } 493 }
479 494
480 @end 495 @end
OLDNEW
« 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