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

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

Issue 10663003: Merge the IPCs used for GPU process synchronization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 5 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
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 return base::TimeDelta::FromMilliseconds(delay); 327 return base::TimeDelta::FromMilliseconds(delay);
328 } 328 }
329 329
330 void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped( 330 void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped(
331 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { 331 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) {
332 TRACE_EVENT0("renderer", 332 TRACE_EVENT0("renderer",
333 "GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped"); 333 "GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped");
334 334
335 ScopedSendOnIOThread delayed_send( 335 ScopedSendOnIOThread delayed_send(
336 host_id_, 336 host_id_,
337 new AcceleratedSurfaceMsg_BuffersSwappedACK(params.route_id)); 337 new AcceleratedSurfaceMsg_BufferPresented(params.route_id));
338 338
339 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( 339 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID(
340 params.surface_id); 340 params.surface_id);
341 if (!view) 341 if (!view)
342 return; 342 return;
343 343
344 delayed_send.Cancel(); 344 delayed_send.Cancel();
345 345
346 static const base::TimeDelta swap_delay = GetSwapDelay(); 346 static const base::TimeDelta swap_delay = GetSwapDelay();
347 if (swap_delay.ToInternalValue()) 347 if (swap_delay.ToInternalValue())
348 base::PlatformThread::Sleep(swap_delay); 348 base::PlatformThread::Sleep(swap_delay);
349 349
350 // View must send ACK message after next composite. 350 // View must send ACK message after next composite.
351 view->AcceleratedSurfaceBuffersSwapped(params, host_id_); 351 view->AcceleratedSurfaceBuffersSwapped(params, host_id_);
352 } 352 }
353 353
354 void GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer( 354 void GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer(
355 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params) { 355 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params) {
356 TRACE_EVENT0("renderer", 356 TRACE_EVENT0("renderer",
357 "GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer"); 357 "GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer");
358 358
359 ScopedSendOnIOThread delayed_send( 359 ScopedSendOnIOThread delayed_send(
360 host_id_, 360 host_id_,
361 new AcceleratedSurfaceMsg_PostSubBufferACK(params.route_id)); 361 new AcceleratedSurfaceMsg_BufferPresented(params.route_id));
362 362
363 RenderWidgetHostViewPort* view = 363 RenderWidgetHostViewPort* view =
364 GetRenderWidgetHostViewFromSurfaceID(params.surface_id); 364 GetRenderWidgetHostViewFromSurfaceID(params.surface_id);
365 if (!view) 365 if (!view)
366 return; 366 return;
367 367
368 delayed_send.Cancel(); 368 delayed_send.Cancel();
369 369
370 // View must send ACK message after next composite. 370 // View must send ACK message after next composite.
371 view->AcceleratedSurfacePostSubBuffer(params, host_id_); 371 view->AcceleratedSurfacePostSubBuffer(params, host_id_);
(...skipping 16 matching lines...) Expand all
388 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( 388 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease(
389 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { 389 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) {
390 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( 390 RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID(
391 params.surface_id); 391 params.surface_id);
392 if (!view) 392 if (!view)
393 return; 393 return;
394 view->AcceleratedSurfaceRelease(params.identifier); 394 view->AcceleratedSurfaceRelease(params.identifier);
395 } 395 }
396 396
397 #endif 397 #endif
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698