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

Side by Side Diff: cc/solid_color_draw_quad.h

Issue 11649005: cc: Support anti-aliasing for solid color layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: per edge anti-aliasing Created 8 years 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
« no previous file with comments | « cc/software_renderer_unittest.cc ('k') | cc/solid_color_draw_quad.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CC_SOLID_COLOR_DRAW_QUAD_H_ 5 #ifndef CC_SOLID_COLOR_DRAW_QUAD_H_
6 #define CC_SOLID_COLOR_DRAW_QUAD_H_ 6 #define CC_SOLID_COLOR_DRAW_QUAD_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/cc_export.h" 9 #include "cc/cc_export.h"
10 #include "cc/draw_quad.h" 10 #include "cc/draw_quad.h"
11 #include "third_party/skia/include/core/SkColor.h" 11 #include "third_party/skia/include/core/SkColor.h"
12 12
13 namespace cc { 13 namespace cc {
14 14
15 class CC_EXPORT SolidColorDrawQuad : public DrawQuad { 15 class CC_EXPORT SolidColorDrawQuad : public DrawQuad {
16 public: 16 public:
17 static scoped_ptr<SolidColorDrawQuad> Create(); 17 static scoped_ptr<SolidColorDrawQuad> Create();
18 18
19 void SetNew(const SharedQuadState* shared_quad_state, 19 void SetNew(const SharedQuadState* shared_quad_state,
20 gfx::Rect rect, 20 gfx::Rect rect,
21 SkColor color); 21 SkColor color,
22 bool left_edge_aa,
23 bool top_edge_aa,
24 bool right_edge_aa,
25 bool bottom_edge_aa);
22 26
23 void SetAll(const SharedQuadState* shared_quad_state, 27 void SetAll(const SharedQuadState* shared_quad_state,
24 gfx::Rect rect, 28 gfx::Rect rect,
25 gfx::Rect opaque_rect, 29 gfx::Rect opaque_rect,
26 gfx::Rect visible_rect, 30 gfx::Rect visible_rect,
27 bool needs_blending, 31 bool needs_blending,
28 SkColor color); 32 SkColor color,
33 bool left_edge_aa,
34 bool top_edge_aa,
35 bool right_edge_aa,
36 bool bottom_edge_aa);
29 37
30 SkColor color; 38 SkColor color;
31 39
40 // TODO(danakj): Stick the data used to compute these things in the quad
danakj 2012/12/21 20:50:18 Maybe we can address this TODO at the same time?
reveman 2012/12/21 20:58:05 hm, not sure I understand. isn't the shared state
danakj 2012/12/21 22:18:58 Ah, yes. I guess we need some piece of data on eac
reveman 2012/12/21 23:33:46 the only piece of data shared between tiles is: bo
41 // instead so the parent compositor can decide to use AA on its own.
42 bool left_edge_aa;
43 bool top_edge_aa;
44 bool right_edge_aa;
45 bool bottom_edge_aa;
46
47 bool IsAntialiased() const {
48 return left_edge_aa || top_edge_aa || right_edge_aa || bottom_edge_aa;
49 }
50
32 static const SolidColorDrawQuad* MaterialCast(const DrawQuad*); 51 static const SolidColorDrawQuad* MaterialCast(const DrawQuad*);
33 private: 52 private:
34 SolidColorDrawQuad(); 53 SolidColorDrawQuad();
35 }; 54 };
36 55
37 } 56 }
38 57
39 #endif // CC_SOLID_COLOR_DRAW_QUAD_H_ 58 #endif // CC_SOLID_COLOR_DRAW_QUAD_H_
OLDNEW
« no previous file with comments | « cc/software_renderer_unittest.cc ('k') | cc/solid_color_draw_quad.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698