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

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: review nits 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"
11 #include "cc/resources/returned_resource.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 namespace cc { 14 namespace cc {
14 15
15 FakeOutputSurface::FakeOutputSurface( 16 FakeOutputSurface::FakeOutputSurface(
16 scoped_refptr<ContextProvider> context_provider, 17 scoped_refptr<ContextProvider> context_provider,
17 bool delegated_rendering) 18 bool delegated_rendering)
18 : OutputSurface(context_provider), 19 : OutputSurface(context_provider),
19 client_(NULL), 20 client_(NULL),
20 num_sent_frames_(0), 21 num_sent_frames_(0),
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 120
120 void FakeOutputSurface::ReturnResource(unsigned id, CompositorFrameAck* ack) { 121 void FakeOutputSurface::ReturnResource(unsigned id, CompositorFrameAck* ack) {
121 TransferableResourceArray::iterator it; 122 TransferableResourceArray::iterator it;
122 for (it = resources_held_by_parent_.begin(); 123 for (it = resources_held_by_parent_.begin();
123 it != resources_held_by_parent_.end(); 124 it != resources_held_by_parent_.end();
124 ++it) { 125 ++it) {
125 if (it->id == id) 126 if (it->id == id)
126 break; 127 break;
127 } 128 }
128 DCHECK(it != resources_held_by_parent_.end()); 129 DCHECK(it != resources_held_by_parent_.end());
129 ack->resources.push_back(*it); 130 ack->resources.push_back(it->ToReturnedResource());
130 resources_held_by_parent_.erase(it); 131 resources_held_by_parent_.erase(it);
131 } 132 }
132 133
133 } // namespace cc 134 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_delegated_renderer_layer_impl.cc ('k') | cc/trees/layer_tree_host_unittest_delegated.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698