[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 CCTextureDrawQuad_h |
| 6 | #define CCTextureDrawQuad_h |
| 7 | |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 8 | #include "base/memory/scoped_ptr.h" |
[email protected] | 52347c84 | 2012-11-02 21:06:20 | [diff] [blame^] | 9 | #include "cc/cc_export.h" |
[email protected] | aa0a9d3 | 2012-10-24 01:58:10 | [diff] [blame] | 10 | #include "cc/draw_quad.h" |
[email protected] | 1fea814 | 2012-10-20 04:12:41 | [diff] [blame] | 11 | #include "ui/gfx/rect_f.h" |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 12 | |
| 13 | namespace cc { |
| 14 | |
| 15 | #pragma pack(push, 4) |
| 16 | |
[email protected] | 52347c84 | 2012-11-02 21:06:20 | [diff] [blame^] | 17 | class CC_EXPORT TextureDrawQuad : public DrawQuad { |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 18 | public: |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 19 | static scoped_ptr<TextureDrawQuad> create(const SharedQuadState*, const gfx::Rect&, unsigned resourceId, bool premultipliedAlpha, const gfx::RectF& uvRect, bool flipped); |
[email protected] | 1fea814 | 2012-10-20 04:12:41 | [diff] [blame] | 20 | gfx::RectF uvRect() const { return m_uvRect; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 21 | |
| 22 | unsigned resourceId() const { return m_resourceId; } |
| 23 | bool premultipliedAlpha() const { return m_premultipliedAlpha; } |
| 24 | bool flipped() const { return m_flipped; } |
| 25 | |
| 26 | void setNeedsBlending(); |
| 27 | |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 28 | static const TextureDrawQuad* materialCast(const DrawQuad*); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 29 | private: |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 30 | TextureDrawQuad(const SharedQuadState*, const gfx::Rect&, unsigned resourceId, bool premultipliedAlpha, const gfx::RectF& uvRect, bool flipped); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 31 | |
| 32 | unsigned m_resourceId; |
| 33 | bool m_premultipliedAlpha; |
[email protected] | 1fea814 | 2012-10-20 04:12:41 | [diff] [blame] | 34 | gfx::RectF m_uvRect; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 35 | bool m_flipped; |
| 36 | }; |
| 37 | |
| 38 | #pragma pack(pop) |
| 39 | |
| 40 | } |
| 41 | |
| 42 | #endif |