| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 #if defined(OS_MACOSX) | 264 #if defined(OS_MACOSX) |
| 265 // On Mac with delegated rendering, accelerated surfaces are not necessarily | 265 // On Mac with delegated rendering, accelerated surfaces are not necessarily |
| 266 // associated with a RenderWidgetHostViewBase. | 266 // associated with a RenderWidgetHostViewBase. |
| 267 if (IsDelegatedRendererEnabled()) { | 267 if (IsDelegatedRendererEnabled()) { |
| 268 gfx::AcceleratedWidget native_widget = | 268 gfx::AcceleratedWidget native_widget = |
| 269 content::GpuSurfaceTracker::Get()->AcquireNativeWidget( | 269 content::GpuSurfaceTracker::Get()->AcquireNativeWidget( |
| 270 params.surface_id); | 270 params.surface_id); |
| 271 BrowserCompositorViewMac::GotAcceleratedFrame( | 271 BrowserCompositorViewMac::GotAcceleratedFrame( |
| 272 native_widget, params.surface_handle, params.surface_id, | 272 native_widget, params.surface_handle, params.surface_id, |
| 273 params.latency_info, params.size, params.scale_factor); | 273 params.latency_info, params.size, params.scale_factor, |
| 274 host_id_, params.route_id); |
| 274 return; | 275 return; |
| 275 } | 276 } |
| 276 #endif | 277 #endif |
| 277 | 278 |
| 278 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 279 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
| 279 ack_params.mailbox = params.mailbox; | 280 ack_params.mailbox = params.mailbox; |
| 280 ack_params.sync_point = 0; | 281 ack_params.sync_point = 0; |
| 281 ScopedSendOnIOThread delayed_send( | 282 ScopedSendOnIOThread delayed_send( |
| 282 host_id_, | 283 host_id_, |
| 283 new AcceleratedSurfaceMsg_BufferPresented(params.route_id, | 284 new AcceleratedSurfaceMsg_BufferPresented(params.route_id, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 view->AcceleratedSurfaceRelease(); | 366 view->AcceleratedSurfaceRelease(); |
| 366 } | 367 } |
| 367 | 368 |
| 368 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( | 369 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( |
| 369 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { | 370 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { |
| 370 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( | 371 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( |
| 371 video_memory_usage_stats); | 372 video_memory_usage_stats); |
| 372 } | 373 } |
| 373 | 374 |
| 374 } // namespace content | 375 } // namespace content |
| OLD | NEW |