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

Unified Diff: content/browser/gpu/gpu_process_host.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: Upon receving ViewHostMsg_CompositorSurfaceBuffersSwapped, CHECK LatencyInfo list size 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 9e5861e3e6fe446bd48f8d29612263c436683fec..9552ad4fbee3a73b45b36c269c7726cbbe8ec485 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -64,6 +64,8 @@ bool GpuProcessHost::hardware_gpu_enabled_ = true;
namespace {
+const unsigned int kMaxLatencyInfoNumber = 100;
+
enum GPUProcessLifetimeEvent {
LAUNCHED,
DIED_FIRST_TIME,
@@ -132,7 +134,7 @@ void AcceleratedSurfaceBuffersSwappedCompletedForRenderer(
int surface_id,
base::TimeTicks timebase,
base::TimeDelta interval,
- const ui::LatencyInfo& latency_info) {
+ const std::vector<ui::LatencyInfo>& latency_info) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI,
@@ -167,7 +169,7 @@ void AcceleratedSurfaceBuffersSwappedCompleted(
bool alive,
base::TimeTicks timebase,
base::TimeDelta interval,
- const ui::LatencyInfo& latency_info) {
+ const std::vector<ui::LatencyInfo>& latency_info) {
AcceleratedSurfaceBuffersSwappedCompletedForGPU(
host_id, route_id, alive, timebase, interval);
AcceleratedSurfaceBuffersSwappedCompletedForRenderer(
@@ -918,6 +920,12 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(
view_params.scale_factor = params.scale_factor;
view_params.gpu_process_host_id = host_id_;
view_params.latency_info = params.latency_info;
+ if (view_params.latency_info.size() > kMaxLatencyInfoNumber) {
+ for (size_t i = 0; i < view_params.latency_info.size(); i++)
+ view_params.latency_info[i].AddLatencyNumber(
+ ui::LATENCY_INFO_LIST_TERMINATED_OVERFLOW_COMPONENT, 0, 0);
+ view_params.latency_info.clear();
+ }
helper->DidReceiveBackingStoreMsg(ViewHostMsg_CompositorSurfaceBuffersSwapped(
render_widget_id,
view_params));
@@ -932,7 +940,8 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(
base::ScopedClosureRunner scoped_completion_runner(
base::Bind(&AcceleratedSurfaceBuffersSwappedCompleted,
host_id_, params.route_id, params.surface_id,
- true, base::TimeTicks(), base::TimeDelta(), ui::LatencyInfo()));
+ true, base::TimeTicks(), base::TimeDelta(),
+ std::vector<ui::LatencyInfo>()));
gfx::GLSurfaceHandle handle =
GpuSurfaceTracker::Get()->GetSurfaceHandle(params.surface_id);

Powered by Google App Engine
This is Rietveld 408576698