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