Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: cc/surfaces/surface_aggregator.cc

Issue 1989453003: cc: Add ScopedReadLockGpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix aura typo Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/surfaces/surface.cc ('k') | cc/surfaces/surface_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 allocator.reset(new RenderPassIdAllocator(&next_render_pass_id_)); 129 allocator.reset(new RenderPassIdAllocator(&next_render_pass_id_));
130 allocator->AddKnownPass(surface_local_pass_id); 130 allocator->AddKnownPass(surface_local_pass_id);
131 return allocator->Remap(surface_local_pass_id); 131 return allocator->Remap(surface_local_pass_id);
132 } 132 }
133 133
134 int SurfaceAggregator::ChildIdForSurface(Surface* surface) { 134 int SurfaceAggregator::ChildIdForSurface(Surface* surface) {
135 SurfaceToResourceChildIdMap::iterator it = 135 SurfaceToResourceChildIdMap::iterator it =
136 surface_id_to_resource_child_id_.find(surface->surface_id()); 136 surface_id_to_resource_child_id_.find(surface->surface_id());
137 if (it == surface_id_to_resource_child_id_.end()) { 137 if (it == surface_id_to_resource_child_id_.end()) {
138 int child_id = 138 int child_id =
139 provider_->CreateChild(base::Bind(&UnrefHelper, surface->factory())); 139 provider_->CreateChild(base::Bind(&UnrefHelper, surface->factory()),
140 surface->gpu_memory_buffer_client_id());
140 if (surface->factory()) { 141 if (surface->factory()) {
141 provider_->SetChildNeedsSyncTokens( 142 provider_->SetChildNeedsSyncTokens(
142 child_id, surface->factory()->needs_sync_points()); 143 child_id, surface->factory()->needs_sync_points());
143 } 144 }
144 surface_id_to_resource_child_id_[surface->surface_id()] = child_id; 145 surface_id_to_resource_child_id_[surface->surface_id()] = child_id;
145 return child_id; 146 return child_id;
146 } else { 147 } else {
147 return it->second; 148 return it->second;
148 } 149 }
149 } 150 }
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 823
823 void SurfaceAggregator::SetFullDamageForSurface(SurfaceId surface_id) { 824 void SurfaceAggregator::SetFullDamageForSurface(SurfaceId surface_id) {
824 auto it = previous_contained_surfaces_.find(surface_id); 825 auto it = previous_contained_surfaces_.find(surface_id);
825 if (it == previous_contained_surfaces_.end()) 826 if (it == previous_contained_surfaces_.end())
826 return; 827 return;
827 // Set the last drawn index as 0 to ensure full damage next time it's drawn. 828 // Set the last drawn index as 0 to ensure full damage next time it's drawn.
828 it->second = 0; 829 it->second = 0;
829 } 830 }
830 831
831 } // namespace cc 832 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface.cc ('k') | cc/surfaces/surface_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698