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 "content/browser/gpu/gpu_process_host_ui_shim.h" | 5 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // On Mac with delegated rendering, accelerated surfaces are not necessarily | 281 // On Mac with delegated rendering, accelerated surfaces are not necessarily |
282 // associated with a RenderWidgetHostViewBase. | 282 // associated with a RenderWidgetHostViewBase. |
283 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 283 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
284 DCHECK(IsDelegatedRendererEnabled()); | 284 DCHECK(IsDelegatedRendererEnabled()); |
285 | 285 |
286 // If the frame was intended for an NSView that the gfx::AcceleratedWidget is | 286 // If the frame was intended for an NSView that the gfx::AcceleratedWidget is |
287 // no longer attached to, do not pass the frame along to the widget. Just ack | 287 // no longer attached to, do not pass the frame along to the widget. Just ack |
288 // it to the GPU process immediately, so we can proceed to the next frame. | 288 // it to the GPU process immediately, so we can proceed to the next frame. |
289 bool should_not_show_frame = | 289 bool should_not_show_frame = |
290 content::ImageTransportFactory::GetInstance() | 290 content::ImageTransportFactory::GetInstance() |
291 ->SurfaceShouldNotShowFramesAfterRecycle(params.surface_id); | 291 ->SurfaceShouldNotShowFramesAfterSuspendForRecycle(params.surface_id); |
292 if (should_not_show_frame) { | 292 if (should_not_show_frame) { |
293 OnSurfaceDisplayedCallback(params.surface_id); | 293 OnSurfaceDisplayedCallback(params.surface_id); |
294 } else { | 294 } else { |
295 gfx::AcceleratedWidget native_widget = | 295 gfx::AcceleratedWidget native_widget = |
296 content::GpuSurfaceTracker::Get()->AcquireNativeWidget( | 296 content::GpuSurfaceTracker::Get()->AcquireNativeWidget( |
297 params.surface_id); | 297 params.surface_id); |
298 ui::AcceleratedWidgetMacGotAcceleratedFrame( | 298 ui::AcceleratedWidgetMacGotAcceleratedFrame( |
299 native_widget, params.surface_handle, params.latency_info, params.size, | 299 native_widget, params.surface_handle, params.latency_info, params.size, |
300 params.scale_factor, | 300 params.scale_factor, |
301 base::Bind(&OnSurfaceDisplayedCallback, params.surface_id), | 301 base::Bind(&OnSurfaceDisplayedCallback, params.surface_id), |
(...skipping 27 matching lines...) Expand all Loading... |
329 | 329 |
330 void GpuProcessHostUIShim::OnRemoveSubscription( | 330 void GpuProcessHostUIShim::OnRemoveSubscription( |
331 int32 process_id, unsigned int target) { | 331 int32 process_id, unsigned int target) { |
332 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); | 332 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); |
333 if (rph) { | 333 if (rph) { |
334 rph->OnRemoveSubscription(target); | 334 rph->OnRemoveSubscription(target); |
335 } | 335 } |
336 } | 336 } |
337 | 337 |
338 } // namespace content | 338 } // namespace content |
OLD | NEW |