| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/widget/widget.h" | 5 #include "ui/views/widget/widget.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "ui/base/events/event.h" | 10 #include "ui/base/events/event.h" |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 // to avoid leaving ghosts. | 1053 // to avoid leaving ghosts. |
| 1054 bool force_clear = false; | 1054 bool force_clear = false; |
| 1055 if (GetRootView()->layer()) { | 1055 if (GetRootView()->layer()) { |
| 1056 const gfx::Transform& layer_transform = GetRootView()->layer()->transform(); | 1056 const gfx::Transform& layer_transform = GetRootView()->layer()->transform(); |
| 1057 if (layer_transform != GetRootView()->GetTransform()) { | 1057 if (layer_transform != GetRootView()->GetTransform()) { |
| 1058 // The layer has not caught up to the view (i.e., the layer is still | 1058 // The layer has not caught up to the view (i.e., the layer is still |
| 1059 // animating), and so a clear is required. | 1059 // animating), and so a clear is required. |
| 1060 force_clear = true; | 1060 force_clear = true; |
| 1061 } else { | 1061 } else { |
| 1062 // Determine if the layer fills the client area. | 1062 // Determine if the layer fills the client area. |
| 1063 gfx::Rect layer_bounds = GetRootView()->layer()->bounds(); | 1063 gfx::RectF layer_bounds = GetRootView()->layer()->bounds(); |
| 1064 layer_transform.TransformRect(&layer_bounds); | 1064 layer_transform.TransformRect(&layer_bounds); |
| 1065 gfx::Rect client_bounds = GetClientAreaBoundsInScreen(); | 1065 gfx::Rect client_bounds = GetClientAreaBoundsInScreen(); |
| 1066 // Translate bounds to origin (client area bounds are offset to account | 1066 // Translate bounds to origin (client area bounds are offset to account |
| 1067 // for buttons, etc). | 1067 // for buttons, etc). |
| 1068 client_bounds.set_origin(gfx::Point(0, 0)); | 1068 client_bounds.set_origin(gfx::Point(0, 0)); |
| 1069 if (!layer_bounds.Contains(client_bounds)) { | 1069 if (!layer_bounds.Contains(client_bounds)) { |
| 1070 // It doesn't, and so a clear is required. | 1070 // It doesn't, and so a clear is required. |
| 1071 force_clear = true; | 1071 force_clear = true; |
| 1072 } | 1072 } |
| 1073 } | 1073 } |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 | 1364 |
| 1365 //////////////////////////////////////////////////////////////////////////////// | 1365 //////////////////////////////////////////////////////////////////////////////// |
| 1366 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1366 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1367 | 1367 |
| 1368 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1368 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1369 return this; | 1369 return this; |
| 1370 } | 1370 } |
| 1371 | 1371 |
| 1372 } // namespace internal | 1372 } // namespace internal |
| 1373 } // namespace views | 1373 } // namespace views |
| OLD | NEW |