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

Side by Side Diff: tools/viewer/sk_app/unix/Window_unix.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 | « tools/viewer/sk_app/Window.h ('k') | no next file » | 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_unix_DEFINED 8 #ifndef Window_unix_DEFINED
9 #define Window_unix_DEFINED 9 #define Window_unix_DEFINED
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 static SkTDynamicHash<Window_unix, XWindow> gWindowMap; 56 static SkTDynamicHash<Window_unix, XWindow> gWindowMap;
57 57
58 void markPendingPaint() { fPendingPaint = true; } 58 void markPendingPaint() { fPendingPaint = true; }
59 void finishPaint() { 59 void finishPaint() {
60 if (fPendingPaint) { 60 if (fPendingPaint) {
61 this->onPaint(); 61 this->onPaint();
62 fPendingPaint = false; 62 fPendingPaint = false;
63 } 63 }
64 } 64 }
65 65
66 void markPendingResize(int width, int height) { 66 void markPendingResize(int width, int height) {
67 fPendingWidth = width; 67 if (width != fWidth || height != fHeight){
68 fPendingHeight = height; 68 fPendingResize = true;
69 fPendingResize = true; 69 fPendingWidth = width;
70 fPendingHeight = height;
71 }
70 } 72 }
71 void finishResize() { 73 void finishResize() {
72 if (fPendingResize) { 74 if (fPendingResize) {
73 this->onResize(fPendingWidth, fPendingHeight); 75 this->onResize(fPendingWidth, fPendingHeight);
74 fPendingResize = false; 76 fPendingResize = false;
75 } 77 }
76 } 78 }
77 79
78 private: 80 private:
79 void closeWindow(); 81 void closeWindow();
80 82
81 Display* fDisplay; 83 Display* fDisplay;
82 XWindow fWindow; 84 XWindow fWindow;
83 GC fGC; 85 GC fGC;
84 XVisualInfo* fVisualInfo; 86 XVisualInfo* fVisualInfo;
85 int fMSAASampleCount; 87 int fMSAASampleCount;
86 88
87 Atom fWmDeleteMessage; 89 Atom fWmDeleteMessage;
88 90
89 bool fPendingPaint; 91 bool fPendingPaint;
90 int fPendingWidth; 92 int fPendingWidth;
91 int fPendingHeight; 93 int fPendingHeight;
92 bool fPendingResize; 94 bool fPendingResize;
93 }; 95 };
94 96
95 } // namespace sk_app 97 } // namespace sk_app
96 98
97 #endif 99 #endif
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/Window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698