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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 return; | 329 return; |
330 | 330 |
331 delayed_send.Cancel(); | 331 delayed_send.Cancel(); |
332 | 332 |
333 static const base::TimeDelta swap_delay = GetSwapDelay(); | 333 static const base::TimeDelta swap_delay = GetSwapDelay(); |
334 if (swap_delay.ToInternalValue()) | 334 if (swap_delay.ToInternalValue()) |
335 base::PlatformThread::Sleep(swap_delay); | 335 base::PlatformThread::Sleep(swap_delay); |
336 | 336 |
337 // View must send ACK message after next composite. | 337 // View must send ACK message after next composite. |
338 view->AcceleratedSurfaceBuffersSwapped(params, host_id_); | 338 view->AcceleratedSurfaceBuffersSwapped(params, host_id_); |
339 view->DidReceiveRendererFrame(); | |
339 } | 340 } |
340 | 341 |
341 void GpuProcessHostUIShim::OnFrameDrawn(const ui::LatencyInfo& latency_info) { | 342 void GpuProcessHostUIShim::OnFrameDrawn(const ui::LatencyInfo& latency_info) { |
342 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); | 343 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); |
343 } | 344 } |
344 | 345 |
345 void GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer( | 346 void GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer( |
346 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params) { | 347 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params) { |
347 TRACE_EVENT0("renderer", | 348 TRACE_EVENT0("renderer", |
348 "GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer"); | 349 "GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer"); |
(...skipping 11 matching lines...) Expand all Loading... | |
360 return; | 361 return; |
361 | 362 |
362 RenderWidgetHostViewPort* view = | 363 RenderWidgetHostViewPort* view = |
363 GetRenderWidgetHostViewFromSurfaceID(params.surface_id); | 364 GetRenderWidgetHostViewFromSurfaceID(params.surface_id); |
364 if (!view) | 365 if (!view) |
365 return; | 366 return; |
366 | 367 |
367 delayed_send.Cancel(); | 368 delayed_send.Cancel(); |
368 | 369 |
369 // View must send ACK message after next composite. | 370 // View must send ACK message after next composite. |
370 view->AcceleratedSurfacePostSubBuffer(params, host_id_); | 371 view->AcceleratedSurfacePostSubBuffer(params, host_id_); |
piman
2013/07/03 20:31:53
also needed here...
danakj
2013/07/03 20:34:09
Oops, ya, thanks.
| |
371 } | 372 } |
372 | 373 |
373 void GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend(int32 surface_id) { | 374 void GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend(int32 surface_id) { |
374 TRACE_EVENT0("renderer", | 375 TRACE_EVENT0("renderer", |
375 "GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend"); | 376 "GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend"); |
376 | 377 |
377 RenderWidgetHostViewPort* view = | 378 RenderWidgetHostViewPort* view = |
378 GetRenderWidgetHostViewFromSurfaceID(surface_id); | 379 GetRenderWidgetHostViewFromSurfaceID(surface_id); |
379 if (!view) | 380 if (!view) |
380 return; | 381 return; |
(...skipping 10 matching lines...) Expand all Loading... | |
391 view->AcceleratedSurfaceRelease(); | 392 view->AcceleratedSurfaceRelease(); |
392 } | 393 } |
393 | 394 |
394 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( | 395 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( |
395 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { | 396 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { |
396 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( | 397 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( |
397 video_memory_usage_stats); | 398 video_memory_usage_stats); |
398 } | 399 } |
399 | 400 |
400 } // namespace content | 401 } // namespace content |
OLD | NEW |