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

Unified Diff: cc/draw_quad.cc

Issue 11418047: cc: Turn DrawQuad into a struct-like class with public data members. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no virtual for SetAll() 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/draw_quad.h ('k') | cc/draw_quad_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/draw_quad.cc
diff --git a/cc/draw_quad.cc b/cc/draw_quad.cc
index 495cfb730b6df9cb12640fa5606adbfd1a5f10ea..c05274850b85029839f1d89181f4b271ab43a913 100644
--- a/cc/draw_quad.cc
+++ b/cc/draw_quad.cc
@@ -25,18 +25,27 @@ template<typename T> T* TypedCopy(const cc::DrawQuad* other) {
namespace cc {
-DrawQuad::DrawQuad(const SharedQuadState* shared_quad_state,
- Material material,
- gfx::Rect rect,
- gfx::Rect opaque_rect)
- : shared_quad_state_(shared_quad_state),
- material_(material),
- rect_(rect),
- visible_rect_(rect),
- needs_blending_(false),
- opaque_rect_(opaque_rect) {
- DCHECK(shared_quad_state_);
- DCHECK(material_ != INVALID);
+DrawQuad::DrawQuad()
+ : shared_quad_state(),
+ material(INVALID),
+ needs_blending(false) {
+}
+
+void DrawQuad::SetAll(const SharedQuadState* shared_quad_state,
+ Material material,
+ gfx::Rect rect,
+ gfx::Rect opaque_rect,
+ gfx::Rect visible_rect,
+ bool needs_blending) {
+ this->material = material;
+ this->rect = rect;
+ this->opaque_rect = opaque_rect;
+ this->visible_rect = visible_rect;
+ this->needs_blending = needs_blending;
+ this->shared_quad_state = shared_quad_state;
+
+ DCHECK(shared_quad_state);
+ DCHECK(material != INVALID);
}
DrawQuad::~DrawQuad() {
@@ -46,7 +55,7 @@ scoped_ptr<DrawQuad> DrawQuad::Copy(
const SharedQuadState* copied_shared_quad_state) const
{
scoped_ptr<DrawQuad> copy_quad;
- switch (material()) {
+ switch (material) {
case CHECKERBOARD:
copy_quad.reset(TypedCopy<CheckerboardDrawQuad>(this));
break;
@@ -73,10 +82,10 @@ scoped_ptr<DrawQuad> DrawQuad::Copy(
break;
case RENDER_PASS: // RenderPass quads have their own copy() method.
case INVALID:
- LOG(FATAL) << "Invalid DrawQuad material " << material();
+ LOG(FATAL) << "Invalid DrawQuad material " << material;
break;
}
- copy_quad->set_shared_quad_state(copied_shared_quad_state);
+ copy_quad->shared_quad_state = copied_shared_quad_state;
return copy_quad.Pass();
}
« no previous file with comments | « cc/draw_quad.h ('k') | cc/draw_quad_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698