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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 123563002: Remove gpu side LatencyInfo merging (Closed) Base URL: http://git.chromium.org/chromium/src.git@gpu-per-event-latency-6-small
Patch Set: fix mac_rel compiler error. Move kMaxLatencyInfoNumber to .cc file 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
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/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, 1462 NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK,
1463 Source<RenderWidgetHost>(this), 1463 Source<RenderWidgetHost>(this),
1464 Details<std::pair<int, gfx::Size> >(&details)); 1464 Details<std::pair<int, gfx::Size> >(&details));
1465 } 1465 }
1466 1466
1467 #if defined(OS_MACOSX) 1467 #if defined(OS_MACOSX)
1468 void RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped( 1468 void RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped(
1469 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params) { 1469 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params) {
1470 TRACE_EVENT0("renderer_host", 1470 TRACE_EVENT0("renderer_host",
1471 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped"); 1471 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped");
1472 if (!ui::LatencyInfo::Verify(params.latency_info,
1473 "ViewHostMsg_CompositorSurfaceBuffersSwapped"))
1474 return;
1472 if (!view_) { 1475 if (!view_) {
1473 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; 1476 AcceleratedSurfaceMsg_BufferPresented_Params ack_params;
1474 ack_params.sync_point = 0; 1477 ack_params.sync_point = 0;
1475 RenderWidgetHostImpl::AcknowledgeBufferPresent(params.route_id, 1478 RenderWidgetHostImpl::AcknowledgeBufferPresent(params.route_id,
1476 params.gpu_process_host_id, 1479 params.gpu_process_host_id,
1477 ack_params); 1480 ack_params);
1478 return; 1481 return;
1479 } 1482 }
1480 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params gpu_params; 1483 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params gpu_params;
1481 gpu_params.surface_id = params.surface_id; 1484 gpu_params.surface_id = params.surface_id;
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
2443 return; 2446 return;
2444 } 2447 }
2445 } 2448 }
2446 2449
2447 Send(new ViewMsg_WindowSnapshotCompleted( 2450 Send(new ViewMsg_WindowSnapshotCompleted(
2448 GetRoutingID(), snapshot_id, gfx::Size(), png)); 2451 GetRoutingID(), snapshot_id, gfx::Size(), png));
2449 } 2452 }
2450 2453
2451 // static 2454 // static
2452 void RenderWidgetHostImpl::CompositorFrameDrawn( 2455 void RenderWidgetHostImpl::CompositorFrameDrawn(
2453 const ui::LatencyInfo& latency_info) { 2456 const std::vector<ui::LatencyInfo>& latency_info) {
2454 std::set<RenderWidgetHostImpl*> rwhi_set; 2457 for (size_t i = 0; i < latency_info.size(); i++) {
2455 2458 std::set<RenderWidgetHostImpl*> rwhi_set;
2456 for (ui::LatencyInfo::LatencyMap::const_iterator b = 2459 for (ui::LatencyInfo::LatencyMap::const_iterator b =
2457 latency_info.latency_components.begin(); 2460 latency_info[i].latency_components.begin();
2458 b != latency_info.latency_components.end(); 2461 b != latency_info[i].latency_components.end();
2459 ++b) { 2462 ++b) {
2460 if (b->first.first == ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT || 2463 if (b->first.first == ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT ||
2461 b->first.first == ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT) { 2464 b->first.first == ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT) {
2462 // Matches with GetLatencyComponentId 2465 // Matches with GetLatencyComponentId
2463 int routing_id = b->first.second & 0xffffffff; 2466 int routing_id = b->first.second & 0xffffffff;
2464 int process_id = (b->first.second >> 32) & 0xffffffff; 2467 int process_id = (b->first.second >> 32) & 0xffffffff;
2465 RenderWidgetHost* rwh = 2468 RenderWidgetHost* rwh =
2466 RenderWidgetHost::FromID(process_id, routing_id); 2469 RenderWidgetHost::FromID(process_id, routing_id);
2467 if (!rwh) { 2470 if (!rwh) {
2468 continue; 2471 continue;
2472 }
2473 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh);
2474 if (rwhi_set.insert(rwhi).second)
2475 rwhi->FrameSwapped(latency_info[i]);
2469 } 2476 }
2470 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh);
2471 if (rwhi_set.insert(rwhi).second)
2472 rwhi->FrameSwapped(latency_info);
2473 } 2477 }
2474 } 2478 }
2475 } 2479 }
2476 2480
2477 } // namespace content 2481 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698