[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 | |
[email protected] | 8fcbaa37 | 2012-11-05 04:12:41 | [diff] [blame] | 5 | #ifndef CC_TEXTURE_DRAW_QUAD_H_ |
| 6 | #define CC_TEXTURE_DRAW_QUAD_H_ |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 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 | |
[email protected] | 52347c84 | 2012-11-02 21:06:20 | [diff] [blame] | 15 | class CC_EXPORT TextureDrawQuad : public DrawQuad { |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 16 | public: |
| 17 | static scoped_ptr<TextureDrawQuad> Create(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 18 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 19 | void SetNew(const SharedQuadState* shared_quad_state, |
| 20 | gfx::Rect rect, |
| 21 | gfx::Rect opaque_rect, |
| 22 | unsigned resource_id, |
| 23 | bool premultiplied_alpha, |
| 24 | const gfx::RectF& uv_rect, |
[email protected] | 4c91aec | 2012-12-15 20:17:18 | [diff] [blame] | 25 | const float vertex_opacity[4], |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 26 | bool flipped); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 27 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 28 | void SetAll(const SharedQuadState* shared_quad_state, |
| 29 | gfx::Rect rect, |
| 30 | gfx::Rect opaque_rect, |
| 31 | gfx::Rect visible_rect, |
| 32 | bool needs_blending, |
| 33 | unsigned resource_id, |
| 34 | bool premultiplied_alpha, |
| 35 | const gfx::RectF& uv_rect, |
[email protected] | 4c91aec | 2012-12-15 20:17:18 | [diff] [blame] | 36 | const float vertex_opacity[4], |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 37 | bool flipped); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 38 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 39 | unsigned resource_id; |
| 40 | bool premultiplied_alpha; |
| 41 | gfx::RectF uv_rect; |
[email protected] | 4c91aec | 2012-12-15 20:17:18 | [diff] [blame] | 42 | float vertex_opacity[4]; |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 43 | bool flipped; |
| 44 | |
[email protected] | 0546963 | 2013-01-16 03:41:00 | [diff] [blame^] | 45 | virtual void AppendResources(ResourceProvider::ResourceIdArray* resources) |
| 46 | OVERRIDE; |
| 47 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 48 | static const TextureDrawQuad* MaterialCast(const DrawQuad*); |
[email protected] | cd48d68 | 2012-12-13 02:42:19 | [diff] [blame] | 49 | |
| 50 | bool PerformClipping(); |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 51 | private: |
| 52 | TextureDrawQuad(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 53 | }; |
| 54 | |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 55 | } |
| 56 | |
[email protected] | 8fcbaa37 | 2012-11-05 04:12:41 | [diff] [blame] | 57 | #endif // CC_TEXTURE_DRAW_QUAD_H_ |