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_view_mac.h" | 5 #include "content/browser/compositor/browser_compositor_view_mac.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 9 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
10 #include "content/browser/compositor/browser_compositor_view_private_mac.h" | 10 #include "content/browser/compositor/browser_compositor_view_private_mac.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 BrowserCompositorViewMacInternal::FromAcceleratedWidget(widget); | 84 BrowserCompositorViewMacInternal::FromAcceleratedWidget(widget); |
85 int renderer_id = 0; | 85 int renderer_id = 0; |
86 if (internal_view) { | 86 if (internal_view) { |
87 internal_view->GotAcceleratedFrame( | 87 internal_view->GotAcceleratedFrame( |
88 surface_handle, surface_id, latency_info, pixel_size, scale_factor); | 88 surface_handle, surface_id, latency_info, pixel_size, scale_factor); |
89 renderer_id = internal_view->GetRendererID(); | 89 renderer_id = internal_view->GetRendererID(); |
90 } | 90 } |
91 | 91 |
92 // Acknowledge the swap, now that it has been processed. | 92 // Acknowledge the swap, now that it has been processed. |
93 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 93 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
94 ack_params.sync_point = 0; | |
95 ack_params.renderer_id = renderer_id; | 94 ack_params.renderer_id = renderer_id; |
96 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); | 95 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); |
97 if (ui_shim) { | 96 if (ui_shim) { |
98 ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented( | 97 ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented( |
99 gpu_route_id, ack_params)); | 98 gpu_route_id, ack_params)); |
100 } | 99 } |
101 } | 100 } |
102 | 101 |
103 // static | 102 // static |
104 void BrowserCompositorViewMac::GotSoftwareFrame( | 103 void BrowserCompositorViewMac::GotSoftwareFrame( |
(...skipping 16 matching lines...) Expand all Loading... |
121 DCHECK_GT(g_placeholder_count, 0u); | 120 DCHECK_GT(g_placeholder_count, 0u); |
122 g_placeholder_count -= 1; | 121 g_placeholder_count -= 1; |
123 | 122 |
124 // If there are no placeholders allocated, destroy the recyclable | 123 // If there are no placeholders allocated, destroy the recyclable |
125 // BrowserCompositorViewMacInternal. | 124 // BrowserCompositorViewMacInternal. |
126 if (!g_placeholder_count) | 125 if (!g_placeholder_count) |
127 g_recyclable_internal_view.Get().reset(); | 126 g_recyclable_internal_view.Get().reset(); |
128 } | 127 } |
129 | 128 |
130 } // namespace content | 129 } // namespace content |
OLD | NEW |