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 #pragma pack(push, 4) | 17 #pragma pack(push, 4) |
18 | 18 |
19 class CC_EXPORT TileDrawQuad : public DrawQuad { | 19 class CC_EXPORT TileDrawQuad : public DrawQuad { |
20 public: | 20 public: |
21 static scoped_ptr<TileDrawQuad> create(const SharedQuadState*, const gfx::Re
ct& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vecto
r2d& textureOffset, const gfx::Size& textureSize, GLint textureFilter, bool swiz
zleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeA
A); | 21 static scoped_ptr<TileDrawQuad> create(const SharedQuadState*, const gfx::Re
ct& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Vecto
r2d& textureOffset, const gfx::Size& textureSize, bool swizzleContents, bool lef
tEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA); |
22 | 22 |
23 unsigned resourceId() const { return m_resourceId; } | 23 unsigned resourceId() const { return m_resourceId; } |
24 gfx::Vector2d textureOffset() const { return m_textureOffset; } | 24 gfx::Vector2d textureOffset() const { return m_textureOffset; } |
25 gfx::Size textureSize() const { return m_textureSize; } | 25 gfx::Size textureSize() const { return m_textureSize; } |
26 GLint textureFilter() const { return m_textureFilter; } | |
27 bool swizzleContents() const { return m_swizzleContents; } | 26 bool swizzleContents() const { return m_swizzleContents; } |
28 | 27 |
29 bool leftEdgeAA() const { return m_leftEdgeAA; } | 28 bool leftEdgeAA() const { return m_leftEdgeAA; } |
30 bool topEdgeAA() const { return m_topEdgeAA; } | 29 bool topEdgeAA() const { return m_topEdgeAA; } |
31 bool rightEdgeAA() const { return m_rightEdgeAA; } | 30 bool rightEdgeAA() const { return m_rightEdgeAA; } |
32 bool bottomEdgeAA() const { return m_bottomEdgeAA; } | 31 bool bottomEdgeAA() const { return m_bottomEdgeAA; } |
33 | 32 |
34 bool isAntialiased() const { return leftEdgeAA() || topEdgeAA() || rightEdge
AA() || bottomEdgeAA(); } | 33 bool isAntialiased() const { return leftEdgeAA() || topEdgeAA() || rightEdge
AA() || bottomEdgeAA(); } |
35 | 34 |
36 static const TileDrawQuad* materialCast(const DrawQuad*); | 35 static const TileDrawQuad* materialCast(const DrawQuad*); |
37 private: | 36 private: |
38 TileDrawQuad(const SharedQuadState*, const gfx::Rect& quadRect, const gfx::R
ect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const
gfx::Size& textureSize, GLint textureFilter, bool swizzleContents, bool leftEdge
AA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA); | 37 TileDrawQuad(const SharedQuadState*, const gfx::Rect& quadRect, const gfx::R
ect& opaqueRect, unsigned resourceId, const gfx::Vector2d& textureOffset, const
gfx::Size& textureSize, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, b
ool rightEdgeAA, bool bottomEdgeAA); |
39 | 38 |
40 unsigned m_resourceId; | 39 unsigned m_resourceId; |
41 gfx::Vector2d m_textureOffset; | 40 gfx::Vector2d m_textureOffset; |
42 gfx::Size m_textureSize; | 41 gfx::Size m_textureSize; |
43 GLint m_textureFilter; | |
44 bool m_swizzleContents; | 42 bool m_swizzleContents; |
45 bool m_leftEdgeAA; | 43 bool m_leftEdgeAA; |
46 bool m_topEdgeAA; | 44 bool m_topEdgeAA; |
47 bool m_rightEdgeAA; | 45 bool m_rightEdgeAA; |
48 bool m_bottomEdgeAA; | 46 bool m_bottomEdgeAA; |
49 }; | 47 }; |
50 | 48 |
51 #pragma pack(pop) | 49 #pragma pack(pop) |
52 | 50 |
53 } | 51 } |
54 | 52 |
55 #endif // CC_TILE_DRAW_QUAD_H_ | 53 #endif // CC_TILE_DRAW_QUAD_H_ |
OLD | NEW |