| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |