| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Skia | 2 * Copyright 2011 Skia |
| 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 #ifndef SampleApp_DEFINED | 8 #ifndef SampleApp_DEFINED |
| 9 #define SampleApp_DEFINED | 9 #define SampleApp_DEFINED |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // called after drawing, should get the results onto the | 80 // called after drawing, should get the results onto the |
| 81 // screen. | 81 // screen. |
| 82 virtual void publishCanvas(DeviceType dType, | 82 virtual void publishCanvas(DeviceType dType, |
| 83 SkCanvas* canvas, | 83 SkCanvas* canvas, |
| 84 SampleWindow* win) = 0; | 84 SampleWindow* win) = 0; |
| 85 | 85 |
| 86 // called when window changes size, guaranteed to be called | 86 // called when window changes size, guaranteed to be called |
| 87 // at least once before first draw (after init) | 87 // at least once before first draw (after init) |
| 88 virtual void windowSizeChanged(SampleWindow* win) = 0; | 88 virtual void windowSizeChanged(SampleWindow* win) = 0; |
| 89 | 89 |
| 90 // return the GrContext backing gpu devices (NULL if not built with GPU
support) | 90 // return the GrContext backing gpu devices (nullptr if not built with G
PU support) |
| 91 virtual GrContext* getGrContext() = 0; | 91 virtual GrContext* getGrContext() = 0; |
| 92 | 92 |
| 93 // return the GrRenderTarget backing gpu devices (NULL if not built with
GPU support) | 93 // return the GrRenderTarget backing gpu devices (nullptr if not built w
ith GPU support) |
| 94 virtual GrRenderTarget* getGrRenderTarget() = 0; | 94 virtual GrRenderTarget* getGrRenderTarget() = 0; |
| 95 private: | 95 private: |
| 96 typedef SkRefCnt INHERITED; | 96 typedef SkRefCnt INHERITED; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 SampleWindow(void* hwnd, int argc, char** argv, DeviceManager*); | 99 SampleWindow(void* hwnd, int argc, char** argv, DeviceManager*); |
| 100 virtual ~SampleWindow(); | 100 virtual ~SampleWindow(); |
| 101 | 101 |
| 102 SkSurface* createSurface() override { | 102 SkSurface* createSurface() override { |
| 103 SkSurface* surface = NULL; | 103 SkSurface* surface = nullptr; |
| 104 if (fDevManager) { | 104 if (fDevManager) { |
| 105 surface = fDevManager->createSurface(fDeviceType, this); | 105 surface = fDevManager->createSurface(fDeviceType, this); |
| 106 } | 106 } |
| 107 if (NULL == surface) { | 107 if (nullptr == surface) { |
| 108 surface = this->INHERITED::createSurface(); | 108 surface = this->INHERITED::createSurface(); |
| 109 } | 109 } |
| 110 return surface; | 110 return surface; |
| 111 } | 111 } |
| 112 | 112 |
| 113 void draw(SkCanvas*) override; | 113 void draw(SkCanvas*) override; |
| 114 | 114 |
| 115 void setDeviceType(DeviceType type); | 115 void setDeviceType(DeviceType type); |
| 116 void toggleRendering(); | 116 void toggleRendering(); |
| 117 void toggleSlideshow(); | 117 void toggleSlideshow(); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 void postAnimatingEvent(); | 229 void postAnimatingEvent(); |
| 230 int findByTitle(const char*); | 230 int findByTitle(const char*); |
| 231 void listTitles(); | 231 void listTitles(); |
| 232 SkSize tileSize() const; | 232 SkSize tileSize() const; |
| 233 bool sendAnimatePulse(); | 233 bool sendAnimatePulse(); |
| 234 | 234 |
| 235 typedef SkOSWindow INHERITED; | 235 typedef SkOSWindow INHERITED; |
| 236 }; | 236 }; |
| 237 | 237 |
| 238 #endif | 238 #endif |
| OLD | NEW |