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

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

Issue 2182163002: Don't unnecessarily resize windows in sk_app on X (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 | tools/viewer/sk_app/unix/Window_unix.h » ('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 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
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 152
153 bool onChar(SkUnichar c, uint32_t modifiers); 153 bool onChar(SkUnichar c, uint32_t modifiers);
154 bool onKey(Key key, InputState state, uint32_t modifiers); 154 bool onKey(Key key, InputState state, uint32_t modifiers);
155 bool onMouse(int x, int y, InputState state, uint32_t modifiers); 155 bool onMouse(int x, int y, InputState state, uint32_t modifiers);
156 bool onTouch(intptr_t owner, InputState state, float x, float y); // multi- owner = multi-touch 156 bool onTouch(intptr_t owner, InputState state, float x, float y); // multi- owner = multi-touch
157 void onUIStateChanged(const SkString& stateName, const SkString& stateValue) ; 157 void onUIStateChanged(const SkString& stateName, const SkString& stateValue) ;
158 void onPaint(); 158 void onPaint();
159 void onResize(uint32_t width, uint32_t height); 159 void onResize(uint32_t width, uint32_t height);
160 160
161 uint32_t width() { return fWidth; } 161 int width() { return fWidth; }
162 uint32_t height() { return fHeight; } 162 int height() { return fHeight; }
163 163
164 virtual const DisplayParams& getDisplayParams(); 164 virtual const DisplayParams& getDisplayParams();
165 void setDisplayParams(const DisplayParams& params); 165 void setDisplayParams(const DisplayParams& params);
166 166
167 // This is just for the sRGB split screen 167 // This is just for the sRGB split screen
168 sk_sp<SkSurface> getOffscreenSurface(bool forceSRGB); 168 sk_sp<SkSurface> getOffscreenSurface(bool forceSRGB);
169 169
170 protected: 170 protected:
171 Window(); 171 Window();
172 172
173 uint32_t fWidth; 173 int fWidth;
174 uint32_t fHeight; 174 int fHeight;
175 175
176 OnCharFunc fCharFunc; 176 OnCharFunc fCharFunc;
177 void* fCharUserData; 177 void* fCharUserData;
178 OnKeyFunc fKeyFunc; 178 OnKeyFunc fKeyFunc;
179 void* fKeyUserData; 179 void* fKeyUserData;
180 OnMouseFunc fMouseFunc; 180 OnMouseFunc fMouseFunc;
181 void* fMouseUserData; 181 void* fMouseUserData;
182 OnTouchFunc fTouchFunc; 182 OnTouchFunc fTouchFunc;
183 void* fTouchUserData; 183 void* fTouchUserData;
184 OnUIStateChangedFunc 184 OnUIStateChangedFunc
185 fUIStateChangedFunc; 185 fUIStateChangedFunc;
186 void* fUIStateChangedUserData; 186 void* fUIStateChangedUserData;
187 OnPaintFunc fPaintFunc; 187 OnPaintFunc fPaintFunc;
188 void* fPaintUserData; 188 void* fPaintUserData;
189 189
190 WindowContext* fWindowContext = nullptr; 190 WindowContext* fWindowContext = nullptr;
191 191
192 virtual void onInval() = 0; 192 virtual void onInval() = 0;
193 193
194 // Uncheck fIsContentInvalided to allow future inval/onInval. 194 // Uncheck fIsContentInvalided to allow future inval/onInval.
195 void markInvalProcessed(); 195 void markInvalProcessed();
196 196
197 bool fIsContentInvalidated = false; // use this to avoid duplicate invalida te events 197 bool fIsContentInvalidated = false; // use this to avoid duplicate invalida te events
198 }; 198 };
199 199
200 } // namespace sk_app 200 } // namespace sk_app
201 #endif 201 #endif
OLDNEW
« no previous file with comments | « no previous file | tools/viewer/sk_app/unix/Window_unix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698