[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" |
heejin.r.chung | d28506ba | 2014-10-23 16:36:20 | [diff] [blame] | 11 | #include "ui/gfx/geometry/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: |
[email protected] | cb320358 | 2014-07-16 07:51:53 | [diff] [blame] | 17 | TextureDrawQuad(); |
[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] | 9bf06c7 | 2014-03-07 18:16:24 | [diff] [blame] | 22 | const gfx::Rect& visible_rect, |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 23 | unsigned resource_id, |
| 24 | bool premultiplied_alpha, |
[email protected] | 14bc5d68 | 2014-01-17 07:26:47 | [diff] [blame] | 25 | const gfx::PointF& uv_top_left, |
| 26 | const gfx::PointF& uv_bottom_right, |
[email protected] | d18b4d6 | 2013-07-12 05:33:49 | [diff] [blame] | 27 | SkColor background_color, |
[email protected] | 4c91aec | 2012-12-15 20:17:18 | [diff] [blame] | 28 | const float vertex_opacity[4], |
jackhou | 10c9af4 | 2014-12-04 05:24:44 | [diff] [blame^] | 29 | bool flipped, |
| 30 | bool nearest_neighbor); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 31 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 32 | void SetAll(const SharedQuadState* shared_quad_state, |
[email protected] | 0023fc7 | 2014-01-10 20:05:06 | [diff] [blame] | 33 | const gfx::Rect& rect, |
| 34 | const gfx::Rect& opaque_rect, |
| 35 | const gfx::Rect& visible_rect, |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 36 | bool needs_blending, |
| 37 | unsigned resource_id, |
| 38 | bool premultiplied_alpha, |
[email protected] | 14bc5d68 | 2014-01-17 07:26:47 | [diff] [blame] | 39 | const gfx::PointF& uv_top_left, |
| 40 | const gfx::PointF& uv_bottom_right, |
[email protected] | d18b4d6 | 2013-07-12 05:33:49 | [diff] [blame] | 41 | SkColor background_color, |
[email protected] | 4c91aec | 2012-12-15 20:17:18 | [diff] [blame] | 42 | const float vertex_opacity[4], |
jackhou | 10c9af4 | 2014-12-04 05:24:44 | [diff] [blame^] | 43 | bool flipped, |
| 44 | bool nearest_neighbor); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 45 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 46 | unsigned resource_id; |
| 47 | bool premultiplied_alpha; |
[email protected] | 1fd555b | 2013-01-18 00:13:21 | [diff] [blame] | 48 | gfx::PointF uv_top_left; |
| 49 | gfx::PointF uv_bottom_right; |
[email protected] | d18b4d6 | 2013-07-12 05:33:49 | [diff] [blame] | 50 | SkColor background_color; |
[email protected] | 4c91aec | 2012-12-15 20:17:18 | [diff] [blame] | 51 | float vertex_opacity[4]; |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 52 | bool flipped; |
jackhou | 10c9af4 | 2014-12-04 05:24:44 | [diff] [blame^] | 53 | bool nearest_neighbor; |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 54 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 55 | void IterateResources(const ResourceIteratorCallback& callback) override; |
[email protected] | 0546963 | 2013-01-16 03:41:00 | [diff] [blame] | 56 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 57 | static const TextureDrawQuad* MaterialCast(const DrawQuad*); |
[email protected] | cd48d68 | 2012-12-13 02:42:19 | [diff] [blame] | 58 | |
[email protected] | c22418b | 2012-11-20 23:06:26 | [diff] [blame] | 59 | private: |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame] | 60 | void ExtendValue(base::debug::TracedValue* value) const override; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 61 | }; |
| 62 | |
[email protected] | adb0854 | 2013-03-26 18:06:10 | [diff] [blame] | 63 | } // namespace cc |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 64 | |
[email protected] | 89e8267 | 2013-03-18 07:50:56 | [diff] [blame] | 65 | #endif // CC_QUADS_TEXTURE_DRAW_QUAD_H_ |