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 |
11 #include "SkOSMenu.h" | 11 #include "SkOSMenu.h" |
12 #include "SkPath.h" | 12 #include "SkPath.h" |
13 #include "SkPicture.h" | 13 #include "SkPicture.h" |
14 #include "SkPictureRecorder.h" | 14 #include "SkPictureRecorder.h" |
15 #include "SkScalar.h" | 15 #include "SkScalar.h" |
16 #include "SkTDArray.h" | 16 #include "SkTDArray.h" |
17 #include "SkTouchGesture.h" | 17 #include "SkTouchGesture.h" |
18 #include "SkWindow.h" | 18 #include "SkWindow.h" |
19 #include "timer/Timer.h" | 19 #include "timer/Timer.h" |
20 | 20 |
21 class GrContext; | 21 class GrContext; |
22 class GrRenderTarget; | 22 class GrRenderTarget; |
23 | 23 |
24 class SkCanvas; | 24 class SkCanvas; |
25 class SkData; | 25 class SkData; |
26 class SkDeferredCanvas; | |
27 class SkDocument; | 26 class SkDocument; |
28 class SkEvent; | 27 class SkEvent; |
29 class SkTypeface; | 28 class SkTypeface; |
30 class SkViewFactory; | 29 class SkViewFactory; |
31 | 30 |
32 class SampleWindow : public SkOSWindow { | 31 class SampleWindow : public SkOSWindow { |
33 SkTDArray<const SkViewFactory*> fSamples; | 32 SkTDArray<const SkViewFactory*> fSamples; |
34 public: | 33 public: |
35 enum DeviceType { | 34 enum DeviceType { |
36 kRaster_DeviceType, | 35 kRaster_DeviceType, |
37 kPicture_DeviceType, | 36 kPicture_DeviceType, |
38 #if SK_SUPPORT_GPU | 37 #if SK_SUPPORT_GPU |
39 kGPU_DeviceType, | 38 kGPU_DeviceType, |
40 #if SK_ANGLE | 39 #if SK_ANGLE |
41 kANGLE_DeviceType, | 40 kANGLE_DeviceType, |
42 #endif // SK_ANGLE | 41 #endif // SK_ANGLE |
43 #endif // SK_SUPPORT_GPU | 42 #endif // SK_SUPPORT_GPU |
44 kDeferred_DeviceType, | |
45 kDeviceTypeCnt | 43 kDeviceTypeCnt |
46 }; | 44 }; |
47 | 45 |
48 static bool IsGpuDeviceType(DeviceType devType) { | 46 static bool IsGpuDeviceType(DeviceType devType) { |
49 #if SK_SUPPORT_GPU | 47 #if SK_SUPPORT_GPU |
50 switch (devType) { | 48 switch (devType) { |
51 case kGPU_DeviceType: | 49 case kGPU_DeviceType: |
52 #if SK_ANGLE | 50 #if SK_ANGLE |
53 case kANGLE_DeviceType: | 51 case kANGLE_DeviceType: |
54 #endif // SK_ANGLE | 52 #endif // SK_ANGLE |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 bool onClick(Click* click) override; | 153 bool onClick(Click* click) override; |
156 virtual Click* onFindClickHandler(SkScalar x, SkScalar y, | 154 virtual Click* onFindClickHandler(SkScalar x, SkScalar y, |
157 unsigned modi) override; | 155 unsigned modi) override; |
158 | 156 |
159 private: | 157 private: |
160 class DefaultDeviceManager; | 158 class DefaultDeviceManager; |
161 | 159 |
162 int fCurrIndex; | 160 int fCurrIndex; |
163 | 161 |
164 SkPictureRecorder fRecorder; | 162 SkPictureRecorder fRecorder; |
165 SkAutoTDelete<SkSurface> fDeferredSurface; | |
166 SkAutoTDelete<SkDeferredCanvas> fDeferredCanvas; | |
167 SkAutoTDelete<SkCanvas> fFlagsFilterCanvas; | 163 SkAutoTDelete<SkCanvas> fFlagsFilterCanvas; |
168 SkPath fClipPath; | 164 SkPath fClipPath; |
169 | 165 |
170 SkTouchGesture fGesture; | 166 SkTouchGesture fGesture; |
171 SkScalar fZoomLevel; | 167 SkScalar fZoomLevel; |
172 SkScalar fZoomScale; | 168 SkScalar fZoomScale; |
173 | 169 |
174 DeviceType fDeviceType; | 170 DeviceType fDeviceType; |
175 DeviceManager* fDevManager; | 171 DeviceManager* fDevManager; |
176 | 172 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 void postAnimatingEvent(); | 229 void postAnimatingEvent(); |
234 int findByTitle(const char*); | 230 int findByTitle(const char*); |
235 void listTitles(); | 231 void listTitles(); |
236 SkSize tileSize() const; | 232 SkSize tileSize() const; |
237 bool sendAnimatePulse(); | 233 bool sendAnimatePulse(); |
238 | 234 |
239 typedef SkOSWindow INHERITED; | 235 typedef SkOSWindow INHERITED; |
240 }; | 236 }; |
241 | 237 |
242 #endif | 238 #endif |
OLD | NEW |