[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] | 89e8267 | 2013-03-18 07:50:56 | [diff] [blame] | 5 | #ifndef CC_QUADS_TEXTURE_DRAW_QUAD_H_ |
| 6 | #define CC_QUADS_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] | 681ccff | 2013-03-18 06:13:52 | [diff] [blame] | 9 | #include "cc/base/cc_export.h" |
[email protected] | 89e8267 | 2013-03-18 07:50:56 | [diff] [blame] | 10 | #include "cc/quads/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, |
[email protected] | 0023fc7 | 2014-01-10 20:05:06 | [diff] [blame^] | 20 | const gfx::Rect& rect, |
| 21 | const gfx::Rect& opaque_rect, |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 22 | unsigned resource_id, |
| 23 | bool premultiplied_alpha, |
[email protected] | 1fd555b | 2013-01-18 00:13:21 | [diff] [blame] | 24 | gfx::PointF uv_top_left, |
| 25 | gfx::PointF uv_bottom_right, |
[email protected] | d18b4d6 | 2013-07-12 05:33:49 | [diff] [blame] | 26 | SkColor background_color, |
[email protected] | 4c91aec | 2012-12-15 20:17:18 | [diff] [blame] | 27 | const float vertex_opacity[4], |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 28 | bool flipped); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 29 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 30 | void SetAll(const SharedQuadState* shared_quad_state, |
[email protected] | 0023fc7 | 2014-01-10 20:05:06 | [diff] [blame^] | 31 | const gfx::Rect& rect, |
| 32 | const gfx::Rect& opaque_rect, |
| 33 | const gfx::Rect& visible_rect, |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 34 | bool needs_blending, |
| 35 | unsigned resource_id, |
| 36 | bool premultiplied_alpha, |
[email protected] | 1fd555b | 2013-01-18 00:13:21 | [diff] [blame] | 37 | gfx::PointF uv_top_left, |
| 38 | gfx::PointF uv_bottom_right, |
[email protected] | d18b4d6 | 2013-07-12 05:33:49 | [diff] [blame] | 39 | SkColor background_color, |
[email protected] | 4c91aec | 2012-12-15 20:17:18 | [diff] [blame] | 40 | const float vertex_opacity[4], |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 41 | bool flipped); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 42 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 43 | unsigned resource_id; |
| 44 | bool premultiplied_alpha; |
[email protected] | 1fd555b | 2013-01-18 00:13:21 | [diff] [blame] | 45 | gfx::PointF uv_top_left; |
| 46 | gfx::PointF uv_bottom_right; |
[email protected] | d18b4d6 | 2013-07-12 05:33:49 | [diff] [blame] | 47 | SkColor background_color; |
[email protected] | 4c91aec | 2012-12-15 20:17:18 | [diff] [blame] | 48 | float vertex_opacity[4]; |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 49 | bool flipped; |
| 50 | |
[email protected] | 3c0a63c2 | 2013-03-01 03:56:58 | [diff] [blame] | 51 | virtual void IterateResources(const ResourceIteratorCallback& callback) |
[email protected] | 0546963 | 2013-01-16 03:41:00 | [diff] [blame] | 52 | OVERRIDE; |
| 53 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 54 | static const TextureDrawQuad* MaterialCast(const DrawQuad*); |
[email protected] | cd48d68 | 2012-12-13 02:42:19 | [diff] [blame] | 55 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 56 | private: |
| 57 | TextureDrawQuad(); |
[email protected] | 3480672 | 2013-08-09 23:51:21 | [diff] [blame] | 58 | virtual void ExtendValue(base::DictionaryValue* value) const OVERRIDE; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 59 | }; |
| 60 | |
[email protected] | adb0854 | 2013-03-26 18:06:10 | [diff] [blame] | 61 | } // namespace cc |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 62 | |
[email protected] | 89e8267 | 2013-03-18 07:50:56 | [diff] [blame] | 63 | #endif // CC_QUADS_TEXTURE_DRAW_QUAD_H_ |