[email protected] | 0fb2500 | 2012-10-12 07:20:02 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 4 | |
| 5 | #ifndef CCTileDrawQuad_h |
| 6 | #define CCTileDrawQuad_h |
| 7 | |
| 8 | #include "CCDrawQuad.h" |
[email protected] | d9c2852 | 2012-10-18 23:35:43 | [diff] [blame] | 9 | #include "third_party/khronos/GLES2/gl2.h" |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 10 | #include "base/memory/scoped_ptr.h" |
[email protected] | 1fea814 | 2012-10-20 04:12:41 | [diff] [blame^] | 11 | #include "ui/gfx/point.h" |
| 12 | #include "ui/gfx/size.h" |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 13 | |
| 14 | namespace cc { |
| 15 | |
| 16 | #pragma pack(push, 4) |
| 17 | |
[email protected] | c753e25a | 2012-10-19 21:22:42 | [diff] [blame] | 18 | class CCTileDrawQuad : public CCDrawQuad { |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 19 | public: |
[email protected] | 1fea814 | 2012-10-20 04:12:41 | [diff] [blame^] | 20 | static scoped_ptr<CCTileDrawQuad> create(const CCSharedQuadState*, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Point& textureOffset, const gfx::Size& textureSize, GLint textureFilter, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 21 | |
| 22 | unsigned resourceId() const { return m_resourceId; } |
[email protected] | 1fea814 | 2012-10-20 04:12:41 | [diff] [blame^] | 23 | gfx::Point textureOffset() const { return m_textureOffset; } |
| 24 | gfx::Size textureSize() const { return m_textureSize; } |
[email protected] | d9c2852 | 2012-10-18 23:35:43 | [diff] [blame] | 25 | GLint textureFilter() const { return m_textureFilter; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 26 | bool swizzleContents() const { return m_swizzleContents; } |
| 27 | |
| 28 | bool leftEdgeAA() const { return m_leftEdgeAA; } |
| 29 | bool topEdgeAA() const { return m_topEdgeAA; } |
| 30 | bool rightEdgeAA() const { return m_rightEdgeAA; } |
| 31 | bool bottomEdgeAA() const { return m_bottomEdgeAA; } |
| 32 | |
| 33 | bool isAntialiased() const { return leftEdgeAA() || topEdgeAA() || rightEdgeAA() || bottomEdgeAA(); } |
| 34 | |
[email protected] | c753e25a | 2012-10-19 21:22:42 | [diff] [blame] | 35 | static const CCTileDrawQuad* materialCast(const CCDrawQuad*); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 36 | private: |
[email protected] | 1fea814 | 2012-10-20 04:12:41 | [diff] [blame^] | 37 | CCTileDrawQuad(const CCSharedQuadState*, const gfx::Rect& quadRect, const gfx::Rect& opaqueRect, unsigned resourceId, const gfx::Point& textureOffset, const gfx::Size& textureSize, GLint textureFilter, bool swizzleContents, bool leftEdgeAA, bool topEdgeAA, bool rightEdgeAA, bool bottomEdgeAA); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 38 | |
| 39 | unsigned m_resourceId; |
[email protected] | 1fea814 | 2012-10-20 04:12:41 | [diff] [blame^] | 40 | gfx::Point m_textureOffset; |
| 41 | gfx::Size m_textureSize; |
[email protected] | d9c2852 | 2012-10-18 23:35:43 | [diff] [blame] | 42 | GLint m_textureFilter; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 43 | bool m_swizzleContents; |
| 44 | bool m_leftEdgeAA; |
| 45 | bool m_topEdgeAA; |
| 46 | bool m_rightEdgeAA; |
| 47 | bool m_bottomEdgeAA; |
| 48 | }; |
| 49 | |
| 50 | #pragma pack(pop) |
| 51 | |
| 52 | } |
| 53 | |
| 54 | #endif |