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

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

Issue 2339633003: Reland of cc: Remove frame queuing from the scheduler. (Closed)
Patch Set: prevent draw if commit is pending Created 4 years, 2 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 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/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 device_color_space_, device_viewport_rect, 319 device_color_space_, device_viewport_rect,
320 device_clip_rect); 320 device_clip_rect);
321 } else { 321 } else {
322 TRACE_EVENT_INSTANT0("cc", "Draw skipped.", TRACE_EVENT_SCOPE_THREAD); 322 TRACE_EVENT_INSTANT0("cc", "Draw skipped.", TRACE_EVENT_SCOPE_THREAD);
323 } 323 }
324 324
325 bool should_swap = should_draw && size_matches; 325 bool should_swap = should_draw && size_matches;
326 if (should_swap) { 326 if (should_swap) {
327 swapped_since_resize_ = true; 327 swapped_since_resize_ = true;
328 for (auto& latency : frame.metadata.latency_info) { 328 for (auto& latency : frame.metadata.latency_info) {
329 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", 329 TRACE_EVENT_WITH_FLOW1(
330 "input,benchmark", "LatencyInfo.Flow",
330 TRACE_ID_DONT_MANGLE(latency.trace_id()), 331 TRACE_ID_DONT_MANGLE(latency.trace_id()),
331 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, 332 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step",
332 "step", "Display::DrawAndSwap"); 333 "Display::DrawAndSwap");
333 } 334 }
334 benchmark_instrumentation::IssueDisplayRenderingStatsEvent(); 335 benchmark_instrumentation::IssueDisplayRenderingStatsEvent();
335 renderer_->SwapBuffers(std::move(frame.metadata)); 336 renderer_->SwapBuffers(std::move(frame.metadata));
336 if (scheduler_) 337 if (scheduler_)
337 scheduler_->DidSwapBuffers(); 338 scheduler_->DidSwapBuffers();
338 } else { 339 } else {
339 if (have_damage && !size_matches) 340 if (have_damage && !size_matches)
340 aggregator_->SetFullDamageForSurface(current_surface_id_); 341 aggregator_->SetFullDamageForSurface(current_surface_id_);
341 TRACE_EVENT_INSTANT0("cc", "Swap skipped.", TRACE_EVENT_SCOPE_THREAD); 342 TRACE_EVENT_INSTANT0("cc", "Swap skipped.", TRACE_EVENT_SCOPE_THREAD);
342 stored_latency_info_.insert(stored_latency_info_.end(), 343 stored_latency_info_.insert(stored_latency_info_.end(),
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 const SurfaceId& Display::CurrentSurfaceId() { 430 const SurfaceId& Display::CurrentSurfaceId() {
430 return current_surface_id_; 431 return current_surface_id_;
431 } 432 }
432 433
433 void Display::ForceImmediateDrawAndSwapIfPossible() { 434 void Display::ForceImmediateDrawAndSwapIfPossible() {
434 if (scheduler_) 435 if (scheduler_)
435 scheduler_->ForceImmediateSwapIfPossible(); 436 scheduler_->ForceImmediateSwapIfPossible();
436 } 437 }
437 438
438 } // namespace cc 439 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698