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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 bool Widget::OnNativeWidgetPaintAccelerated(const gfx::Rect& dirty_region) { | 1037 bool Widget::OnNativeWidgetPaintAccelerated(const gfx::Rect& dirty_region) { |
1038 ui::Compositor* compositor = GetCompositor(); | 1038 ui::Compositor* compositor = GetCompositor(); |
1039 if (!compositor) | 1039 if (!compositor) |
1040 return false; | 1040 return false; |
1041 | 1041 |
1042 // If the root view is animating, it is likely that it does not cover the same | 1042 // If the root view is animating, it is likely that it does not cover the same |
1043 // set of pixels it did at the last frame, so we must clear when compositing | 1043 // set of pixels it did at the last frame, so we must clear when compositing |
1044 // to avoid leaving ghosts. | 1044 // to avoid leaving ghosts. |
1045 bool force_clear = false; | 1045 bool force_clear = false; |
1046 if (GetRootView()->layer()) { | 1046 if (GetRootView()->layer()) { |
1047 const ui::Transform& layer_transform = GetRootView()->layer()->transform(); | 1047 const gfx::Transform& layer_transform = GetRootView()->layer()->transform(); |
1048 if (layer_transform != GetRootView()->GetTransform()) { | 1048 if (layer_transform != GetRootView()->GetTransform()) { |
1049 // The layer has not caught up to the view (i.e., the layer is still | 1049 // The layer has not caught up to the view (i.e., the layer is still |
1050 // animating), and so a clear is required. | 1050 // animating), and so a clear is required. |
1051 force_clear = true; | 1051 force_clear = true; |
1052 } else { | 1052 } else { |
1053 // Determine if the layer fills the client area. | 1053 // Determine if the layer fills the client area. |
1054 gfx::Rect layer_bounds = GetRootView()->layer()->bounds(); | 1054 gfx::Rect layer_bounds = GetRootView()->layer()->bounds(); |
1055 layer_transform.TransformRect(&layer_bounds); | 1055 layer_transform.TransformRect(&layer_bounds); |
1056 gfx::Rect client_bounds = GetClientAreaBoundsInScreen(); | 1056 gfx::Rect client_bounds = GetClientAreaBoundsInScreen(); |
1057 // Translate bounds to origin (client area bounds are offset to account | 1057 // Translate bounds to origin (client area bounds are offset to account |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 | 1348 |
1349 //////////////////////////////////////////////////////////////////////////////// | 1349 //////////////////////////////////////////////////////////////////////////////// |
1350 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1350 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1351 | 1351 |
1352 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1352 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1353 return this; | 1353 return this; |
1354 } | 1354 } |
1355 | 1355 |
1356 } // namespace internal | 1356 } // namespace internal |
1357 } // namespace views | 1357 } // namespace views |
OLD | NEW |