| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |