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

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 670183003: Update from chromium 62675d9fb31fb8cedc40f68e78e8445a74f362e7 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/surface_aggregator.h ('k') | cc/surfaces/surface_aggregator_test_helpers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_aggregator.cc
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index f6bf6d6d634ff324f7f220c58f642a349531d241..e3574e552e55154d35be3db1eb365101b5b8c080 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -40,7 +40,7 @@ void MoveMatchingRequests(
SurfaceAggregator::SurfaceAggregator(SurfaceManager* manager,
ResourceProvider* provider)
- : manager_(manager), provider_(provider) {
+ : manager_(manager), provider_(provider), next_render_pass_id_(1) {
DCHECK(manager_);
}
@@ -48,25 +48,23 @@ SurfaceAggregator::~SurfaceAggregator() {}
class SurfaceAggregator::RenderPassIdAllocator {
public:
- explicit RenderPassIdAllocator(SurfaceId surface_id)
- : surface_id_(surface_id), next_index_(1) {}
+ explicit RenderPassIdAllocator(int* next_index) : next_index_(next_index) {}
~RenderPassIdAllocator() {}
void AddKnownPass(RenderPassId id) {
if (id_to_index_map_.find(id) != id_to_index_map_.end())
return;
- id_to_index_map_[id] = next_index_++;
+ id_to_index_map_[id] = (*next_index_)++;
}
RenderPassId Remap(RenderPassId id) {
DCHECK(id_to_index_map_.find(id) != id_to_index_map_.end());
- return RenderPassId(surface_id_.id, id_to_index_map_[id]);
+ return RenderPassId(1, id_to_index_map_[id]);
}
private:
base::hash_map<RenderPassId, int> id_to_index_map_;
- SurfaceId surface_id_;
- int next_index_;
+ int* next_index_;
DISALLOW_COPY_AND_ASSIGN(RenderPassIdAllocator);
};
@@ -82,7 +80,7 @@ RenderPassId SurfaceAggregator::RemapPassId(RenderPassId surface_local_pass_id,
SurfaceId surface_id) {
RenderPassIdAllocator* allocator = render_pass_allocator_map_.get(surface_id);
if (!allocator) {
- allocator = new RenderPassIdAllocator(surface_id);
+ allocator = new RenderPassIdAllocator(&next_render_pass_id_);
render_pass_allocator_map_.set(surface_id, make_scoped_ptr(allocator));
}
allocator->AddKnownPass(surface_local_pass_id);
« no previous file with comments | « cc/surfaces/surface_aggregator.h ('k') | cc/surfaces/surface_aggregator_test_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698