| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return allocator->Remap(surface_local_pass_id); | 125 return allocator->Remap(surface_local_pass_id); |
| 126 } | 126 } |
| 127 | 127 |
| 128 int SurfaceAggregator::ChildIdForSurface(Surface* surface) { | 128 int SurfaceAggregator::ChildIdForSurface(Surface* surface) { |
| 129 SurfaceToResourceChildIdMap::iterator it = | 129 SurfaceToResourceChildIdMap::iterator it = |
| 130 surface_id_to_resource_child_id_.find(surface->surface_id()); | 130 surface_id_to_resource_child_id_.find(surface->surface_id()); |
| 131 if (it == surface_id_to_resource_child_id_.end()) { | 131 if (it == surface_id_to_resource_child_id_.end()) { |
| 132 int child_id = | 132 int child_id = |
| 133 provider_->CreateChild(base::Bind(&UnrefHelper, surface->factory())); | 133 provider_->CreateChild(base::Bind(&UnrefHelper, surface->factory())); |
| 134 if (surface->factory()) { | 134 if (surface->factory()) { |
| 135 provider_->SetChildNeedsSyncPoints( | 135 provider_->SetChildNeedsSyncTokens( |
| 136 child_id, surface->factory()->needs_sync_points()); | 136 child_id, surface->factory()->needs_sync_points()); |
| 137 } | 137 } |
| 138 surface_id_to_resource_child_id_[surface->surface_id()] = child_id; | 138 surface_id_to_resource_child_id_[surface->surface_id()] = child_id; |
| 139 return child_id; | 139 return child_id; |
| 140 } else { | 140 } else { |
| 141 return it->second; | 141 return it->second; |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 gfx::Rect SurfaceAggregator::DamageRectForSurface( | 145 gfx::Rect SurfaceAggregator::DamageRectForSurface( |
| (...skipping 509 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 |