| Index: cc/surfaces/surface_aggregator.cc
|
| diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
|
| index 1d1ea7a42cafad0418d9d9b5715eb6a88c3b67d8..db1366da53cac0239eb0d95bb097ebc17893b0e7 100644
|
| --- a/cc/surfaces/surface_aggregator.cc
|
| +++ b/cc/surfaces/surface_aggregator.cc
|
| @@ -144,7 +144,8 @@
|
| }
|
|
|
| int SurfaceAggregator::ChildIdForSurface(Surface* surface) {
|
| - auto it = surface_id_to_resource_child_id_.find(surface->surface_id());
|
| + SurfaceToResourceChildIdMap::iterator it =
|
| + surface_id_to_resource_child_id_.find(surface->surface_id());
|
| if (it == surface_id_to_resource_child_id_.end()) {
|
| int child_id =
|
| provider_->CreateChild(base::Bind(&UnrefHelper, surface->factory()));
|
| @@ -238,7 +239,7 @@
|
| return;
|
| }
|
|
|
| - auto it = referenced_surfaces_.insert(surface_id).first;
|
| + SurfaceSet::iterator it = referenced_surfaces_.insert(surface_id).first;
|
| // TODO(vmpstr): provider check is a hack for unittests that don't set up a
|
| // resource provider.
|
| ResourceProvider::ResourceIdMap empty_map;
|
| @@ -567,7 +568,8 @@
|
| for (const auto& surface : previous_contained_surfaces_) {
|
| if (!contained_surfaces_.count(surface.first)) {
|
| // Release resources of removed surface.
|
| - auto it = surface_id_to_resource_child_id_.find(surface.first);
|
| + SurfaceToResourceChildIdMap::iterator it =
|
| + surface_id_to_resource_child_id_.find(surface.first);
|
| if (it != surface_id_to_resource_child_id_.end()) {
|
| provider_->DestroyChild(it->second);
|
| surface_id_to_resource_child_id_.erase(it);
|
| @@ -651,18 +653,13 @@
|
| };
|
| std::vector<SurfaceInfo> child_surfaces;
|
|
|
| - // This data is created once and typically small or empty. Collect all items
|
| - // and pass to a flat_vector to sort once.
|
| - std::vector<int> pixel_moving_background_filter_passes_data;
|
| + std::unordered_set<int> pixel_moving_background_filter_passes;
|
| for (const auto& render_pass : frame.render_pass_list) {
|
| if (render_pass->background_filters.HasFilterThatMovesPixels()) {
|
| - pixel_moving_background_filter_passes_data.push_back(
|
| + pixel_moving_background_filter_passes.insert(
|
| RemapPassId(render_pass->id, surface_id));
|
| }
|
| }
|
| - base::flat_set<int> pixel_moving_background_filter_passes(
|
| - std::move(pixel_moving_background_filter_passes_data),
|
| - base::KEEP_FIRST_OF_DUPES);
|
|
|
| for (const auto& render_pass : base::Reversed(frame.render_pass_list)) {
|
| int remapped_pass_id = RemapPassId(render_pass->id, surface_id);
|
| @@ -729,7 +726,8 @@
|
|
|
| // Avoid infinite recursion by adding current surface to
|
| // referenced_surfaces_.
|
| - referenced_surfaces_.insert(surface->surface_id());
|
| + SurfaceSet::iterator it =
|
| + referenced_surfaces_.insert(surface->surface_id()).first;
|
| for (const auto& surface_info : child_surfaces) {
|
| gfx::Rect surface_damage =
|
| PrewalkTree(surface_info.id, surface_info.has_moved_pixels,
|
| @@ -769,7 +767,7 @@
|
| }
|
| }
|
|
|
| - referenced_surfaces_.erase(referenced_surfaces_.find(surface->surface_id()));
|
| + referenced_surfaces_.erase(it);
|
| if (!damage_rect.IsEmpty() && frame.metadata.may_contain_video)
|
| result->may_contain_video = true;
|
| return damage_rect;
|
| @@ -810,7 +808,7 @@
|
| }
|
| }
|
| } else {
|
| - auto it = referenced_surfaces_.insert(surface_id).first;
|
| + SurfaceSet::iterator it = referenced_surfaces_.insert(surface_id).first;
|
| CopyPasses(frame, surface);
|
| referenced_surfaces_.erase(it);
|
| }
|
| @@ -860,7 +858,7 @@
|
| frame.metadata.may_contain_video = prewalk_result.may_contain_video;
|
|
|
| CopyUndrawnSurfaces(&prewalk_result);
|
| - auto it = referenced_surfaces_.insert(surface_id).first;
|
| + SurfaceSet::iterator it = referenced_surfaces_.insert(surface_id).first;
|
| CopyPasses(root_surface_frame, surface);
|
| referenced_surfaces_.erase(it);
|
| AddColorConversionPass();
|
| @@ -914,7 +912,8 @@
|
| }
|
|
|
| void SurfaceAggregator::ReleaseResources(const SurfaceId& surface_id) {
|
| - auto it = surface_id_to_resource_child_id_.find(surface_id);
|
| + SurfaceToResourceChildIdMap::iterator it =
|
| + surface_id_to_resource_child_id_.find(surface_id);
|
| if (it != surface_id_to_resource_child_id_.end()) {
|
| provider_->DestroyChild(it->second);
|
| surface_id_to_resource_child_id_.erase(it);
|
|
|