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 11 matching lines...) Expand all Loading... |
22 #include "cc/surfaces/surface_factory.h" | 22 #include "cc/surfaces/surface_factory.h" |
23 #include "cc/surfaces/surface_manager.h" | 23 #include "cc/surfaces/surface_manager.h" |
24 #include "cc/trees/blocking_task_runner.h" | 24 #include "cc/trees/blocking_task_runner.h" |
25 | 25 |
26 namespace cc { | 26 namespace cc { |
27 namespace { | 27 namespace { |
28 | 28 |
29 void MoveMatchingRequests( | 29 void MoveMatchingRequests( |
30 RenderPassId id, | 30 RenderPassId id, |
31 std::multimap<RenderPassId, CopyOutputRequest*>* copy_requests, | 31 std::multimap<RenderPassId, CopyOutputRequest*>* copy_requests, |
32 ScopedPtrVector<CopyOutputRequest>* output_requests) { | 32 std::vector<scoped_ptr<CopyOutputRequest>>* output_requests) { |
33 auto request_range = copy_requests->equal_range(id); | 33 auto request_range = copy_requests->equal_range(id); |
34 for (auto it = request_range.first; it != request_range.second; ++it) { | 34 for (auto it = request_range.first; it != request_range.second; ++it) { |
35 DCHECK(it->second); | 35 DCHECK(it->second); |
36 output_requests->push_back(scoped_ptr<CopyOutputRequest>(it->second)); | 36 output_requests->push_back(scoped_ptr<CopyOutputRequest>(it->second)); |
37 it->second = nullptr; | 37 it->second = nullptr; |
38 } | 38 } |
39 copy_requests->erase(request_range.first, request_range.second); | 39 copy_requests->erase(request_range.first, request_range.second); |
40 } | 40 } |
41 | 41 |
42 } // namespace | 42 } // namespace |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 valid_surfaces_.insert(surface->surface_id()); | 569 valid_surfaces_.insert(surface->surface_id()); |
570 | 570 |
571 if (provider_) | 571 if (provider_) |
572 provider_->DeclareUsedResourcesFromChild(child_id, referenced_resources); | 572 provider_->DeclareUsedResourcesFromChild(child_id, referenced_resources); |
573 | 573 |
574 for (const auto& render_pass : frame_data->render_pass_list) | 574 for (const auto& render_pass : frame_data->render_pass_list) |
575 has_copy_requests_ |= !render_pass->copy_requests.empty(); | 575 has_copy_requests_ |= !render_pass->copy_requests.empty(); |
576 | 576 |
577 gfx::Rect damage_rect; | 577 gfx::Rect damage_rect; |
578 if (!frame_data->render_pass_list.empty()) { | 578 if (!frame_data->render_pass_list.empty()) { |
579 RenderPass* last_pass = frame_data->render_pass_list.back(); | 579 RenderPass* last_pass = frame_data->render_pass_list.back().get(); |
580 damage_rect = | 580 damage_rect = |
581 DamageRectForSurface(surface, *last_pass, last_pass->output_rect); | 581 DamageRectForSurface(surface, *last_pass, last_pass->output_rect); |
582 } | 582 } |
583 | 583 |
584 // Avoid infinite recursion by adding current surface to | 584 // Avoid infinite recursion by adding current surface to |
585 // referenced_surfaces_. | 585 // referenced_surfaces_. |
586 SurfaceSet::iterator it = | 586 SurfaceSet::iterator it = |
587 referenced_surfaces_.insert(surface->surface_id()).first; | 587 referenced_surfaces_.insert(surface->surface_id()).first; |
588 for (const auto& surface_info : child_surfaces) { | 588 for (const auto& surface_info : child_surfaces) { |
589 gfx::Rect surface_damage = PrewalkTree(surface_info.first); | 589 gfx::Rect surface_damage = PrewalkTree(surface_info.first); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 | 655 |
656 void SurfaceAggregator::SetFullDamageForSurface(SurfaceId surface_id) { | 656 void SurfaceAggregator::SetFullDamageForSurface(SurfaceId surface_id) { |
657 auto it = previous_contained_surfaces_.find(surface_id); | 657 auto it = previous_contained_surfaces_.find(surface_id); |
658 if (it == previous_contained_surfaces_.end()) | 658 if (it == previous_contained_surfaces_.end()) |
659 return; | 659 return; |
660 // Set the last drawn index as 0 to ensure full damage next time it's drawn. | 660 // Set the last drawn index as 0 to ensure full damage next time it's drawn. |
661 it->second = 0; | 661 it->second = 0; |
662 } | 662 } |
663 | 663 |
664 } // namespace cc | 664 } // namespace cc |
OLD | NEW |