OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/accelerated_widget_mac/accelerated_widget_mac.h" | 5 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
11 #include "base/mac/scoped_cftyperef.h" | 11 #include "base/mac/scoped_cftyperef.h" |
12 #include "base/mac/sdk_forward_declarations.h" | 12 #include "base/mac/sdk_forward_declarations.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
15 #include "third_party/skia/include/core/SkCanvas.h" | 15 #include "third_party/skia/include/core/SkCanvas.h" |
16 #include "ui/accelerated_widget_mac/fullscreen_low_power_coordinator.h" | 16 #include "ui/accelerated_widget_mac/fullscreen_low_power_coordinator.h" |
17 #include "ui/base/cocoa/animation_utils.h" | 17 #include "ui/base/cocoa/animation_utils.h" |
18 #include "ui/gfx/geometry/dip_util.h" | 18 #include "ui/gfx/geometry/dip_util.h" |
19 #include "ui/gl/scoped_cgl.h" | 19 #include "ui/gl/scoped_cgl.h" |
20 | 20 |
21 @interface CALayer (PrivateAPI) | 21 @interface CALayer (PrivateAPI) |
22 - (void)setContentsChanged; | 22 - (void)setContentsChanged; |
23 @end | 23 @end |
24 | 24 |
25 namespace ui { | 25 namespace ui { |
26 namespace { | 26 namespace { |
27 | 27 |
28 typedef std::map<gfx::AcceleratedWidget,AcceleratedWidgetMac*> | 28 typedef std::map<gfx::AcceleratedWidget,AcceleratedWidgetMac*> |
29 WidgetToHelperMap; | 29 WidgetToHelperMap; |
30 base::LazyInstance<WidgetToHelperMap> g_widget_to_helper_map; | 30 base::LazyInstance<WidgetToHelperMap>::DestructorAtExit g_widget_to_helper_map; |
31 | |
32 | 31 |
33 } // namespace | 32 } // namespace |
34 | 33 |
35 //////////////////////////////////////////////////////////////////////////////// | 34 //////////////////////////////////////////////////////////////////////////////// |
36 // AcceleratedWidgetMac | 35 // AcceleratedWidgetMac |
37 | 36 |
38 AcceleratedWidgetMac::AcceleratedWidgetMac() : view_(nullptr) { | 37 AcceleratedWidgetMac::AcceleratedWidgetMac() : view_(nullptr) { |
39 // Disable the fade-in animation as the layers are added. | 38 // Disable the fade-in animation as the layers are added. |
40 ScopedCAActionDisabler disabler; | 39 ScopedCAActionDisabler disabler; |
41 | 40 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 225 |
227 // Ensure that the content layer is removed. | 226 // Ensure that the content layer is removed. |
228 if (content_layer_) { | 227 if (content_layer_) { |
229 [content_layer_ removeFromSuperlayer]; | 228 [content_layer_ removeFromSuperlayer]; |
230 content_layer_.reset(); | 229 content_layer_.reset(); |
231 } | 230 } |
232 view_->AcceleratedWidgetSwapCompleted(); | 231 view_->AcceleratedWidgetSwapCompleted(); |
233 } | 232 } |
234 | 233 |
235 } // namespace ui | 234 } // namespace ui |
OLD | NEW |