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

Side by Side Diff: tools/viewer/sk_app/Window.h

Issue 2069653002: Use Offscreen Surface for Split Screen (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix nits Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
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 Window_DEFINED 8 #ifndef Window_DEFINED
9 #define Window_DEFINED 9 #define Window_DEFINED
10 10
11 #include "DisplayParams.h" 11 #include "DisplayParams.h"
12 #include "SkRect.h" 12 #include "SkRect.h"
13 #include "SkTouchGesture.h" 13 #include "SkTouchGesture.h"
14 #include "SkTypes.h" 14 #include "SkTypes.h"
15 #include "SkJSONCPP.h" 15 #include "SkJSONCPP.h"
16 16
17 class SkCanvas; 17 class SkCanvas;
18 class SkSurface;
18 19
19 namespace sk_app { 20 namespace sk_app {
20 21
21 class WindowContext; 22 class WindowContext;
22 23
23 class Window { 24 class Window {
24 public: 25 public:
25 static Window* CreateNativeWindow(void* platformData); 26 static Window* CreateNativeWindow(void* platformData);
26 27
27 virtual ~Window() {}; 28 virtual ~Window() {};
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 void onUIStateChanged(const SkString& stateName, const SkString& stateValue) ; 155 void onUIStateChanged(const SkString& stateName, const SkString& stateValue) ;
155 void onPaint(); 156 void onPaint();
156 void onResize(uint32_t width, uint32_t height); 157 void onResize(uint32_t width, uint32_t height);
157 158
158 uint32_t width() { return fWidth; } 159 uint32_t width() { return fWidth; }
159 uint32_t height() { return fHeight; } 160 uint32_t height() { return fHeight; }
160 161
161 virtual const DisplayParams& getDisplayParams(); 162 virtual const DisplayParams& getDisplayParams();
162 void setDisplayParams(const DisplayParams& params); 163 void setDisplayParams(const DisplayParams& params);
163 164
165 sk_sp<SkSurface> getOffscreenSurface(bool sRGB);
djsollen 2016/06/15 14:14:29 why not pass SkSurfaceProps as an argument so that
liyuqian 2016/06/15 16:43:12 Because SkSurfaceProps is kind of complicated to c
166
164 protected: 167 protected:
165 Window(); 168 Window();
166 169
167 uint32_t fWidth; 170 uint32_t fWidth;
168 uint32_t fHeight; 171 uint32_t fHeight;
169 172
170 OnCharFunc fCharFunc; 173 OnCharFunc fCharFunc;
171 void* fCharUserData; 174 void* fCharUserData;
172 OnKeyFunc fKeyFunc; 175 OnKeyFunc fKeyFunc;
173 void* fKeyUserData; 176 void* fKeyUserData;
(...skipping 12 matching lines...) Expand all
186 virtual void onInval() = 0; 189 virtual void onInval() = 0;
187 190
188 // Uncheck fIsContentInvalided to allow future inval/onInval. 191 // Uncheck fIsContentInvalided to allow future inval/onInval.
189 void markInvalProcessed(); 192 void markInvalProcessed();
190 193
191 bool fIsContentInvalidated = false; // use this to avoid duplicate invalida te events 194 bool fIsContentInvalidated = false; // use this to avoid duplicate invalida te events
192 }; 195 };
193 196
194 } // namespace sk_app 197 } // namespace sk_app
195 #endif 198 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698