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

Side by Side Diff: experimental/SimpleiOSApp/SimpleApp.mm

Issue 388933003: fix ios break (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #import "SkCanvas.h" 1 #import "SkCanvas.h"
2 #import "SkPaint.h" 2 #import "SkPaint.h"
3 #import "SkWindow.h" 3 #import "SkWindow.h"
4 #include "SkGraphics.h" 4 #include "SkGraphics.h"
5 #include "SkCGUtils.h" 5 #include "SkCGUtils.h"
6 6
7 extern void tool_main(int argc, char *argv[]); 7 extern void tool_main(int argc, char *argv[]);
8 void save_args(int argc, char *argv[]); 8 extern bool set_cmd_line_args(int argc, char *argv[], const char* dir);
9 9
10 class SkSampleView : public SkView { 10 class SkSampleView : public SkView {
11 public: 11 public:
12 SkSampleView() { 12 SkSampleView() {
13 this->setVisibleP(true); 13 this->setVisibleP(true);
14 this->setClipToBounds(false); 14 this->setClipToBounds(false);
15 }; 15 };
16 protected: 16 protected:
17 virtual void onDraw(SkCanvas* canvas) { 17 virtual void onDraw(SkCanvas* canvas) {
18 canvas->drawColor(0xFFFFFFFF); 18 canvas->drawColor(0xFFFFFFFF);
(...skipping 15 matching lines...) Expand all
34 } 34 }
35 35
36 void application_term() { 36 void application_term() {
37 SkGraphics::Term(); 37 SkGraphics::Term();
38 SkEvent::Term(); 38 SkEvent::Term();
39 } 39 }
40 40
41 int saved_argc; 41 int saved_argc;
42 char** saved_argv; 42 char** saved_argv;
43 43
44 void save_args(int argc, char *argv[]) { 44 bool set_cmd_line_args(int argc, char *argv[], const char* ) {
45 saved_argc = argc; 45 saved_argc = argc;
46 saved_argv = argv; 46 saved_argv = argv;
47 return true;
47 } 48 }
48 49
49 class FillLayout : public SkView::Layout { 50 class FillLayout : public SkView::Layout {
50 protected: 51 protected:
51 virtual void onLayoutChildren(SkView* parent) { 52 virtual void onLayoutChildren(SkView* parent) {
52 SkView* view = SkView::F2BIter(parent).next(); 53 SkView* view = SkView::F2BIter(parent).next();
53 view->setSize(parent->width(), parent->height()); 54 view->setSize(parent->width(), parent->height());
54 } 55 }
55 }; 56 };
56 57
57 #import "SimpleApp.h" 58 #import "SimpleApp.h"
58 @implementation SimpleApp 59 @implementation SimpleApp
59 60
60 - (id)initWithDefaults { 61 - (id)initWithDefaults {
61 (void) tool_main(saved_argc, saved_argv); 62 (void) tool_main(saved_argc, saved_argv);
62 if (self = [super initWithDefaults]) { 63 if (self = [super initWithDefaults]) {
63 fWind = new SkOSWindow(self); 64 fWind = new SkOSWindow(self);
64 fWind->setLayout(new FillLayout, false); 65 fWind->setLayout(new FillLayout, false);
65 fWind->attachChildToFront(new SkSampleView)->unref(); 66 fWind->attachChildToFront(new SkSampleView)->unref();
66 } 67 }
67 return self; 68 return self;
68 } 69 }
69 70
70 @end 71 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698