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

Side by Side Diff: cc/debug_border_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/debug_border_draw_quad.h" 5 #include "cc/debug_border_draw_quad.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 DebugBorderDrawQuad::DebugBorderDrawQuad() 11 DebugBorderDrawQuad::DebugBorderDrawQuad()
12 : color(0), 12 : color(0),
13 width(0) { 13 width(0) {
14 } 14 }
15 15
16 scoped_ptr<DebugBorderDrawQuad> DebugBorderDrawQuad::Create() { 16 scoped_ptr<DebugBorderDrawQuad> DebugBorderDrawQuad::Create() {
17 return make_scoped_ptr(new DebugBorderDrawQuad); 17 return make_scoped_ptr(new DebugBorderDrawQuad);
18 } 18 }
19 19
20 void DebugBorderDrawQuad::SetNew(const SharedQuadState* shared_quad_state, 20 void DebugBorderDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
21 gfx::Rect rect, 21 gfx::Rect rect,
22 SkColor color, 22 SkColor color,
23 int width) { 23 int width) {
24 gfx::Rect opaque_rect; 24 gfx::Rect opaque_rect;
25 gfx::Rect visible_rect = rect; 25 gfx::Rect visible_rect = rect;
26 bool needs_blending = SkColorGetA(color) < 255; 26 bool needs_blending = SkColorGetA(color) < 255;
27 DrawQuad::SetAll(shared_quad_state, DrawQuad::DEBUG_BORDER, rect, opaque_rect, 27 DrawQuad::SetAll(shared_quad_state, DrawQuad::DEBUG_BORDER, rect, opaque_rect,
28 visible_rect, needs_blending); 28 visible_rect, needs_blending, AntiAliasing());
29 this->color = color; 29 this->color = color;
30 this->width = width; 30 this->width = width;
31 } 31 }
32 32
33 void DebugBorderDrawQuad::SetAll(const SharedQuadState* shared_quad_state, 33 void DebugBorderDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
34 gfx::Rect rect, 34 gfx::Rect rect,
35 gfx::Rect opaque_rect, 35 gfx::Rect opaque_rect,
36 gfx::Rect visible_rect, 36 gfx::Rect visible_rect,
37 bool needs_blending, 37 bool needs_blending,
38 SkColor color, 38 SkColor color,
39 int width) { 39 int width) {
40 DrawQuad::SetAll(shared_quad_state, DrawQuad::DEBUG_BORDER, rect, opaque_rect, 40 DrawQuad::SetAll(shared_quad_state, DrawQuad::DEBUG_BORDER, rect, opaque_rect,
41 visible_rect, needs_blending); 41 visible_rect, needs_blending, AntiAliasing());
42 this->color = color; 42 this->color = color;
43 this->width = width; 43 this->width = width;
44 } 44 }
45 45
46 const DebugBorderDrawQuad* DebugBorderDrawQuad::MaterialCast( 46 const DebugBorderDrawQuad* DebugBorderDrawQuad::MaterialCast(
47 const DrawQuad* quad) { 47 const DrawQuad* quad) {
48 DCHECK(quad->material == DrawQuad::DEBUG_BORDER); 48 DCHECK(quad->material == DrawQuad::DEBUG_BORDER);
49 return static_cast<const DebugBorderDrawQuad*>(quad); 49 return static_cast<const DebugBorderDrawQuad*>(quad);
50 } 50 }
51 51
52 } // namespace cc 52 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698