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

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

Issue 800133002: Release resources from SurfaceAggregator when new frame arrives. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | cc/surfaces/surface_aggregator.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/debug/benchmark_instrumentation.h" 9 #include "cc/debug/benchmark_instrumentation.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 void Display::CommitVSyncParameters(base::TimeTicks timebase, 162 void Display::CommitVSyncParameters(base::TimeTicks timebase,
163 base::TimeDelta interval) { 163 base::TimeDelta interval) {
164 client_->CommitVSyncParameters(timebase, interval); 164 client_->CommitVSyncParameters(timebase, interval);
165 } 165 }
166 166
167 void Display::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { 167 void Display::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
168 client_->SetMemoryPolicy(policy); 168 client_->SetMemoryPolicy(policy);
169 } 169 }
170 170
171 void Display::OnSurfaceDamaged(SurfaceId surface) { 171 void Display::OnSurfaceDamaged(SurfaceId surface) {
172 if (aggregator_ && aggregator_->previous_contained_surfaces().count(surface)) 172 if (aggregator_ &&
173 aggregator_->previous_contained_surfaces().count(surface)) {
174 aggregator_->ReleaseResources(surface);
jamesr 2014/12/13 01:54:26 it's a little fragile here that we have to make su
173 client_->DisplayDamaged(); 175 client_->DisplayDamaged();
176 }
174 } 177 }
175 178
176 SurfaceId Display::CurrentSurfaceId() { 179 SurfaceId Display::CurrentSurfaceId() {
177 return current_surface_id_; 180 return current_surface_id_;
178 } 181 }
179 182
180 int Display::GetMaxFramesPending() { 183 int Display::GetMaxFramesPending() {
181 if (!output_surface_) 184 if (!output_surface_)
182 return OutputSurface::DEFAULT_MAX_FRAMES_PENDING; 185 return OutputSurface::DEFAULT_MAX_FRAMES_PENDING;
183 return output_surface_->capabilities().max_frames_pending; 186 return output_surface_->capabilities().max_frames_pending;
184 } 187 }
185 188
186 } // namespace cc 189 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/surface_aggregator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698