OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ca_layer_tree_coordinator.h" | 5 #include "ui/accelerated_widget_mac/ca_layer_tree_coordinator.h" |
6 | 6 |
7 #include <AVFoundation/AVFoundation.h> | 7 #include <AVFoundation/AVFoundation.h> |
8 | 8 |
9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return true; | 55 return true; |
56 } | 56 } |
57 | 57 |
58 CARendererLayerTree* CALayerTreeCoordinator::GetPendingCARendererLayerTree() { | 58 CARendererLayerTree* CALayerTreeCoordinator::GetPendingCARendererLayerTree() { |
59 DCHECK(allow_remote_layers_); | 59 DCHECK(allow_remote_layers_); |
60 if (pending_gl_renderer_layer_tree_) { | 60 if (pending_gl_renderer_layer_tree_) { |
61 DLOG(ERROR) << "Either CALayer overlays or a backbuffer should be " | 61 DLOG(ERROR) << "Either CALayer overlays or a backbuffer should be " |
62 "specified, but not both."; | 62 "specified, but not both."; |
63 } | 63 } |
64 if (!pending_ca_renderer_layer_tree_) | 64 if (!pending_ca_renderer_layer_tree_) |
65 pending_ca_renderer_layer_tree_.reset(new CARendererLayerTree( | 65 pending_ca_renderer_layer_tree_.reset( |
66 allow_av_sample_buffer_display_layer_, base::mac::IsOSSierraOrLater())); | 66 new CARendererLayerTree(allow_av_sample_buffer_display_layer_, |
| 67 !base::mac::IsOSSierraOrLater())); |
67 return pending_ca_renderer_layer_tree_.get(); | 68 return pending_ca_renderer_layer_tree_.get(); |
68 } | 69 } |
69 | 70 |
70 void CALayerTreeCoordinator::CommitPendingTreesToCA( | 71 void CALayerTreeCoordinator::CommitPendingTreesToCA( |
71 const gfx::Rect& pixel_damage_rect, | 72 const gfx::Rect& pixel_damage_rect, |
72 bool* fullscreen_low_power_layer_valid) { | 73 bool* fullscreen_low_power_layer_valid) { |
73 *fullscreen_low_power_layer_valid = false; | 74 *fullscreen_low_power_layer_valid = false; |
74 | 75 |
75 // Update the CALayer hierarchy. | 76 // Update the CALayer hierarchy. |
76 ScopedCAActionDisabler disabler; | 77 ScopedCAActionDisabler disabler; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 121 } |
121 | 122 |
122 IOSurfaceRef CALayerTreeCoordinator::GetIOSurfaceForDisplay() { | 123 IOSurfaceRef CALayerTreeCoordinator::GetIOSurfaceForDisplay() { |
123 DCHECK(!allow_remote_layers_); | 124 DCHECK(!allow_remote_layers_); |
124 if (!current_gl_renderer_layer_tree_) | 125 if (!current_gl_renderer_layer_tree_) |
125 return nullptr; | 126 return nullptr; |
126 return current_gl_renderer_layer_tree_->RootLayerIOSurface(); | 127 return current_gl_renderer_layer_tree_->RootLayerIOSurface(); |
127 } | 128 } |
128 | 129 |
129 } // namespace ui | 130 } // namespace ui |
OLD | NEW |