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 CCTileDrawQuad_h | 5 #ifndef CCTileDrawQuad_h |
6 #define CCTileDrawQuad_h | 6 #define CCTileDrawQuad_h |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/draw_quad.h" | 9 #include "cc/draw_quad.h" |
10 #include "third_party/khronos/GLES2/gl2.h" | 10 #include "third_party/khronos/GLES2/gl2.h" |
11 #include "ui/gfx/point.h" | 11 #include "ui/gfx/point.h" |
12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 #pragma pack(push, 4) | 16 #pragma pack(push, 4) |
17 | 17 |
18 class TileDrawQuad : public DrawQuad { | 18 class TileDrawQuad : public DrawQuad { |
19 public: | 19 public: |
20 static scoped_ptr<TileDrawQuad> create(const SharedQuadState*, const gfx::Re
ct& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Point
& textureOffset, const gfx::Size& textureSize, GLint textureFilter, bool swizzle
Contents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA); | 20 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 | 21 |
22 unsigned resourceId() const { return m_resourceId; } | 22 unsigned resourceId() const { return m_resourceId; } |
23 gfx::Point textureOffset() const { return m_textureOffset; } | 23 gfx::Vector2d textureOffset() const { return m_textureOffset; } |
24 gfx::Size textureSize() const { return m_textureSize; } | 24 gfx::Size textureSize() const { return m_textureSize; } |
25 GLint textureFilter() const { return m_textureFilter; } | 25 GLint textureFilter() const { return m_textureFilter; } |
26 bool swizzleContents() const { return m_swizzleContents; } | 26 bool swizzleContents() const { return m_swizzleContents; } |
27 | 27 |
28 bool leftEdgeAA() const { return m_leftEdgeAA; } | 28 bool leftEdgeAA() const { return m_leftEdgeAA; } |
29 bool topEdgeAA() const { return m_topEdgeAA; } | 29 bool topEdgeAA() const { return m_topEdgeAA; } |
30 bool rightEdgeAA() const { return m_rightEdgeAA; } | 30 bool rightEdgeAA() const { return m_rightEdgeAA; } |
31 bool bottomEdgeAA() const { return m_bottomEdgeAA; } | 31 bool bottomEdgeAA() const { return m_bottomEdgeAA; } |
32 | 32 |
33 bool isAntialiased() const { return leftEdgeAA() || topEdgeAA() || rightEdge
AA() || bottomEdgeAA(); } | 33 bool isAntialiased() const { return leftEdgeAA() || topEdgeAA() || rightEdge
AA() || bottomEdgeAA(); } |
34 | 34 |
35 static const TileDrawQuad* materialCast(const DrawQuad*); | 35 static const TileDrawQuad* materialCast(const DrawQuad*); |
36 private: | 36 private: |
37 TileDrawQuad(const SharedQuadState*, const gfx::Rect& quadRect, const gfx::R
ect& opaqueRect, unsigned resourceId, const gfx::Point& textureOffset, const gfx
::Size& textureSize, GLint textureFilter, bool swizzleContents, bool leftEdgeAA,
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, GLint textureFilter, bool swizzleContents, bool leftEdge
AA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA); |
38 | 38 |
39 unsigned m_resourceId; | 39 unsigned m_resourceId; |
40 gfx::Point m_textureOffset; | 40 gfx::Vector2d m_textureOffset; |
41 gfx::Size m_textureSize; | 41 gfx::Size m_textureSize; |
42 GLint m_textureFilter; | 42 GLint m_textureFilter; |
43 bool m_swizzleContents; | 43 bool m_swizzleContents; |
44 bool m_leftEdgeAA; | 44 bool m_leftEdgeAA; |
45 bool m_topEdgeAA; | 45 bool m_topEdgeAA; |
46 bool m_rightEdgeAA; | 46 bool m_rightEdgeAA; |
47 bool m_bottomEdgeAA; | 47 bool m_bottomEdgeAA; |
48 }; | 48 }; |
49 | 49 |
50 #pragma pack(pop) | 50 #pragma pack(pop) |
51 | 51 |
52 } | 52 } |
53 | 53 |
54 #endif | 54 #endif |
OLD | NEW |