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/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 void Display::CommitVSyncParameters(base::TimeTicks timebase, | 190 void Display::CommitVSyncParameters(base::TimeTicks timebase, |
191 base::TimeDelta interval) { | 191 base::TimeDelta interval) { |
192 client_->CommitVSyncParameters(timebase, interval); | 192 client_->CommitVSyncParameters(timebase, interval); |
193 } | 193 } |
194 | 194 |
195 void Display::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { | 195 void Display::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
196 client_->SetMemoryPolicy(policy); | 196 client_->SetMemoryPolicy(policy); |
197 } | 197 } |
198 | 198 |
199 void Display::OnDraw() { | |
200 NOTREACHED(); | |
201 } | |
202 | |
203 void Display::OnSurfaceDamaged(SurfaceId surface_id, bool* changed) { | 199 void Display::OnSurfaceDamaged(SurfaceId surface_id, bool* changed) { |
204 if (aggregator_ && | 200 if (aggregator_ && |
205 aggregator_->previous_contained_surfaces().count(surface_id)) { | 201 aggregator_->previous_contained_surfaces().count(surface_id)) { |
206 Surface* surface = manager_->GetSurfaceForId(surface_id); | 202 Surface* surface = manager_->GetSurfaceForId(surface_id); |
207 if (surface) { | 203 if (surface) { |
208 const CompositorFrame* current_frame = surface->GetEligibleFrame(); | 204 const CompositorFrame* current_frame = surface->GetEligibleFrame(); |
209 if (!current_frame || !current_frame->delegated_frame_data || | 205 if (!current_frame || !current_frame->delegated_frame_data || |
210 !current_frame->delegated_frame_data->resource_list.size()) | 206 !current_frame->delegated_frame_data->resource_list.size()) |
211 aggregator_->ReleaseResources(surface_id); | 207 aggregator_->ReleaseResources(surface_id); |
212 } | 208 } |
(...skipping 11 matching lines...) Expand all Loading... |
224 | 220 |
225 int Display::GetMaxFramesPending() { | 221 int Display::GetMaxFramesPending() { |
226 int max_frames_pending = | 222 int max_frames_pending = |
227 output_surface_ ? output_surface_->capabilities().max_frames_pending : 0; | 223 output_surface_ ? output_surface_->capabilities().max_frames_pending : 0; |
228 if (max_frames_pending <= 0) | 224 if (max_frames_pending <= 0) |
229 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; | 225 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; |
230 return max_frames_pending; | 226 return max_frames_pending; |
231 } | 227 } |
232 | 228 |
233 } // namespace cc | 229 } // namespace cc |
OLD | NEW |