Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(762)

Side by Side Diff: content/browser/gpu/gpu_process_host_ui_shim.cc

Issue 140663003: Removed requirement for the renderer to know it's process ID (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase after long weekend Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 params.surface_id); 303 params.surface_id);
304 if (!view) 304 if (!view)
305 return; 305 return;
306 306
307 delayed_send.Cancel(); 307 delayed_send.Cancel();
308 308
309 static const base::TimeDelta swap_delay = GetSwapDelay(); 309 static const base::TimeDelta swap_delay = GetSwapDelay();
310 if (swap_delay.ToInternalValue()) 310 if (swap_delay.ToInternalValue())
311 base::PlatformThread::Sleep(swap_delay); 311 base::PlatformThread::Sleep(swap_delay);
312 312
313 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params view_params = params;
314
315 RenderWidgetHostImpl* impl =
316 RenderWidgetHostImpl::From(view->GetRenderWidgetHost());
317 for (size_t i = 0; i < view_params.latency_info.size(); i++)
318 impl->AddLatencyInfoComponentIds(&view_params.latency_info[i]);
319
313 // View must send ACK message after next composite. 320 // View must send ACK message after next composite.
314 view->AcceleratedSurfaceBuffersSwapped(params, host_id_); 321 view->AcceleratedSurfaceBuffersSwapped(view_params, host_id_);
315 view->DidReceiveRendererFrame(); 322 view->DidReceiveRendererFrame();
316 } 323 }
317 324
318 void GpuProcessHostUIShim::OnFrameDrawn( 325 void GpuProcessHostUIShim::OnFrameDrawn(
319 const std::vector<ui::LatencyInfo>& latency_info) { 326 const std::vector<ui::LatencyInfo>& latency_info) {
320 if (!ui::LatencyInfo::Verify(latency_info, 327 if (!ui::LatencyInfo::Verify(latency_info,
321 "GpuProcessHostUIShim::OnFrameDrawn")) 328 "GpuProcessHostUIShim::OnFrameDrawn"))
322 return; 329 return;
323 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); 330 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info);
324 } 331 }
(...skipping 17 matching lines...) Expand all
342 params.mailbox_name.length() != GL_MAILBOX_SIZE_CHROMIUM) 349 params.mailbox_name.length() != GL_MAILBOX_SIZE_CHROMIUM)
343 return; 350 return;
344 351
345 RenderWidgetHostViewPort* view = 352 RenderWidgetHostViewPort* view =
346 GetRenderWidgetHostViewFromSurfaceID(params.surface_id); 353 GetRenderWidgetHostViewFromSurfaceID(params.surface_id);
347 if (!view) 354 if (!view)
348 return; 355 return;
349 356
350 delayed_send.Cancel(); 357 delayed_send.Cancel();
351 358
359 GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params view_params = params;
360
361 RenderWidgetHostImpl* impl =
362 RenderWidgetHostImpl::From(view->GetRenderWidgetHost());
363 for (size_t i = 0; i < view_params.latency_info.size(); i++)
364 impl->AddLatencyInfoComponentIds(&view_params.latency_info[i]);
365
352 // View must send ACK message after next composite. 366 // View must send ACK message after next composite.
353 view->AcceleratedSurfacePostSubBuffer(params, host_id_); 367 view->AcceleratedSurfacePostSubBuffer(view_params, host_id_);
354 view->DidReceiveRendererFrame(); 368 view->DidReceiveRendererFrame();
355 } 369 }
356 370
357 void GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend(int32 surface_id) { 371 void GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend(int32 surface_id) {
358 TRACE_EVENT0("renderer", 372 TRACE_EVENT0("renderer",
359 "GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend"); 373 "GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend");
360 374
361 RenderWidgetHostViewPort* view = 375 RenderWidgetHostViewPort* view =
362 GetRenderWidgetHostViewFromSurfaceID(surface_id); 376 GetRenderWidgetHostViewFromSurfaceID(surface_id);
363 if (!view) 377 if (!view)
(...skipping 11 matching lines...) Expand all
375 view->AcceleratedSurfaceRelease(); 389 view->AcceleratedSurfaceRelease();
376 } 390 }
377 391
378 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( 392 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived(
379 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { 393 const GPUVideoMemoryUsageStats& video_memory_usage_stats) {
380 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( 394 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats(
381 video_memory_usage_stats); 395 video_memory_usage_stats);
382 } 396 }
383 397
384 } // namespace content 398 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698