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

Unified Diff: cc/stream_video_draw_quad.cc

Issue 11411050: cc: Make the DrawQuad subclasses into struct-like classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 1 month 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/stream_video_draw_quad.h ('k') | cc/test/render_pass_test_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/stream_video_draw_quad.cc
diff --git a/cc/stream_video_draw_quad.cc b/cc/stream_video_draw_quad.cc
index 24ef43015f66f976c319be27847531a6e1a34625..0286a19cb04b68f8189b1794c0aa758b509d4c7e 100644
--- a/cc/stream_video_draw_quad.cc
+++ b/cc/stream_video_draw_quad.cc
@@ -8,24 +8,42 @@
namespace cc {
-scoped_ptr<StreamVideoDrawQuad> StreamVideoDrawQuad::create(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned textureId, const WebKit::WebTransformationMatrix& matrix)
-{
- return make_scoped_ptr(new StreamVideoDrawQuad(sharedQuadState, quadRect, opaqueRect, textureId, matrix));
+StreamVideoDrawQuad::StreamVideoDrawQuad() : texture_id(0) {}
+
+scoped_ptr<StreamVideoDrawQuad> StreamVideoDrawQuad::Create() {
+ return make_scoped_ptr(new StreamVideoDrawQuad);
+}
+
+void StreamVideoDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
+ gfx::Rect rect,
+ gfx::Rect opaque_rect,
+ unsigned texture_id,
+ const WebKit::WebTransformationMatrix& matrix) {
+ gfx::Rect visible_rect = rect;
+ bool needs_blending = false;
+ DrawQuad::SetAll(shared_quad_state, DrawQuad::STREAM_VIDEO_CONTENT, rect,
+ opaque_rect, visible_rect, needs_blending);
+ this->texture_id = texture_id;
+ this->matrix = matrix;
}
-StreamVideoDrawQuad::StreamVideoDrawQuad(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned textureId, const WebKit::WebTransformationMatrix& matrix)
- : m_textureId(textureId)
- , m_matrix(matrix)
-{
- gfx::Rect visibleRect = quadRect;
- bool needsBlending = false;
- DrawQuad::SetAll(sharedQuadState, DrawQuad::STREAM_VIDEO_CONTENT, quadRect, opaqueRect, visibleRect, needsBlending);
+void StreamVideoDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
+ gfx::Rect rect,
+ gfx::Rect opaque_rect,
+ gfx::Rect visible_rect,
+ bool needs_blending,
+ unsigned texture_id,
+ const WebKit::WebTransformationMatrix& matrix) {
+ DrawQuad::SetAll(shared_quad_state, DrawQuad::STREAM_VIDEO_CONTENT, rect,
+ opaque_rect, visible_rect, needs_blending);
+ this->texture_id = texture_id;
+ this->matrix = matrix;
}
-const StreamVideoDrawQuad* StreamVideoDrawQuad::materialCast(const DrawQuad* quad)
-{
- DCHECK(quad->material == DrawQuad::STREAM_VIDEO_CONTENT);
- return static_cast<const StreamVideoDrawQuad*>(quad);
+const StreamVideoDrawQuad* StreamVideoDrawQuad::MaterialCast(
+ const DrawQuad* quad) {
+ DCHECK(quad->material == DrawQuad::STREAM_VIDEO_CONTENT);
+ return static_cast<const StreamVideoDrawQuad*>(quad);
}
} // namespace cc
« no previous file with comments | « cc/stream_video_draw_quad.h ('k') | cc/test/render_pass_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698