summaryrefslogtreecommitdiffstats
path: root/cc/quads/stream_video_draw_quad.h
diff options
context:
space:
mode:
authorvmpstr <vmpstr@chromium.org>2015-06-02 15:14:46 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-02 22:15:17 +0000
commit0eca2e87110112c678c5f4c89b7f99e2de6026bb (patch)
tree6a3e39b085e5d8851c42ccf0b8a0f3e0a92775f6 /cc/quads/stream_video_draw_quad.h
parent6c8207fe7d79a2150ce7c4007678d10c23475630 (diff)
downloadchromium_src-0eca2e87110112c678c5f4c89b7f99e2de6026bb.zip
chromium_src-0eca2e87110112c678c5f4c89b7f99e2de6026bb.tar.gz
chromium_src-0eca2e87110112c678c5f4c89b7f99e2de6026bb.tar.bz2
cc: Remove DrawQuad::IterateResoruces
This patch removes IterateResources function in favor of iterating resources directly on the quad. In order to accomplish this, each derived quad uses new resources object on the base class to store all of the resources it needs. This allows the calling code that used to call IterateResources with a callback to instead directly iterate all of the ids and manipulate them in any way that is required. This improves the performance of the IterateResources test by ~30%. BUG=492765 R=danakj, piman@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1152473006 Cr-Commit-Position: refs/heads/master@{#332476}
Diffstat (limited to 'cc/quads/stream_video_draw_quad.h')
-rw-r--r--cc/quads/stream_video_draw_quad.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/cc/quads/stream_video_draw_quad.h b/cc/quads/stream_video_draw_quad.h
index 45c28f2..faffd20 100644
--- a/cc/quads/stream_video_draw_quad.h
+++ b/cc/quads/stream_video_draw_quad.h
@@ -31,14 +31,15 @@ class CC_EXPORT StreamVideoDrawQuad : public DrawQuad {
unsigned resource_id,
const gfx::Transform& matrix);
- unsigned resource_id;
gfx::Transform matrix;
- void IterateResources(const ResourceIteratorCallback& callback) override;
-
static const StreamVideoDrawQuad* MaterialCast(const DrawQuad*);
+ ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; }
+
private:
+ static const size_t kResourceIdIndex = 0;
+
void ExtendValue(base::trace_event::TracedValue* value) const override;
};