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/surface_aggregator.h" | 5 #include "cc/surfaces/surface_aggregator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 dest_pass_list_->push_back(copy_pass.Pass()); | 348 dest_pass_list_->push_back(copy_pass.Pass()); |
349 } | 349 } |
350 } | 350 } |
351 | 351 |
352 scoped_ptr<CompositorFrame> SurfaceAggregator::Aggregate(SurfaceId surface_id) { | 352 scoped_ptr<CompositorFrame> SurfaceAggregator::Aggregate(SurfaceId surface_id) { |
353 Surface* surface = manager_->GetSurfaceForId(surface_id); | 353 Surface* surface = manager_->GetSurfaceForId(surface_id); |
354 DCHECK(surface); | 354 DCHECK(surface); |
355 contained_surfaces_[surface_id] = surface->frame_index(); | 355 contained_surfaces_[surface_id] = surface->frame_index(); |
356 const CompositorFrame* root_surface_frame = surface->GetEligibleFrame(); | 356 const CompositorFrame* root_surface_frame = surface->GetEligibleFrame(); |
357 if (!root_surface_frame) | 357 if (!root_surface_frame) |
358 return scoped_ptr<CompositorFrame>(); | 358 return nullptr; |
359 TRACE_EVENT0("cc", "SurfaceAggregator::Aggregate"); | 359 TRACE_EVENT0("cc", "SurfaceAggregator::Aggregate"); |
360 | 360 |
361 scoped_ptr<CompositorFrame> frame(new CompositorFrame); | 361 scoped_ptr<CompositorFrame> frame(new CompositorFrame); |
362 frame->delegated_frame_data = make_scoped_ptr(new DelegatedFrameData); | 362 frame->delegated_frame_data = make_scoped_ptr(new DelegatedFrameData); |
363 | 363 |
364 DCHECK(root_surface_frame->delegated_frame_data); | 364 DCHECK(root_surface_frame->delegated_frame_data); |
365 | 365 |
366 RenderPassList source_pass_list; | 366 RenderPassList source_pass_list; |
367 | 367 |
368 SurfaceSet::iterator it = referenced_surfaces_.insert(surface_id).first; | 368 SurfaceSet::iterator it = referenced_surfaces_.insert(surface_id).first; |
(...skipping 24 matching lines...) Expand all Loading... |
393 surface->TakeLatencyInfo(&frame->metadata.latency_info); | 393 surface->TakeLatencyInfo(&frame->metadata.latency_info); |
394 } | 394 } |
395 | 395 |
396 // TODO(jamesr): Aggregate all resource references into the returned frame's | 396 // TODO(jamesr): Aggregate all resource references into the returned frame's |
397 // resource list. | 397 // resource list. |
398 | 398 |
399 return frame.Pass(); | 399 return frame.Pass(); |
400 } | 400 } |
401 | 401 |
402 } // namespace cc | 402 } // namespace cc |
OLD | NEW |