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

Unified Diff: cc/debug_border_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/debug_border_draw_quad.h ('k') | cc/delegated_renderer_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug_border_draw_quad.cc
diff --git a/cc/debug_border_draw_quad.cc b/cc/debug_border_draw_quad.cc
index 800912844f0973013b0fdf39d4dc3be2cbefb77e..fba8b929d1d79f6863b931c1eaedee026c0afbd2 100644
--- a/cc/debug_border_draw_quad.cc
+++ b/cc/debug_border_draw_quad.cc
@@ -8,25 +8,45 @@
namespace cc {
-scoped_ptr<DebugBorderDrawQuad> DebugBorderDrawQuad::create(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, SkColor color, int width)
-{
- return make_scoped_ptr(new DebugBorderDrawQuad(sharedQuadState, quadRect, color, width));
+DebugBorderDrawQuad::DebugBorderDrawQuad()
+ : color(0),
+ width(0) {
}
-DebugBorderDrawQuad::DebugBorderDrawQuad(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, SkColor color, int width)
- : m_color(color)
- , m_width(width)
-{
- gfx::Rect opaqueRect;
- gfx::Rect visibleRect = quadRect;
- bool needsBlending = SkColorGetA(m_color) < 255;
- DrawQuad::SetAll(sharedQuadState, DrawQuad::DEBUG_BORDER, quadRect, opaqueRect, visibleRect, needsBlending);
+scoped_ptr<DebugBorderDrawQuad> DebugBorderDrawQuad::Create() {
+ return make_scoped_ptr(new DebugBorderDrawQuad);
}
-const DebugBorderDrawQuad* DebugBorderDrawQuad::materialCast(const DrawQuad* quad)
-{
- DCHECK(quad->material == DrawQuad::DEBUG_BORDER);
- return static_cast<const DebugBorderDrawQuad*>(quad);
+void DebugBorderDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
+ gfx::Rect rect,
+ SkColor color,
+ int width) {
+ gfx::Rect opaque_rect;
+ gfx::Rect visible_rect = rect;
+ bool needs_blending = SkColorGetA(color) < 255;
+ DrawQuad::SetAll(shared_quad_state, DrawQuad::DEBUG_BORDER, rect, opaque_rect,
+ visible_rect, needs_blending);
+ this->color = color;
+ this->width = width;
+}
+
+void DebugBorderDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
+ gfx::Rect rect,
+ gfx::Rect opaque_rect,
+ gfx::Rect visible_rect,
+ bool needs_blending,
+ SkColor color,
+ int width) {
+ DrawQuad::SetAll(shared_quad_state, DrawQuad::DEBUG_BORDER, rect, opaque_rect,
+ visible_rect, needs_blending);
+ this->color = color;
+ this->width = width;
+}
+
+const DebugBorderDrawQuad* DebugBorderDrawQuad::MaterialCast(
+ const DrawQuad* quad) {
+ DCHECK(quad->material == DrawQuad::DEBUG_BORDER);
+ return static_cast<const DebugBorderDrawQuad*>(quad);
}
} // namespace cc
« no previous file with comments | « cc/debug_border_draw_quad.h ('k') | cc/delegated_renderer_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698