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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Only do this if Initialize() happened. | 55 // Only do this if Initialize() happened. |
56 if (client_) { | 56 if (client_) { |
57 if (begin_frame_source_) | 57 if (begin_frame_source_) |
58 surface_manager_->UnregisterBeginFrameSource(begin_frame_source_.get()); | 58 surface_manager_->UnregisterBeginFrameSource(begin_frame_source_.get()); |
59 surface_manager_->RemoveObserver(this); | 59 surface_manager_->RemoveObserver(this); |
60 } | 60 } |
61 if (aggregator_) { | 61 if (aggregator_) { |
62 for (const auto& id_entry : aggregator_->previous_contained_surfaces()) { | 62 for (const auto& id_entry : aggregator_->previous_contained_surfaces()) { |
63 Surface* surface = surface_manager_->GetSurfaceForId(id_entry.first); | 63 Surface* surface = surface_manager_->GetSurfaceForId(id_entry.first); |
64 if (surface) | 64 if (surface) |
65 surface->RunDrawCallbacks(SurfaceDrawStatus::DRAW_SKIPPED); | 65 surface->RunDrawCallbacks(); |
66 } | 66 } |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 void Display::Initialize(DisplayClient* client, | 70 void Display::Initialize(DisplayClient* client, |
71 SurfaceManager* surface_manager, | 71 SurfaceManager* surface_manager, |
72 uint32_t compositor_surface_namespace) { | 72 uint32_t compositor_surface_namespace) { |
73 DCHECK(client); | 73 DCHECK(client); |
74 DCHECK(surface_manager); | 74 DCHECK(surface_manager); |
75 client_ = client; | 75 client_ = client; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 if (!frame.delegated_frame_data) { | 235 if (!frame.delegated_frame_data) { |
236 TRACE_EVENT_INSTANT0("cc", "Empty aggregated frame.", | 236 TRACE_EVENT_INSTANT0("cc", "Empty aggregated frame.", |
237 TRACE_EVENT_SCOPE_THREAD); | 237 TRACE_EVENT_SCOPE_THREAD); |
238 return false; | 238 return false; |
239 } | 239 } |
240 | 240 |
241 // Run callbacks early to allow pipelining. | 241 // Run callbacks early to allow pipelining. |
242 for (const auto& id_entry : aggregator_->previous_contained_surfaces()) { | 242 for (const auto& id_entry : aggregator_->previous_contained_surfaces()) { |
243 Surface* surface = surface_manager_->GetSurfaceForId(id_entry.first); | 243 Surface* surface = surface_manager_->GetSurfaceForId(id_entry.first); |
244 if (surface) | 244 if (surface) |
245 surface->RunDrawCallbacks(SurfaceDrawStatus::DRAWN); | 245 surface->RunDrawCallbacks(); |
246 } | 246 } |
247 | 247 |
248 DelegatedFrameData* frame_data = frame.delegated_frame_data.get(); | 248 DelegatedFrameData* frame_data = frame.delegated_frame_data.get(); |
249 | 249 |
250 frame.metadata.latency_info.insert(frame.metadata.latency_info.end(), | 250 frame.metadata.latency_info.insert(frame.metadata.latency_info.end(), |
251 stored_latency_info_.begin(), | 251 stored_latency_info_.begin(), |
252 stored_latency_info_.end()); | 252 stored_latency_info_.end()); |
253 stored_latency_info_.clear(); | 253 stored_latency_info_.clear(); |
254 bool have_copy_requests = false; | 254 bool have_copy_requests = false; |
255 for (const auto& pass : frame_data->render_pass_list) { | 255 for (const auto& pass : frame_data->render_pass_list) { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 421 |
422 if (surface_id == current_surface_id_) | 422 if (surface_id == current_surface_id_) |
423 UpdateRootSurfaceResourcesLocked(); | 423 UpdateRootSurfaceResourcesLocked(); |
424 } | 424 } |
425 | 425 |
426 const SurfaceId& Display::CurrentSurfaceId() { | 426 const SurfaceId& Display::CurrentSurfaceId() { |
427 return current_surface_id_; | 427 return current_surface_id_; |
428 } | 428 } |
429 | 429 |
430 } // namespace cc | 430 } // namespace cc |
OLD | NEW |