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

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

Issue 578383004: Limit outstanding surface draw swaps to max_frames_pending. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_client.h » ('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 "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/compositor_frame_ack.h" 10 #include "cc/output/compositor_frame_ack.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 aggregator_->previous_contained_surfaces().begin(); 125 aggregator_->previous_contained_surfaces().begin();
126 it != aggregator_->previous_contained_surfaces().end(); 126 it != aggregator_->previous_contained_surfaces().end();
127 ++it) { 127 ++it) {
128 Surface* surface = manager_->GetSurfaceForId(it->first); 128 Surface* surface = manager_->GetSurfaceForId(it->first);
129 if (surface) 129 if (surface)
130 surface->RunDrawCallbacks(); 130 surface->RunDrawCallbacks();
131 } 131 }
132 return true; 132 return true;
133 } 133 }
134 134
135 void Display::DidSwapBuffers() {
136 client_->DidSwapBuffers();
137 }
138
139 void Display::DidSwapBuffersComplete() {
140 client_->DidSwapBuffersComplete();
141 }
142
135 void Display::OnSurfaceDamaged(SurfaceId surface) { 143 void Display::OnSurfaceDamaged(SurfaceId surface) {
136 if (aggregator_ && aggregator_->previous_contained_surfaces().count(surface)) 144 if (aggregator_ && aggregator_->previous_contained_surfaces().count(surface))
137 client_->DisplayDamaged(); 145 client_->DisplayDamaged();
138 } 146 }
139 147
140 SurfaceId Display::CurrentSurfaceId() { 148 SurfaceId Display::CurrentSurfaceId() {
141 return current_surface_id_; 149 return current_surface_id_;
142 } 150 }
143 151
152 int Display::GetMaxFramesPending() {
153 if (!output_surface_)
154 return OutputSurface::DEFAULT_MAX_FRAMES_PENDING;
155 return output_surface_->capabilities().max_frames_pending;
156 }
157
144 } // namespace cc 158 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/display_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698