Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1137)

Side by Side Diff: samplecode/SampleApp.h

Issue 1129603002: add DeferredCanvas mode to SampleApp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | samplecode/SampleApp.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 19
20 class GrContext; 20 class GrContext;
21 class GrRenderTarget; 21 class GrRenderTarget;
22 22
23 class SkCanvas; 23 class SkCanvas;
24 class SkData; 24 class SkData;
25 class SkDeferredCanvas;
25 class SkDocument; 26 class SkDocument;
26 class SkEvent; 27 class SkEvent;
27 class SkTypeface; 28 class SkTypeface;
28 class SkViewFactory; 29 class SkViewFactory;
29 30
30 class SampleWindow : public SkOSWindow { 31 class SampleWindow : public SkOSWindow {
31 SkTDArray<const SkViewFactory*> fSamples; 32 SkTDArray<const SkViewFactory*> fSamples;
32 public: 33 public:
33 enum DeviceType { 34 enum DeviceType {
34 kRaster_DeviceType, 35 kRaster_DeviceType,
35 kPicture_DeviceType, 36 kPicture_DeviceType,
36 #if SK_SUPPORT_GPU 37 #if SK_SUPPORT_GPU
37 kGPU_DeviceType, 38 kGPU_DeviceType,
38 #if SK_ANGLE 39 #if SK_ANGLE
39 kANGLE_DeviceType, 40 kANGLE_DeviceType,
40 #endif // SK_ANGLE 41 #endif // SK_ANGLE
41 #endif // SK_SUPPORT_GPU 42 #endif // SK_SUPPORT_GPU
42 43 kDeferred_DeviceType,
43 kDeviceTypeCnt 44 kDeviceTypeCnt
44 }; 45 };
45 46
46 static bool IsGpuDeviceType(DeviceType devType) { 47 static bool IsGpuDeviceType(DeviceType devType) {
47 #if SK_SUPPORT_GPU 48 #if SK_SUPPORT_GPU
48 switch (devType) { 49 switch (devType) {
49 case kGPU_DeviceType: 50 case kGPU_DeviceType:
50 #if SK_ANGLE 51 #if SK_ANGLE
51 case kANGLE_DeviceType: 52 case kANGLE_DeviceType:
52 #endif // SK_ANGLE 53 #endif // SK_ANGLE
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 bool onClick(Click* click) override; 155 bool onClick(Click* click) override;
155 virtual Click* onFindClickHandler(SkScalar x, SkScalar y, 156 virtual Click* onFindClickHandler(SkScalar x, SkScalar y,
156 unsigned modi) override; 157 unsigned modi) override;
157 158
158 private: 159 private:
159 class DefaultDeviceManager; 160 class DefaultDeviceManager;
160 161
161 int fCurrIndex; 162 int fCurrIndex;
162 163
163 SkPictureRecorder fRecorder; 164 SkPictureRecorder fRecorder;
165 SkAutoTDelete<SkSurface> fDeferredSurface;
166 SkAutoTDelete<SkDeferredCanvas> fDeferredCanvas;
164 SkPath fClipPath; 167 SkPath fClipPath;
165 168
166 SkTouchGesture fGesture; 169 SkTouchGesture fGesture;
167 SkScalar fZoomLevel; 170 SkScalar fZoomLevel;
168 SkScalar fZoomScale; 171 SkScalar fZoomScale;
169 172
170 DeviceType fDeviceType; 173 DeviceType fDeviceType;
171 DeviceManager* fDevManager; 174 DeviceManager* fDevManager;
172 175
173 bool fSaveToPdf; 176 bool fSaveToPdf;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 void installDrawFilter(SkCanvas*); 235 void installDrawFilter(SkCanvas*);
233 int findByTitle(const char*); 236 int findByTitle(const char*);
234 void listTitles(); 237 void listTitles();
235 SkSize tileSize() const; 238 SkSize tileSize() const;
236 bool sendAnimatePulse(); 239 bool sendAnimatePulse();
237 240
238 typedef SkOSWindow INHERITED; 241 typedef SkOSWindow INHERITED;
239 }; 242 };
240 243
241 #endif 244 #endif
OLDNEW
« no previous file with comments | « no previous file | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698