| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "SampleApp.h" | 8 #include "SampleApp.h" |
| 9 | 9 |
| 10 #include "OverView.h" | 10 #include "OverView.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #else | 41 #else |
| 42 class GrContext; | 42 class GrContext; |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 extern SampleView* CreateSamplePictFileView(const char filename[]); | 45 extern SampleView* CreateSamplePictFileView(const char filename[]); |
| 46 | 46 |
| 47 class PictFileFactory : public SkViewFactory { | 47 class PictFileFactory : public SkViewFactory { |
| 48 SkString fFilename; | 48 SkString fFilename; |
| 49 public: | 49 public: |
| 50 PictFileFactory(const SkString& filename) : fFilename(filename) {} | 50 PictFileFactory(const SkString& filename) : fFilename(filename) {} |
| 51 SkView* operator() () const SK_OVERRIDE { | 51 SkView* operator() () const override { |
| 52 return CreateSamplePictFileView(fFilename.c_str()); | 52 return CreateSamplePictFileView(fFilename.c_str()); |
| 53 } | 53 } |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 #ifdef SAMPLE_PDF_FILE_VIEWER | 56 #ifdef SAMPLE_PDF_FILE_VIEWER |
| 57 extern SampleView* CreateSamplePdfFileViewer(const char filename[]); | 57 extern SampleView* CreateSamplePdfFileViewer(const char filename[]); |
| 58 | 58 |
| 59 class PdfFileViewerFactory : public SkViewFactory { | 59 class PdfFileViewerFactory : public SkViewFactory { |
| 60 SkString fFilename; | 60 SkString fFilename; |
| 61 public: | 61 public: |
| 62 PdfFileViewerFactory(const SkString& filename) : fFilename(filename) {} | 62 PdfFileViewerFactory(const SkString& filename) : fFilename(filename) {} |
| 63 SkView* operator() () const SK_OVERRIDE { | 63 SkView* operator() () const override { |
| 64 return CreateSamplePdfFileViewer(fFilename.c_str()); | 64 return CreateSamplePdfFileViewer(fFilename.c_str()); |
| 65 } | 65 } |
| 66 }; | 66 }; |
| 67 #endif // SAMPLE_PDF_FILE_VIEWER | 67 #endif // SAMPLE_PDF_FILE_VIEWER |
| 68 | 68 |
| 69 #define PIPE_FILEx | 69 #define PIPE_FILEx |
| 70 #ifdef PIPE_FILE | 70 #ifdef PIPE_FILE |
| 71 #define FILE_PATH "/path/to/drawing.data" | 71 #define FILE_PATH "/path/to/drawing.data" |
| 72 #endif | 72 #endif |
| 73 | 73 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 fCurIntf = NULL; | 263 fCurIntf = NULL; |
| 264 | 264 |
| 265 SkSafeUnref(fCurRenderTarget); | 265 SkSafeUnref(fCurRenderTarget); |
| 266 fCurRenderTarget = NULL; | 266 fCurRenderTarget = NULL; |
| 267 #endif | 267 #endif |
| 268 win->detach(); | 268 win->detach(); |
| 269 fBackend = kNone_BackEndType; | 269 fBackend = kNone_BackEndType; |
| 270 } | 270 } |
| 271 | 271 |
| 272 virtual SkSurface* createSurface(SampleWindow::DeviceType dType, | 272 virtual SkSurface* createSurface(SampleWindow::DeviceType dType, |
| 273 SampleWindow* win) SK_OVERRIDE { | 273 SampleWindow* win) override { |
| 274 #if SK_SUPPORT_GPU | 274 #if SK_SUPPORT_GPU |
| 275 if (IsGpuDeviceType(dType) && fCurContext) { | 275 if (IsGpuDeviceType(dType) && fCurContext) { |
| 276 SkSurfaceProps props(win->getSurfaceProps()); | 276 SkSurfaceProps props(win->getSurfaceProps()); |
| 277 return SkSurface::NewRenderTargetDirect(fCurRenderTarget, &props); | 277 return SkSurface::NewRenderTargetDirect(fCurRenderTarget, &props); |
| 278 } | 278 } |
| 279 #endif | 279 #endif |
| 280 return NULL; | 280 return NULL; |
| 281 } | 281 } |
| 282 | 282 |
| 283 virtual void publishCanvas(SampleWindow::DeviceType dType, | 283 virtual void publishCanvas(SampleWindow::DeviceType dType, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 } | 317 } |
| 318 | 318 |
| 319 virtual GrContext* getGrContext() { | 319 virtual GrContext* getGrContext() { |
| 320 #if SK_SUPPORT_GPU | 320 #if SK_SUPPORT_GPU |
| 321 return fCurContext; | 321 return fCurContext; |
| 322 #else | 322 #else |
| 323 return NULL; | 323 return NULL; |
| 324 #endif | 324 #endif |
| 325 } | 325 } |
| 326 | 326 |
| 327 GrRenderTarget* getGrRenderTarget() SK_OVERRIDE { | 327 GrRenderTarget* getGrRenderTarget() override { |
| 328 #if SK_SUPPORT_GPU | 328 #if SK_SUPPORT_GPU |
| 329 return fCurRenderTarget; | 329 return fCurRenderTarget; |
| 330 #else | 330 #else |
| 331 return NULL; | 331 return NULL; |
| 332 #endif | 332 #endif |
| 333 } | 333 } |
| 334 | 334 |
| 335 private: | 335 private: |
| 336 | 336 |
| 337 #if SK_SUPPORT_GPU | 337 #if SK_SUPPORT_GPU |
| (...skipping 1947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2285 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2285 setenv("ANDROID_ROOT", "/android/device/data", 0); |
| 2286 #endif | 2286 #endif |
| 2287 SkGraphics::Init(); | 2287 SkGraphics::Init(); |
| 2288 SkEvent::Init(); | 2288 SkEvent::Init(); |
| 2289 } | 2289 } |
| 2290 | 2290 |
| 2291 void application_term() { | 2291 void application_term() { |
| 2292 SkEvent::Term(); | 2292 SkEvent::Term(); |
| 2293 SkGraphics::Term(); | 2293 SkGraphics::Term(); |
| 2294 } | 2294 } |
| OLD | NEW |