| 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" | |
| 8 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.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" |
| 11 #include "cc/output/compositor_frame_ack.h" | 11 #include "cc/output/compositor_frame_ack.h" |
| 12 #include "cc/output/direct_renderer.h" | 12 #include "cc/output/direct_renderer.h" |
| 13 #include "cc/output/gl_renderer.h" | 13 #include "cc/output/gl_renderer.h" |
| 14 #include "cc/output/renderer_settings.h" | 14 #include "cc/output/renderer_settings.h" |
| 15 #include "cc/output/software_renderer.h" | 15 #include "cc/output/software_renderer.h" |
| 16 #include "cc/resources/texture_mailbox_deleter.h" | 16 #include "cc/resources/texture_mailbox_deleter.h" |
| 17 #include "cc/surfaces/display_client.h" | 17 #include "cc/surfaces/display_client.h" |
| 18 #include "cc/surfaces/surface.h" | 18 #include "cc/surfaces/surface.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 client_->DisplayDamaged(); | 191 client_->DisplayDamaged(); |
| 192 *changed = true; | 192 *changed = true; |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 | 195 |
| 196 SurfaceId Display::CurrentSurfaceId() { | 196 SurfaceId Display::CurrentSurfaceId() { |
| 197 return current_surface_id_; | 197 return current_surface_id_; |
| 198 } | 198 } |
| 199 | 199 |
| 200 int Display::GetMaxFramesPending() { | 200 int Display::GetMaxFramesPending() { |
| 201 if (!output_surface_) | 201 int max_frames_pending = |
| 202 return OutputSurface::DEFAULT_MAX_FRAMES_PENDING; | 202 output_surface_ ? output_surface_->capabilities().max_frames_pending : 0; |
| 203 return output_surface_->capabilities().max_frames_pending; | 203 if (max_frames_pending <= 0) |
| 204 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; |
| 205 return max_frames_pending; |
| 204 } | 206 } |
| 205 | 207 |
| 206 } // namespace cc | 208 } // namespace cc |
| OLD | NEW |