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

Side by Side Diff: samplecode/SampleApp.h

Issue 1549483002: SampleApp: Build list of devices dynamically Base URL: https://skia.googlesource.com/skia.git@sampleapp-01-no-picturedevice
Patch Set: Created 4 years, 11 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 | « include/views/SkOSMenu.h ('k') | 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
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 surface = fDevManager->createSurface(fDeviceType, this); 110 surface = fDevManager->createSurface(fDeviceType, this);
111 } 111 }
112 if (nullptr == surface) { 112 if (nullptr == surface) {
113 surface = this->INHERITED::createSurface(); 113 surface = this->INHERITED::createSurface();
114 } 114 }
115 return surface; 115 return surface;
116 } 116 }
117 117
118 void draw(SkCanvas*) override; 118 void draw(SkCanvas*) override;
119 119
120 void setDeviceType(DeviceType type); 120 void setDevice(size_t deviceIndex);
121 void toggleRendering(); 121 void toggleRendering();
122 void toggleSlideshow(); 122 void toggleSlideshow();
123 void toggleFPS(); 123 void toggleFPS();
124 void showOverview(); 124 void showOverview();
125 void toggleDistanceFieldFonts(); 125 void toggleDistanceFieldFonts();
126 126
127 GrContext* getGrContext() const { return fDevManager->getGrContext(); } 127 GrContext* getGrContext() const { return fDevManager->getGrContext(); }
128 128
129 void setZoomCenter(float x, float y); 129 void setZoomCenter(float x, float y);
130 void changeZoomLevel(float delta); 130 void changeZoomLevel(float delta);
(...skipping 24 matching lines...) Expand all
155 155
156 virtual bool onDispatchClick(int x, int y, Click::State, void* owner, 156 virtual bool onDispatchClick(int x, int y, Click::State, void* owner,
157 unsigned modi) override; 157 unsigned modi) override;
158 bool onClick(Click* click) override; 158 bool onClick(Click* click) override;
159 virtual Click* onFindClickHandler(SkScalar x, SkScalar y, 159 virtual Click* onFindClickHandler(SkScalar x, SkScalar y,
160 unsigned modi) override; 160 unsigned modi) override;
161 161
162 private: 162 private:
163 class DefaultDeviceManager; 163 class DefaultDeviceManager;
164 164
165 size_t fDeviceIndex;
165 int fCurrIndex; 166 int fCurrIndex;
166 167
167 SkPictureRecorder fRecorder; 168 SkPictureRecorder fRecorder;
168 SkAutoTDelete<SkCanvas> fFlagsFilterCanvas; 169 SkAutoTDelete<SkCanvas> fFlagsFilterCanvas;
169 SkPath fClipPath; 170 SkPath fClipPath;
170 171
171 SkTouchGesture fGesture; 172 SkTouchGesture fGesture;
172 SkScalar fZoomLevel; 173 SkScalar fZoomLevel;
173 SkScalar fZoomScale; 174 SkScalar fZoomScale;
174 175
(...skipping 24 matching lines...) Expand all
199 SkTypeface* fTypeface; 200 SkTypeface* fTypeface;
200 bool fShowZoomer; 201 bool fShowZoomer;
201 202
202 SkOSMenu::TriState fLCDState; 203 SkOSMenu::TriState fLCDState;
203 SkOSMenu::TriState fAAState; 204 SkOSMenu::TriState fAAState;
204 SkOSMenu::TriState fSubpixelState; 205 SkOSMenu::TriState fSubpixelState;
205 int fHintingState; 206 int fHintingState;
206 int fFilterQualityIndex; 207 int fFilterQualityIndex;
207 unsigned fFlipAxis; 208 unsigned fFlipAxis;
208 209
209 int fMSAASampleCount;
210
211 int fScrollTestX, fScrollTestY; 210 int fScrollTestX, fScrollTestY;
212 SkScalar fZoomCenterX, fZoomCenterY; 211 SkScalar fZoomCenterX, fZoomCenterY;
213 212
214 //Stores global settings 213 //Stores global settings
215 SkOSMenu* fAppMenu; // We pass ownership to SkWindow, when we call addMenu 214 SkOSMenu* fAppMenu; // We pass ownership to SkWindow, when we call addMenu
216 //Stores slide specific settings 215 //Stores slide specific settings
217 SkOSMenu* fSlideMenu; // We pass ownership to SkWindow, when we call addMenu 216 SkOSMenu* fSlideMenu; // We pass ownership to SkWindow, when we call addMenu
218 217
219 void loadView(SkView*); 218 void loadView(SkView*);
220 void updateTitle(); 219 void updateTitle();
221 bool getRawTitle(SkString*); 220 bool getRawTitle(SkString*);
222 221
223 bool zoomIn(); 222 bool zoomIn();
224 bool zoomOut(); 223 bool zoomOut();
225 void updatePointer(int x, int y); 224 void updatePointer(int x, int y);
226 void magnify(SkCanvas* canvas); 225 void magnify(SkCanvas* canvas);
227 void showZoomer(SkCanvas* canvas); 226 void showZoomer(SkCanvas* canvas);
228 void updateMatrix(); 227 void updateMatrix();
229 void postAnimatingEvent(); 228 void postAnimatingEvent();
230 int findByTitle(const char*); 229 int findByTitle(const char*);
231 void listTitles(); 230 void listTitles();
232 SkSize tileSize() const; 231 SkSize tileSize() const;
233 bool sendAnimatePulse(); 232 bool sendAnimatePulse();
234 233
235 typedef SkOSWindow INHERITED; 234 typedef SkOSWindow INHERITED;
236 }; 235 };
237 236
238 #endif 237 #endif
OLDNEW
« no previous file with comments | « include/views/SkOSMenu.h ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698