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

Side by Side Diff: cc/test/fake_output_surface.cc

Issue 23097005: cc: return resources via a ReturnedResource struct rather than TransferableResource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: post-rebase fixes Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/test/fake_output_surface.h" 5 #include "cc/test/fake_output_surface.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "cc/output/compositor_frame_ack.h" 9 #include "cc/output/compositor_frame_ack.h"
10 #include "cc/output/output_surface_client.h" 10 #include "cc/output/output_surface_client.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 void FakeOutputSurface::ReturnResource(unsigned id, CompositorFrameAck* ack) { 127 void FakeOutputSurface::ReturnResource(unsigned id, CompositorFrameAck* ack) {
128 TransferableResourceArray::iterator it; 128 TransferableResourceArray::iterator it;
129 for (it = resources_held_by_parent_.begin(); 129 for (it = resources_held_by_parent_.begin();
130 it != resources_held_by_parent_.end(); 130 it != resources_held_by_parent_.end();
131 ++it) { 131 ++it) {
132 if (it->id == id) 132 if (it->id == id)
133 break; 133 break;
134 } 134 }
135 DCHECK(it != resources_held_by_parent_.end()); 135 DCHECK(it != resources_held_by_parent_.end());
136 ack->resources.push_back(*it); 136 ack->resources.push_back(it->Return());
137 resources_held_by_parent_.erase(it); 137 resources_held_by_parent_.erase(it);
138 } 138 }
139 139
140 } // namespace cc 140 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698