| Index: cc/solid_color_draw_quad.cc
|
| diff --git a/cc/solid_color_draw_quad.cc b/cc/solid_color_draw_quad.cc
|
| index d6daad2dcabe750b74901882d10f9cda65658176..54a9b75166f1587067c34f79dfe44edee047901a 100644
|
| --- a/cc/solid_color_draw_quad.cc
|
| +++ b/cc/solid_color_draw_quad.cc
|
| @@ -8,24 +8,38 @@
|
|
|
| namespace cc {
|
|
|
| -scoped_ptr<SolidColorDrawQuad> SolidColorDrawQuad::create(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, SkColor color)
|
| -{
|
| - return make_scoped_ptr(new SolidColorDrawQuad(sharedQuadState, quadRect, color));
|
| +SolidColorDrawQuad::SolidColorDrawQuad() : color(0) {}
|
| +
|
| +scoped_ptr<SolidColorDrawQuad> SolidColorDrawQuad::Create() {
|
| + return make_scoped_ptr(new SolidColorDrawQuad);
|
| +}
|
| +
|
| +void SolidColorDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
|
| + gfx::Rect rect,
|
| + SkColor color) {
|
| + gfx::Rect opaque_rect = SkColorGetA(color) == 255 ? rect : gfx::Rect();
|
| + gfx::Rect visible_rect = rect;
|
| + bool needs_blending = false;
|
| + DrawQuad::SetAll(shared_quad_state, DrawQuad::SOLID_COLOR, rect, opaque_rect,
|
| + visible_rect, needs_blending);
|
| + this->color = color;
|
| }
|
|
|
| -SolidColorDrawQuad::SolidColorDrawQuad(const SharedQuadState* sharedQuadState, const gfx::Rect& quadRect, SkColor color)
|
| - : m_color(color)
|
| -{
|
| - gfx::Rect opaqueRect = SkColorGetA(m_color) == 255 ? quadRect : gfx::Rect();
|
| - gfx::Rect visibleRect = quadRect;
|
| - bool needsBlending = false;
|
| - DrawQuad::SetAll(sharedQuadState, DrawQuad::SOLID_COLOR, quadRect, opaqueRect, visibleRect, needsBlending);
|
| +void SolidColorDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
|
| + gfx::Rect rect,
|
| + gfx::Rect opaque_rect,
|
| + gfx::Rect visible_rect,
|
| + bool needs_blending,
|
| + SkColor color) {
|
| + DrawQuad::SetAll(shared_quad_state, DrawQuad::SOLID_COLOR, rect, opaque_rect,
|
| + visible_rect, needs_blending);
|
| + this->color = color;
|
| }
|
|
|
| -const SolidColorDrawQuad* SolidColorDrawQuad::materialCast(const DrawQuad* quad)
|
| -{
|
| - DCHECK(quad->material == DrawQuad::SOLID_COLOR);
|
| - return static_cast<const SolidColorDrawQuad*>(quad);
|
| +const SolidColorDrawQuad* SolidColorDrawQuad::MaterialCast(
|
| + const DrawQuad* quad) {
|
| + DCHECK(quad->material == DrawQuad::SOLID_COLOR);
|
| + return static_cast<const SolidColorDrawQuad*>(quad);
|
| }
|
|
|
| } // namespacec cc
|
|
|