OLD | NEW |
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 Loading... |
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 |
OLD | NEW |