| 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 "content/browser/compositor/browser_compositor_ca_layer_tree_mac.h" | 5 #include "content/browser/compositor/browser_compositor_ca_layer_tree_mac.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 const gfx::Size& dip_size) const { | 109 const gfx::Size& dip_size) const { |
| 110 return last_swap_size_dip_ == dip_size; | 110 return last_swap_size_dip_ == dip_size; |
| 111 } | 111 } |
| 112 | 112 |
| 113 int BrowserCompositorCALayerTreeMac::GetRendererID() const { | 113 int BrowserCompositorCALayerTreeMac::GetRendererID() const { |
| 114 if (io_surface_layer_) | 114 if (io_surface_layer_) |
| 115 return [io_surface_layer_ rendererID]; | 115 return [io_surface_layer_ rendererID]; |
| 116 return 0; | 116 return 0; |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool BrowserCompositorCALayerTreeMac::IsRendererThrottlingDisabled() const { |
| 120 if (client_) |
| 121 return client_->BrowserCompositorViewShouldAckImmediately(); |
| 122 return false; |
| 123 } |
| 124 |
| 119 void BrowserCompositorCALayerTreeMac::BeginPumpingFrames() { | 125 void BrowserCompositorCALayerTreeMac::BeginPumpingFrames() { |
| 120 [io_surface_layer_ beginPumpingFrames]; | 126 [io_surface_layer_ beginPumpingFrames]; |
| 121 } | 127 } |
| 122 | 128 |
| 123 void BrowserCompositorCALayerTreeMac::EndPumpingFrames() { | 129 void BrowserCompositorCALayerTreeMac::EndPumpingFrames() { |
| 124 [io_surface_layer_ endPumpingFrames]; | 130 [io_surface_layer_ endPumpingFrames]; |
| 125 } | 131 } |
| 126 | 132 |
| 127 void BrowserCompositorCALayerTreeMac::GotAcceleratedFrame( | 133 void BrowserCompositorCALayerTreeMac::GotAcceleratedFrame( |
| 128 uint64 surface_handle, int output_surface_id, | 134 uint64 surface_handle, int output_surface_id, |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 g_widget_to_internals_map.Pointer()->find(widget); | 367 g_widget_to_internals_map.Pointer()->find(widget); |
| 362 // This can end up being accessed after the underlying widget has been | 368 // This can end up being accessed after the underlying widget has been |
| 363 // destroyed, but while the ui::Compositor is still being destroyed. | 369 // destroyed, but while the ui::Compositor is still being destroyed. |
| 364 // Return NULL in these cases. | 370 // Return NULL in these cases. |
| 365 if (found == g_widget_to_internals_map.Pointer()->end()) | 371 if (found == g_widget_to_internals_map.Pointer()->end()) |
| 366 return NULL; | 372 return NULL; |
| 367 return found->second; | 373 return found->second; |
| 368 } | 374 } |
| 369 | 375 |
| 370 } // namespace content | 376 } // namespace content |
| OLD | NEW |