| 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 SurfaceSet::iterator it = referenced_surfaces_.insert(surface_id).first; | 409 SurfaceSet::iterator it = referenced_surfaces_.insert(surface_id).first; |
| 410 | 410 |
| 411 dest_resource_list_ = &frame->delegated_frame_data->resource_list; | 411 dest_resource_list_ = &frame->delegated_frame_data->resource_list; |
| 412 dest_pass_list_ = &frame->delegated_frame_data->render_pass_list; | 412 dest_pass_list_ = &frame->delegated_frame_data->render_pass_list; |
| 413 | 413 |
| 414 CopyPasses(root_surface_frame->delegated_frame_data.get(), surface); | 414 CopyPasses(root_surface_frame->delegated_frame_data.get(), surface); |
| 415 | 415 |
| 416 referenced_surfaces_.erase(it); | 416 referenced_surfaces_.erase(it); |
| 417 DCHECK(referenced_surfaces_.empty()); | 417 DCHECK(referenced_surfaces_.empty()); |
| 418 | 418 |
| 419 if (dest_pass_list_->empty()) |
| 420 return nullptr; |
| 421 |
| 419 dest_pass_list_ = NULL; | 422 dest_pass_list_ = NULL; |
| 420 RemoveUnreferencedChildren(); | 423 RemoveUnreferencedChildren(); |
| 421 contained_surfaces_.swap(previous_contained_surfaces_); | 424 contained_surfaces_.swap(previous_contained_surfaces_); |
| 422 contained_surfaces_.clear(); | 425 contained_surfaces_.clear(); |
| 423 | 426 |
| 424 for (SurfaceIndexMap::iterator it = previous_contained_surfaces_.begin(); | 427 for (SurfaceIndexMap::iterator it = previous_contained_surfaces_.begin(); |
| 425 it != previous_contained_surfaces_.end(); | 428 it != previous_contained_surfaces_.end(); |
| 426 ++it) { | 429 ++it) { |
| 427 Surface* surface = manager_->GetSurfaceForId(it->first); | 430 Surface* surface = manager_->GetSurfaceForId(it->first); |
| 428 if (surface) | 431 if (surface) |
| 429 surface->TakeLatencyInfo(&frame->metadata.latency_info); | 432 surface->TakeLatencyInfo(&frame->metadata.latency_info); |
| 430 } | 433 } |
| 431 | 434 |
| 432 // TODO(jamesr): Aggregate all resource references into the returned frame's | 435 // TODO(jamesr): Aggregate all resource references into the returned frame's |
| 433 // resource list. | 436 // resource list. |
| 434 | 437 |
| 435 return frame.Pass(); | 438 return frame.Pass(); |
| 436 } | 439 } |
| 437 | 440 |
| 438 } // namespace cc | 441 } // namespace cc |
| OLD | NEW |