| 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/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 bool Display::DrawAndSwap() { | 143 bool Display::DrawAndSwap() { |
| 144 if (current_surface_id_.is_null()) | 144 if (current_surface_id_.is_null()) |
| 145 return false; | 145 return false; |
| 146 | 146 |
| 147 InitializeRenderer(); | 147 InitializeRenderer(); |
| 148 if (!output_surface_) | 148 if (!output_surface_) |
| 149 return false; | 149 return false; |
| 150 | 150 |
| 151 if (output_surface_->SurfaceIsSuspendForRecycle()) |
| 152 return false; |
| 153 |
| 151 scoped_ptr<CompositorFrame> frame = | 154 scoped_ptr<CompositorFrame> frame = |
| 152 aggregator_->Aggregate(current_surface_id_); | 155 aggregator_->Aggregate(current_surface_id_); |
| 153 if (!frame) | 156 if (!frame) |
| 154 return false; | 157 return false; |
| 155 | 158 |
| 156 TRACE_EVENT0("cc", "Display::DrawAndSwap"); | 159 TRACE_EVENT0("cc", "Display::DrawAndSwap"); |
| 157 benchmark_instrumentation::IssueDisplayRenderingStatsEvent(); | 160 benchmark_instrumentation::IssueDisplayRenderingStatsEvent(); |
| 158 | 161 |
| 159 // Run callbacks early to allow pipelining. | 162 // Run callbacks early to allow pipelining. |
| 160 for (const auto& id_entry : aggregator_->previous_contained_surfaces()) { | 163 for (const auto& id_entry : aggregator_->previous_contained_surfaces()) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 286 |
| 284 if (surface_id == current_surface_id_) | 287 if (surface_id == current_surface_id_) |
| 285 UpdateRootSurfaceResourcesLocked(); | 288 UpdateRootSurfaceResourcesLocked(); |
| 286 } | 289 } |
| 287 | 290 |
| 288 SurfaceId Display::CurrentSurfaceId() { | 291 SurfaceId Display::CurrentSurfaceId() { |
| 289 return current_surface_id_; | 292 return current_surface_id_; |
| 290 } | 293 } |
| 291 | 294 |
| 292 } // namespace cc | 295 } // namespace cc |
| OLD | NEW |