summaryrefslogtreecommitdiffstats
path: root/cc/texture_draw_quad.cc
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-01 03:56:58 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-01 03:56:58 +0000
commit3c0a63c22fac0ae07d5682826b6b4af9d8473eb1 (patch)
tree3f424fe04f0374d9f700c56634915c03a5b34506 /cc/texture_draw_quad.cc
parentb6d0cd9a7c38055a9e719e7ac3d90fc1aaa3cddb (diff)
downloadchromium_src-3c0a63c22fac0ae07d5682826b6b4af9d8473eb1.zip
chromium_src-3c0a63c22fac0ae07d5682826b6b4af9d8473eb1.tar.gz
chromium_src-3c0a63c22fac0ae07d5682826b6b4af9d8473eb1.tar.bz2
cc: Make a general iterator for DrawQuad resources.
The DrawQuad::AppendResources function needs to iterate over all resources in the quads and do something with them. A similar pattern will be needed for the delegated renderer layer to iterate over all resources and remap them into the parent comspositor's namespace. This CL renames AppendResources into IterateResources which calls a callback method for each resource, and allows that method to change the id of the given resource. Tests: DrawQuadIteratorTest.CheckerboardDrawQuad DrawQuadIteratorTest.DebugBorderDrawQuad DrawQuadIteratorTest.IOSurfaceDrawQuad DrawQuadIteratorTest.RenderPassDrawQuad DrawQuadIteratorTest.SolidColorDrawQuad DrawQuadIteratorTest.StreamVideoDrawQuad DrawQuadIteratorTest.TextureDrawQuad DrawQuadIteratorTest.TileDrawQuad DrawQuadIteratorTest.YUVVideoDrawQuad R=piman BUG=123444 Review URL: https://chromiumcodereview.appspot.com/12381027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/texture_draw_quad.cc')
-rw-r--r--cc/texture_draw_quad.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/cc/texture_draw_quad.cc b/cc/texture_draw_quad.cc
index 2f48686..03f89e2 100644
--- a/cc/texture_draw_quad.cc
+++ b/cc/texture_draw_quad.cc
@@ -65,9 +65,9 @@ void TextureDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
this->flipped = flipped;
}
-void TextureDrawQuad::AppendResources(
- ResourceProvider::ResourceIdArray* resources) {
- resources->push_back(resource_id);
+void TextureDrawQuad::IterateResources(
+ const ResourceIteratorCallback& callback) {
+ resource_id = callback.Run(resource_id);
}
const TextureDrawQuad* TextureDrawQuad::MaterialCast(const DrawQuad* quad) {