OLD | NEW |
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_TILE_DRAW_QUAD_H_ | 5 #ifndef CC_TILE_DRAW_QUAD_H_ |
6 #define CC_TILE_DRAW_QUAD_H_ | 6 #define CC_TILE_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/khronos/GLES2/gl2.h" | 11 #include "third_party/khronos/GLES2/gl2.h" |
12 #include "ui/gfx/point.h" | 12 #include "ui/gfx/point.h" |
13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 class CC_EXPORT TileDrawQuad : public DrawQuad { | 17 class CC_EXPORT TileDrawQuad : public DrawQuad { |
18 public: | 18 public: |
19 static scoped_ptr<TileDrawQuad> Create(); | 19 static scoped_ptr<TileDrawQuad> Create(); |
20 | 20 |
21 void SetNew(const SharedQuadState* shared_quad_state, | 21 void SetNew(const SharedQuadState* shared_quad_state, |
22 gfx::Rect rect, | 22 gfx::Rect rect, |
23 gfx::Rect opaque_rect, | 23 gfx::Rect opaque_rect, |
| 24 AntiAliasing anti_aliasing, |
24 unsigned resource_id, | 25 unsigned resource_id, |
25 const gfx::RectF& tex_coord_rect, | 26 const gfx::RectF& tex_coord_rect, |
26 gfx::Size texture_size, | 27 gfx::Size texture_size, |
27 bool swizzle_contents, | 28 bool swizzle_contents); |
28 bool left_edge_aa, | |
29 bool top_edge_aa, | |
30 bool right_edge_aa, | |
31 bool bottom_edge_aa); | |
32 | 29 |
33 void SetAll(const SharedQuadState* shared_quad_state, | 30 void SetAll(const SharedQuadState* shared_quad_state, |
34 gfx::Rect rect, | 31 gfx::Rect rect, |
35 gfx::Rect opaque_rect, | 32 gfx::Rect opaque_rect, |
36 gfx::Rect visible_rect, | 33 gfx::Rect visible_rect, |
37 bool needs_blending, | 34 bool needs_blending, |
| 35 AntiAliasing anti_aliasing, |
38 unsigned resource_id, | 36 unsigned resource_id, |
39 const gfx::RectF& tex_coord_rect, | 37 const gfx::RectF& tex_coord_rect, |
40 gfx::Size texture_size, | 38 gfx::Size texture_size, |
41 bool swizzle_contents, | 39 bool swizzle_contents); |
42 bool left_edge_aa, | |
43 bool top_edge_aa, | |
44 bool right_edge_aa, | |
45 bool bottom_edge_aa); | |
46 | 40 |
47 unsigned resource_id; | 41 unsigned resource_id; |
48 gfx::RectF tex_coord_rect; | 42 gfx::RectF tex_coord_rect; |
49 gfx::Size texture_size; | 43 gfx::Size texture_size; |
50 bool swizzle_contents; | 44 bool swizzle_contents; |
51 | 45 |
52 // TODO(danakj): Stick the data used to compute these things in the quad | |
53 // instead so the parent compositor can decide to use AA on its own. | |
54 bool left_edge_aa; | |
55 bool top_edge_aa; | |
56 bool right_edge_aa; | |
57 bool bottom_edge_aa; | |
58 | |
59 bool IsAntialiased() const { | |
60 return left_edge_aa || top_edge_aa || right_edge_aa || bottom_edge_aa; | |
61 } | |
62 | |
63 static const TileDrawQuad* MaterialCast(const DrawQuad*); | 46 static const TileDrawQuad* MaterialCast(const DrawQuad*); |
64 private: | 47 private: |
65 TileDrawQuad(); | 48 TileDrawQuad(); |
66 }; | 49 }; |
67 | 50 |
68 } | 51 } |
69 | 52 |
70 #endif // CC_TILE_DRAW_QUAD_H_ | 53 #endif // CC_TILE_DRAW_QUAD_H_ |
OLD | NEW |