OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |