| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 allocator.reset(new RenderPassIdAllocator(&next_render_pass_id_)); | 131 allocator.reset(new RenderPassIdAllocator(&next_render_pass_id_)); |
| 132 allocator->AddKnownPass(surface_local_pass_id); | 132 allocator->AddKnownPass(surface_local_pass_id); |
| 133 return allocator->Remap(surface_local_pass_id); | 133 return allocator->Remap(surface_local_pass_id); |
| 134 } | 134 } |
| 135 | 135 |
| 136 int SurfaceAggregator::ChildIdForSurface(Surface* surface) { | 136 int SurfaceAggregator::ChildIdForSurface(Surface* surface) { |
| 137 SurfaceToResourceChildIdMap::iterator it = | 137 SurfaceToResourceChildIdMap::iterator it = |
| 138 surface_id_to_resource_child_id_.find(surface->surface_id()); | 138 surface_id_to_resource_child_id_.find(surface->surface_id()); |
| 139 if (it == surface_id_to_resource_child_id_.end()) { | 139 if (it == surface_id_to_resource_child_id_.end()) { |
| 140 int child_id = | 140 int child_id = |
| 141 provider_->CreateChild(base::Bind(&UnrefHelper, surface->factory()), | 141 provider_->CreateChild(base::Bind(&UnrefHelper, surface->factory())); |
| 142 surface->gpu_memory_buffer_client_id()); | |
| 143 if (surface->factory()) { | 142 if (surface->factory()) { |
| 144 provider_->SetChildNeedsSyncTokens( | 143 provider_->SetChildNeedsSyncTokens( |
| 145 child_id, surface->factory()->needs_sync_points()); | 144 child_id, surface->factory()->needs_sync_points()); |
| 146 } | 145 } |
| 147 surface_id_to_resource_child_id_[surface->surface_id()] = child_id; | 146 surface_id_to_resource_child_id_[surface->surface_id()] = child_id; |
| 148 return child_id; | 147 return child_id; |
| 149 } else { | 148 } else { |
| 150 return it->second; | 149 return it->second; |
| 151 } | 150 } |
| 152 } | 151 } |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 | 831 |
| 833 void SurfaceAggregator::SetFullDamageForSurface(SurfaceId surface_id) { | 832 void SurfaceAggregator::SetFullDamageForSurface(SurfaceId surface_id) { |
| 834 auto it = previous_contained_surfaces_.find(surface_id); | 833 auto it = previous_contained_surfaces_.find(surface_id); |
| 835 if (it == previous_contained_surfaces_.end()) | 834 if (it == previous_contained_surfaces_.end()) |
| 836 return; | 835 return; |
| 837 // Set the last drawn index as 0 to ensure full damage next time it's drawn. | 836 // Set the last drawn index as 0 to ensure full damage next time it's drawn. |
| 838 it->second = 0; | 837 it->second = 0; |
| 839 } | 838 } |
| 840 | 839 |
| 841 } // namespace cc | 840 } // namespace cc |
| OLD | NEW |