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