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

Side by Side Diff: cc/surfaces/display.cc

Issue 2966803002: Limit the size of latency info storage (Closed)
Patch Set: Separate the checks for clarity Created 3 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
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/display_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/surfaces/display.h" 5 #include "cc/surfaces/display.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 "Display::DrawAndSwap"); 333 "Display::DrawAndSwap");
334 } 334 }
335 benchmark_instrumentation::IssueDisplayRenderingStatsEvent(); 335 benchmark_instrumentation::IssueDisplayRenderingStatsEvent();
336 renderer_->SwapBuffers(std::move(frame.metadata.latency_info)); 336 renderer_->SwapBuffers(std::move(frame.metadata.latency_info));
337 if (scheduler_) 337 if (scheduler_)
338 scheduler_->DidSwapBuffers(); 338 scheduler_->DidSwapBuffers();
339 } else { 339 } else {
340 if (have_damage && !size_matches) 340 if (have_damage && !size_matches)
341 aggregator_->SetFullDamageForSurface(current_surface_id_); 341 aggregator_->SetFullDamageForSurface(current_surface_id_);
342 TRACE_EVENT_INSTANT0("cc", "Swap skipped.", TRACE_EVENT_SCOPE_THREAD); 342 TRACE_EVENT_INSTANT0("cc", "Swap skipped.", TRACE_EVENT_SCOPE_THREAD);
343 stored_latency_info_.insert(stored_latency_info_.end(), 343
344 frame.metadata.latency_info.begin(), 344 // Do not store more that the allowed size.
345 frame.metadata.latency_info.end()); 345 if (ui::LatencyInfo::Verify(frame.metadata.latency_info,
346 "Display::DrawAndSwap")) {
347 stored_latency_info_.insert(stored_latency_info_.end(),
348 frame.metadata.latency_info.begin(),
349 frame.metadata.latency_info.end());
350 }
351
346 if (scheduler_) { 352 if (scheduler_) {
347 scheduler_->DidSwapBuffers(); 353 scheduler_->DidSwapBuffers();
348 scheduler_->DidReceiveSwapBuffersAck(); 354 scheduler_->DidReceiveSwapBuffersAck();
349 } 355 }
350 } 356 }
351 357
352 client_->DisplayDidDrawAndSwap(); 358 client_->DisplayDidDrawAndSwap();
353 return true; 359 return true;
354 } 360 }
355 361
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 const SurfaceId& Display::CurrentSurfaceId() { 424 const SurfaceId& Display::CurrentSurfaceId() {
419 return current_surface_id_; 425 return current_surface_id_;
420 } 426 }
421 427
422 void Display::ForceImmediateDrawAndSwapIfPossible() { 428 void Display::ForceImmediateDrawAndSwapIfPossible() {
423 if (scheduler_) 429 if (scheduler_)
424 scheduler_->ForceImmediateSwapIfPossible(); 430 scheduler_->ForceImmediateSwapIfPossible();
425 } 431 }
426 432
427 } // namespace cc 433 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698