Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 2 | * Copyright 2011 Skia |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 3 | * |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
tfarina@chromium.org | f726a1c | 2012-09-29 12:40:30 +0000 | [diff] [blame] | 8 | #ifndef SampleApp_DEFINED |
| 9 | #define SampleApp_DEFINED |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 10 | |
tfarina@chromium.org | f726a1c | 2012-09-29 12:40:30 +0000 | [diff] [blame] | 11 | #include "SkOSMenu.h" |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 12 | #include "SkPath.h" |
robertphillips@google.com | 84b18c7 | 2014-04-13 19:09:42 +0000 | [diff] [blame] | 13 | #include "SkPicture.h" |
robertphillips@google.com | 770963f | 2014-04-18 18:04:41 +0000 | [diff] [blame] | 14 | #include "SkPictureRecorder.h" |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 15 | #include "SkScalar.h" |
reed | 54dc487 | 2016-09-13 08:09:45 -0700 | [diff] [blame] | 16 | #include "SkStream.h" |
jvanverth | 38c7215 | 2016-10-10 07:39:38 -0700 | [diff] [blame] | 17 | #include "SkSurface.h" |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 18 | #include "SkTDArray.h" |
| 19 | #include "SkTouchGesture.h" |
| 20 | #include "SkWindow.h" |
jvanverth | 4d0d81a | 2015-08-11 11:07:07 -0700 | [diff] [blame] | 21 | #include "timer/Timer.h" |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 22 | |
reed | 54dc487 | 2016-09-13 08:09:45 -0700 | [diff] [blame] | 23 | #include "SkPipe.h" |
| 24 | |
csmartdalton | 008b9d8 | 2017-02-22 12:00:42 -0700 | [diff] [blame] | 25 | #if SK_SUPPORT_GPU |
| 26 | #include "GrContextOptions.h" |
| 27 | #endif |
| 28 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 29 | class GrContext; |
reed@google.com | 29038ed | 2011-07-06 17:56:47 +0000 | [diff] [blame] | 30 | class GrRenderTarget; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 31 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 32 | class SkCanvas; |
tfarina@chromium.org | f726a1c | 2012-09-29 12:40:30 +0000 | [diff] [blame] | 33 | class SkData; |
reed | ddb5eca | 2014-10-08 11:10:51 -0700 | [diff] [blame] | 34 | class SkDocument; |
tfarina@chromium.org | f726a1c | 2012-09-29 12:40:30 +0000 | [diff] [blame] | 35 | class SkEvent; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 36 | class SkTypeface; |
tfarina@chromium.org | f726a1c | 2012-09-29 12:40:30 +0000 | [diff] [blame] | 37 | class SkViewFactory; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 38 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 39 | class SampleWindow : public SkOSWindow { |
bsalomon@google.com | 48dd1a2 | 2011-10-31 14:18:20 +0000 | [diff] [blame] | 40 | SkTDArray<const SkViewFactory*> fSamples; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 41 | public: |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 42 | enum DeviceType { |
| 43 | kRaster_DeviceType, |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 44 | #if SK_SUPPORT_GPU |
bsalomon@google.com | 7491372 | 2011-10-27 20:44:19 +0000 | [diff] [blame] | 45 | kGPU_DeviceType, |
robertphillips@google.com | b442a6d | 2012-04-02 19:24:21 +0000 | [diff] [blame] | 46 | #if SK_ANGLE |
| 47 | kANGLE_DeviceType, |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 48 | #endif // SK_ANGLE |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 49 | #endif // SK_SUPPORT_GPU |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 50 | kDeviceTypeCnt |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 51 | }; |
bsalomon@google.com | 82502e2 | 2013-01-24 20:47:18 +0000 | [diff] [blame] | 52 | |
| 53 | static bool IsGpuDeviceType(DeviceType devType) { |
| 54 | #if SK_SUPPORT_GPU |
| 55 | switch (devType) { |
| 56 | case kGPU_DeviceType: |
| 57 | #if SK_ANGLE |
| 58 | case kANGLE_DeviceType: |
| 59 | #endif // SK_ANGLE |
bsalomon@google.com | 82502e2 | 2013-01-24 20:47:18 +0000 | [diff] [blame] | 60 | return true; |
reed@google.com | 58c0aaa | 2013-01-24 22:09:06 +0000 | [diff] [blame] | 61 | default: |
| 62 | return false; |
bsalomon@google.com | 82502e2 | 2013-01-24 20:47:18 +0000 | [diff] [blame] | 63 | } |
| 64 | #endif // SK_SUPPORT_GPU |
| 65 | return false; |
| 66 | } |
| 67 | |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 68 | /** |
| 69 | * SampleApp ports can subclass this manager class if they want to: |
| 70 | * * filter the types of devices supported |
robertphillips@google.com | 1f2f338 | 2013-08-29 11:54:56 +0000 | [diff] [blame] | 71 | * * customize plugging of SkBaseDevice objects into an SkCanvas |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 72 | * * customize publishing the results of draw to the OS window |
| 73 | * * manage GrContext / GrRenderTarget lifetimes |
| 74 | */ |
| 75 | class DeviceManager : public SkRefCnt { |
| 76 | public: |
csmartdalton | 008b9d8 | 2017-02-22 12:00:42 -0700 | [diff] [blame] | 77 | struct BackendOptions { |
| 78 | #if SK_SUPPORT_GPU |
| 79 | GrContextOptions fGrContextOptions; |
| 80 | int fMSAASampleCount; |
| 81 | bool fDeepColor; |
| 82 | #endif |
| 83 | }; |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 84 | |
csmartdalton | 008b9d8 | 2017-02-22 12:00:42 -0700 | [diff] [blame] | 85 | virtual void setUpBackend(SampleWindow* win, const BackendOptions&) = 0; |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 86 | |
robertphillips@google.com | b442a6d | 2012-04-02 19:24:21 +0000 | [diff] [blame] | 87 | virtual void tearDownBackend(SampleWindow* win) = 0; |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 88 | |
| 89 | // called before drawing. should install correct device |
| 90 | // type on the canvas. Will skip drawing if returns false. |
robertphillips | ecf3dbe | 2016-07-28 15:17:34 -0700 | [diff] [blame] | 91 | virtual sk_sp<SkSurface> makeSurface(DeviceType dType, SampleWindow* win) = 0; |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 92 | |
| 93 | // called after drawing, should get the results onto the |
| 94 | // screen. |
Ben Wagner | 55963bc | 2017-07-24 15:00:35 +0000 | [diff] [blame] | 95 | virtual void publishCanvas(DeviceType dType, |
| 96 | SkCanvas* canvas, |
| 97 | SampleWindow* win) = 0; |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 98 | |
| 99 | // called when window changes size, guaranteed to be called |
| 100 | // at least once before first draw (after init) |
| 101 | virtual void windowSizeChanged(SampleWindow* win) = 0; |
| 102 | |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 103 | // return the GrContext backing gpu devices (nullptr if not built with GPU support) |
robertphillips@google.com | b442a6d | 2012-04-02 19:24:21 +0000 | [diff] [blame] | 104 | virtual GrContext* getGrContext() = 0; |
bsalomon@google.com | 1195925 | 2012-04-06 20:13:38 +0000 | [diff] [blame] | 105 | |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 106 | // return the GrRenderTarget backing gpu devices (nullptr if not built with GPU support) |
robertphillips | ecf3dbe | 2016-07-28 15:17:34 -0700 | [diff] [blame] | 107 | virtual int numColorSamples() const = 0; |
brianosman | 2d1ee79 | 2016-05-05 12:24:31 -0700 | [diff] [blame] | 108 | |
| 109 | // return the color depth of the output device |
| 110 | virtual int getColorBits() = 0; |
| 111 | |
robertphillips@google.com | a22e211 | 2012-08-16 14:58:06 +0000 | [diff] [blame] | 112 | private: |
| 113 | typedef SkRefCnt INHERITED; |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 114 | }; |
| 115 | |
| 116 | SampleWindow(void* hwnd, int argc, char** argv, DeviceManager*); |
Brian Salomon | d3b6597 | 2017-03-22 12:05:03 -0400 | [diff] [blame] | 117 | ~SampleWindow() override; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 118 | |
robertphillips | ecf3dbe | 2016-07-28 15:17:34 -0700 | [diff] [blame] | 119 | sk_sp<SkSurface> makeSurface() override { |
| 120 | sk_sp<SkSurface> surface; |
reed@google.com | 5957f47 | 2012-10-01 20:31:56 +0000 | [diff] [blame] | 121 | if (fDevManager) { |
robertphillips | ecf3dbe | 2016-07-28 15:17:34 -0700 | [diff] [blame] | 122 | surface = fDevManager->makeSurface(fDeviceType, this); |
reed@google.com | 5957f47 | 2012-10-01 20:31:56 +0000 | [diff] [blame] | 123 | } |
robertphillips | ecf3dbe | 2016-07-28 15:17:34 -0700 | [diff] [blame] | 124 | if (!surface) { |
| 125 | surface = this->INHERITED::makeSurface(); |
reed@google.com | 5957f47 | 2012-10-01 20:31:56 +0000 | [diff] [blame] | 126 | } |
reed | 0397e9f | 2014-09-18 11:29:01 -0700 | [diff] [blame] | 127 | return surface; |
reed@google.com | 5957f47 | 2012-10-01 20:31:56 +0000 | [diff] [blame] | 128 | } |
| 129 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 130 | void draw(SkCanvas*) override; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 131 | |
yangsu@google.com | 921091f | 2011-08-02 13:39:12 +0000 | [diff] [blame] | 132 | void setDeviceType(DeviceType type); |
brianosman | b109b8c | 2016-06-16 13:03:24 -0700 | [diff] [blame] | 133 | void setDeviceColorType(SkColorType, sk_sp<SkColorSpace>); |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 134 | void toggleRendering(); |
| 135 | void toggleSlideshow(); |
| 136 | void toggleFPS(); |
Yuqian Li | 5458cf8 | 2017-05-24 09:58:07 -0400 | [diff] [blame] | 137 | void resetFPS(); |
yangsu@google.com | db03eaa | 2011-08-08 15:37:23 +0000 | [diff] [blame] | 138 | void showOverview(); |
reed | 4302ae9 | 2014-10-06 12:29:56 -0700 | [diff] [blame] | 139 | void toggleDistanceFieldFonts(); |
bungeman | 5a59a42 | 2016-03-31 08:30:38 -0700 | [diff] [blame] | 140 | void setPixelGeometry(int pixelGeometryIndex); |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 141 | |
robertphillips@google.com | b442a6d | 2012-04-02 19:24:21 +0000 | [diff] [blame] | 142 | GrContext* getGrContext() const { return fDevManager->getGrContext(); } |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 143 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 144 | void setZoomCenter(float x, float y); |
| 145 | void changeZoomLevel(float delta); |
bungeman | ce56026 | 2016-03-03 13:32:38 -0800 | [diff] [blame] | 146 | void changeOffset(SkVector delta); |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 147 | bool nextSample(); |
| 148 | bool previousSample(); |
yangsu@google.com | 501775e | 2011-06-24 16:04:50 +0000 | [diff] [blame] | 149 | bool goToSample(int i); |
| 150 | SkString getSampleTitle(int i); |
| 151 | int sampleCount(); |
Scroggo | a54e2f6 | 2011-06-17 12:46:17 +0000 | [diff] [blame] | 152 | bool handleTouch(int ownerId, float x, float y, |
| 153 | SkView::Click::State state); |
Scroggo | 8ac0d54 | 2011-06-21 14:44:57 +0000 | [diff] [blame] | 154 | void saveToPdf(); |
Scroggo | 62b65b0 | 2011-06-21 16:01:26 +0000 | [diff] [blame] | 155 | void postInvalDelay(); |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 156 | |
robertphillips@google.com | b442a6d | 2012-04-02 19:24:21 +0000 | [diff] [blame] | 157 | DeviceType getDeviceType() const { return fDeviceType; } |
brianosman | 35a02a8 | 2016-09-29 14:37:02 -0700 | [diff] [blame] | 158 | int getColorConfigIndex() const { return fColorConfigIndex; } |
robertphillips@google.com | b442a6d | 2012-04-02 19:24:21 +0000 | [diff] [blame] | 159 | |
Yuqian Li | 70898af | 2017-06-05 13:36:32 -0400 | [diff] [blame] | 160 | int getTiles() const { return fTiles; } |
| 161 | void setTiles(int tiles) { fTiles = tiles; } |
Yuqian Li | b55dd55 | 2017-04-03 10:52:48 -0400 | [diff] [blame] | 162 | int getThreads() const { return fThreads; } |
| 163 | void setThreads(int threads) { fThreads = threads; } |
| 164 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 165 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 166 | void onDraw(SkCanvas* canvas) override; |
| 167 | bool onHandleKey(SkKey key) override; |
| 168 | bool onHandleChar(SkUnichar) override; |
| 169 | void onSizeChange() override; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 170 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 171 | SkCanvas* beforeChildren(SkCanvas*) override; |
| 172 | void afterChildren(SkCanvas*) override; |
| 173 | void beforeChild(SkView* child, SkCanvas* canvas) override; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 174 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 175 | bool onEvent(const SkEvent& evt) override; |
| 176 | bool onQuery(SkEvent* evt) override; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 177 | |
reed@google.com | 4d5c26d | 2013-01-08 16:17:50 +0000 | [diff] [blame] | 178 | virtual bool onDispatchClick(int x, int y, Click::State, void* owner, |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 179 | unsigned modi) override; |
| 180 | bool onClick(Click* click) override; |
reed@google.com | 4d5c26d | 2013-01-08 16:17:50 +0000 | [diff] [blame] | 181 | virtual Click* onFindClickHandler(SkScalar x, SkScalar y, |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 182 | unsigned modi) override; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 183 | |
| 184 | private: |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 185 | class DefaultDeviceManager; |
| 186 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 187 | int fCurrIndex; |
| 188 | |
reed | 54dc487 | 2016-09-13 08:09:45 -0700 | [diff] [blame] | 189 | std::unique_ptr<SkDynamicMemoryWStream> fPipeStream; |
| 190 | SkPipeSerializer fPipeSerializer; |
| 191 | SkPipeDeserializer fPipeDeserializer; |
| 192 | |
robertphillips@google.com | 84b18c7 | 2014-04-13 19:09:42 +0000 | [diff] [blame] | 193 | SkPictureRecorder fRecorder; |
Ben Wagner | 145dbcd | 2016-11-03 14:40:50 -0400 | [diff] [blame] | 194 | std::unique_ptr<SkCanvas> fFlagsFilterCanvas; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 195 | SkPath fClipPath; |
| 196 | |
| 197 | SkTouchGesture fGesture; |
| 198 | SkScalar fZoomLevel; |
| 199 | SkScalar fZoomScale; |
bungeman | ce56026 | 2016-03-03 13:32:38 -0800 | [diff] [blame] | 200 | SkVector fOffset; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 201 | |
bsalomon@google.com | 098e96d | 2011-07-14 14:30:46 +0000 | [diff] [blame] | 202 | DeviceType fDeviceType; |
| 203 | DeviceManager* fDevManager; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 204 | |
Scroggo | 8ac0d54 | 2011-06-21 14:44:57 +0000 | [diff] [blame] | 205 | bool fSaveToPdf; |
reed | 093b4e8 | 2015-08-04 18:46:38 -0700 | [diff] [blame] | 206 | bool fSaveToSKP; |
halcanary | 676ab68 | 2016-05-03 12:10:04 -0700 | [diff] [blame] | 207 | sk_sp<SkDocument> fPDFDocument; |
Scroggo | 8ac0d54 | 2011-06-21 14:44:57 +0000 | [diff] [blame] | 208 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 209 | bool fUseClip; |
reed | 91b4dfb | 2016-01-08 08:23:19 -0800 | [diff] [blame] | 210 | bool fUsePicture; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 211 | bool fAnimating; |
| 212 | bool fRotate; |
bsalomon@google.com | e8f0910 | 2011-09-08 18:48:12 +0000 | [diff] [blame] | 213 | bool fPerspAnim; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 214 | bool fRequestGrabImage; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 215 | bool fMeasureFPS; |
reed | babc3de | 2016-07-08 08:43:27 -0700 | [diff] [blame] | 216 | bool fUseDeferredCanvas; |
jvanverth | 4d0d81a | 2015-08-11 11:07:07 -0700 | [diff] [blame] | 217 | WallTimer fTimer; |
| 218 | double fMeasureFPS_Time; |
Yuqian Li | 5458cf8 | 2017-05-24 09:58:07 -0400 | [diff] [blame] | 219 | double fCumulativeFPS_Time; |
| 220 | int fCumulativeFPS_Count; |
yangsu@google.com | db03eaa | 2011-08-08 15:37:23 +0000 | [diff] [blame] | 221 | bool fMagnify; |
commit-bot@chromium.org | cc63b32 | 2013-12-06 20:14:55 +0000 | [diff] [blame] | 222 | int fTilingMode; |
chudy@google.com | 4605a3f | 2012-08-01 17:58:01 +0000 | [diff] [blame] | 223 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 224 | // The following are for the 'fatbits' drawing |
| 225 | // Latest position of the mouse. |
| 226 | int fMouseX, fMouseY; |
| 227 | int fFatBitsScale; |
| 228 | // Used by the text showing position and color values. |
bungeman | 13b9c95 | 2016-05-12 10:09:30 -0700 | [diff] [blame] | 229 | sk_sp<SkTypeface> fTypeface; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 230 | bool fShowZoomer; |
chudy@google.com | 4605a3f | 2012-08-01 17:58:01 +0000 | [diff] [blame] | 231 | |
yangsu@google.com | db03eaa | 2011-08-08 15:37:23 +0000 | [diff] [blame] | 232 | SkOSMenu::TriState fLCDState; |
| 233 | SkOSMenu::TriState fAAState; |
bungeman@google.com | 96aabc8 | 2013-06-03 21:26:34 +0000 | [diff] [blame] | 234 | SkOSMenu::TriState fSubpixelState; |
| 235 | int fHintingState; |
bungeman | 5a59a42 | 2016-03-31 08:30:38 -0700 | [diff] [blame] | 236 | int fPixelGeometryIndex; |
reed | 93a1215 | 2015-03-16 10:08:34 -0700 | [diff] [blame] | 237 | int fFilterQualityIndex; |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 238 | unsigned fFlipAxis; |
| 239 | |
csmartdalton | 008b9d8 | 2017-02-22 12:00:42 -0700 | [diff] [blame] | 240 | DeviceManager::BackendOptions fBackendOptions; |
| 241 | |
brianosman | 35a02a8 | 2016-09-29 14:37:02 -0700 | [diff] [blame] | 242 | int fColorConfigIndex; |
bsalomon@google.com | 1195925 | 2012-04-06 20:13:38 +0000 | [diff] [blame] | 243 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 244 | SkScalar fZoomCenterX, fZoomCenterY; |
| 245 | |
yangsu@google.com | 921091f | 2011-08-02 13:39:12 +0000 | [diff] [blame] | 246 | //Stores global settings |
scroggo@google.com | 7dadc74 | 2012-04-18 14:07:57 +0000 | [diff] [blame] | 247 | SkOSMenu* fAppMenu; // We pass ownership to SkWindow, when we call addMenu |
yangsu@google.com | 921091f | 2011-08-02 13:39:12 +0000 | [diff] [blame] | 248 | //Stores slide specific settings |
scroggo@google.com | 7dadc74 | 2012-04-18 14:07:57 +0000 | [diff] [blame] | 249 | SkOSMenu* fSlideMenu; // We pass ownership to SkWindow, when we call addMenu |
| 250 | |
Yuqian Li | 70898af | 2017-06-05 13:36:32 -0400 | [diff] [blame] | 251 | int fTiles = 0; |
Yuqian Li | b55dd55 | 2017-04-03 10:52:48 -0400 | [diff] [blame] | 252 | int fThreads = 0; |
| 253 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 254 | void loadView(SkView*); |
| 255 | void updateTitle(); |
reed | ddb5eca | 2014-10-08 11:10:51 -0700 | [diff] [blame] | 256 | bool getRawTitle(SkString*); |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 257 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 258 | bool zoomIn(); |
| 259 | bool zoomOut(); |
| 260 | void updatePointer(int x, int y); |
yangsu@google.com | db03eaa | 2011-08-08 15:37:23 +0000 | [diff] [blame] | 261 | void magnify(SkCanvas* canvas); |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 262 | void showZoomer(SkCanvas* canvas); |
reed@google.com | f03bb56 | 2011-11-11 21:42:12 +0000 | [diff] [blame] | 263 | void updateMatrix(); |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 264 | void postAnimatingEvent(); |
mike@reedtribe.org | 6f6e8c3 | 2011-12-27 22:33:50 +0000 | [diff] [blame] | 265 | int findByTitle(const char*); |
robertphillips@google.com | 7265e72 | 2012-05-03 18:22:28 +0000 | [diff] [blame] | 266 | void listTitles(); |
commit-bot@chromium.org | bbe43a9 | 2013-12-10 21:51:06 +0000 | [diff] [blame] | 267 | SkSize tileSize() const; |
reed | d9adfe6 | 2015-02-01 19:01:04 -0800 | [diff] [blame] | 268 | bool sendAnimatePulse(); |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 269 | |
Scroggo | 2c8208f | 2011-06-15 16:49:08 +0000 | [diff] [blame] | 270 | typedef SkOSWindow INHERITED; |
| 271 | }; |
| 272 | |
| 273 | #endif |