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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 /** | 66 /** |
67 * SampleApp ports can subclass this manager class if they want to: | 67 * SampleApp ports can subclass this manager class if they want to: |
68 * * filter the types of devices supported | 68 * * filter the types of devices supported |
69 * * customize plugging of SkBaseDevice objects into an SkCanvas | 69 * * customize plugging of SkBaseDevice objects into an SkCanvas |
70 * * customize publishing the results of draw to the OS window | 70 * * customize publishing the results of draw to the OS window |
71 * * manage GrContext / GrRenderTarget lifetimes | 71 * * manage GrContext / GrRenderTarget lifetimes |
72 */ | 72 */ |
73 class DeviceManager : public SkRefCnt { | 73 class DeviceManager : public SkRefCnt { |
74 public: | 74 public: |
75 | 75 |
76 | 76 |
77 virtual void setUpBackend(SampleWindow* win, int msaaSampleCount) = 0; | 77 virtual void setUpBackend(SampleWindow* win, int msaaSampleCount) = 0; |
78 | 78 |
79 virtual void tearDownBackend(SampleWindow* win) = 0; | 79 virtual void tearDownBackend(SampleWindow* win) = 0; |
80 | 80 |
81 // called before drawing. should install correct device | 81 // called before drawing. should install correct device |
82 // type on the canvas. Will skip drawing if returns false. | 82 // type on the canvas. Will skip drawing if returns false. |
83 virtual SkSurface* createSurface(DeviceType dType, SampleWindow* win) =
0; | 83 virtual SkSurface* createSurface(DeviceType dType, SampleWindow* win) =
0; |
84 | 84 |
85 // called after drawing, should get the results onto the | 85 // called after drawing, should get the results onto the |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 void postAnimatingEvent(); | 231 void postAnimatingEvent(); |
232 int findByTitle(const char*); | 232 int findByTitle(const char*); |
233 void listTitles(); | 233 void listTitles(); |
234 SkSize tileSize() const; | 234 SkSize tileSize() const; |
235 bool sendAnimatePulse(); | 235 bool sendAnimatePulse(); |
236 | 236 |
237 typedef SkOSWindow INHERITED; | 237 typedef SkOSWindow INHERITED; |
238 }; | 238 }; |
239 | 239 |
240 #endif | 240 #endif |
OLD | NEW |