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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 std::unique_ptr<CompositorFrame> SurfaceAggregator::Aggregate( | 773 std::unique_ptr<CompositorFrame> SurfaceAggregator::Aggregate( |
774 SurfaceId surface_id) { | 774 SurfaceId surface_id) { |
775 Surface* surface = manager_->GetSurfaceForId(surface_id); | 775 Surface* surface = manager_->GetSurfaceForId(surface_id); |
776 DCHECK(surface); | 776 DCHECK(surface); |
777 contained_surfaces_[surface_id] = surface->frame_index(); | 777 contained_surfaces_[surface_id] = surface->frame_index(); |
778 const CompositorFrame* root_surface_frame = surface->GetEligibleFrame(); | 778 const CompositorFrame* root_surface_frame = surface->GetEligibleFrame(); |
779 if (!root_surface_frame) | 779 if (!root_surface_frame) |
780 return nullptr; | 780 return nullptr; |
781 TRACE_EVENT0("cc", "SurfaceAggregator::Aggregate"); | 781 TRACE_EVENT0("cc", "SurfaceAggregator::Aggregate"); |
782 | 782 |
783 std::unique_ptr<CompositorFrame> frame(new CompositorFrame); | 783 std::unique_ptr<CompositorFrame> frame(CompositorFrame::Create()); |
784 frame->delegated_frame_data = base::WrapUnique(new DelegatedFrameData); | 784 frame->delegated_frame_data = base::WrapUnique(new DelegatedFrameData); |
785 | 785 |
786 DCHECK(root_surface_frame->delegated_frame_data); | 786 DCHECK(root_surface_frame->delegated_frame_data); |
787 | 787 |
788 dest_resource_list_ = &frame->delegated_frame_data->resource_list; | 788 dest_resource_list_ = &frame->delegated_frame_data->resource_list; |
789 dest_pass_list_ = &frame->delegated_frame_data->render_pass_list; | 789 dest_pass_list_ = &frame->delegated_frame_data->render_pass_list; |
790 | 790 |
791 valid_surfaces_.clear(); | 791 valid_surfaces_.clear(); |
792 PrewalkResult prewalk_result; | 792 PrewalkResult prewalk_result; |
793 root_damage_rect_ = | 793 root_damage_rect_ = |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 | 839 |
840 void SurfaceAggregator::SetFullDamageForSurface(SurfaceId surface_id) { | 840 void SurfaceAggregator::SetFullDamageForSurface(SurfaceId surface_id) { |
841 auto it = previous_contained_surfaces_.find(surface_id); | 841 auto it = previous_contained_surfaces_.find(surface_id); |
842 if (it == previous_contained_surfaces_.end()) | 842 if (it == previous_contained_surfaces_.end()) |
843 return; | 843 return; |
844 // Set the last drawn index as 0 to ensure full damage next time it's drawn. | 844 // Set the last drawn index as 0 to ensure full damage next time it's drawn. |
845 it->second = 0; | 845 it->second = 0; |
846 } | 846 } |
847 | 847 |
848 } // namespace cc | 848 } // namespace cc |
OLD | NEW |