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

Unified Diff: cc/solid_color_draw_quad.cc

Issue 11649005: cc: Support anti-aliasing for solid color layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and add DrawQuad::AntiAliasing struct. Created 7 years, 11 months 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
Index: cc/solid_color_draw_quad.cc
diff --git a/cc/solid_color_draw_quad.cc b/cc/solid_color_draw_quad.cc
index 54a9b75166f1587067c34f79dfe44edee047901a..b4cf9ec3fcdd694f5a608687d228d3c0aa2e73ac 100644
--- a/cc/solid_color_draw_quad.cc
+++ b/cc/solid_color_draw_quad.cc
@@ -8,7 +8,8 @@
namespace cc {
-SolidColorDrawQuad::SolidColorDrawQuad() : color(0) {}
+SolidColorDrawQuad::SolidColorDrawQuad() : color(0) {
+}
scoped_ptr<SolidColorDrawQuad> SolidColorDrawQuad::Create() {
return make_scoped_ptr(new SolidColorDrawQuad);
@@ -16,13 +17,17 @@ scoped_ptr<SolidColorDrawQuad> SolidColorDrawQuad::Create() {
void SolidColorDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
gfx::Rect rect,
+ AntiAliasing anti_aliasing,
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);
+ visible_rect, needs_blending, anti_aliasing);
this->color = color;
+
+ // Override needs_blending after initializing the quad.
+ this->needs_blending = IsAntialiased();
}
void SolidColorDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
@@ -30,9 +35,10 @@ void SolidColorDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
gfx::Rect opaque_rect,
gfx::Rect visible_rect,
bool needs_blending,
+ AntiAliasing anti_aliasing,
SkColor color) {
DrawQuad::SetAll(shared_quad_state, DrawQuad::SOLID_COLOR, rect, opaque_rect,
- visible_rect, needs_blending);
+ visible_rect, needs_blending, anti_aliasing);
this->color = color;
}

Powered by Google App Engine
This is Rietveld 408576698