OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_QUADS_PICTURE_DRAW_QUAD_H_ | 5 #ifndef CC_QUADS_PICTURE_DRAW_QUAD_H_ |
6 #define CC_QUADS_PICTURE_DRAW_QUAD_H_ | 6 #define CC_QUADS_PICTURE_DRAW_QUAD_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
11 #include "cc/quads/content_draw_quad_base.h" | 11 #include "cc/quads/content_draw_quad_base.h" |
12 #include "cc/resources/picture_pile_impl.h" | 12 #include "cc/resources/picture_pile_impl.h" |
13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
14 #include "ui/gfx/rect_f.h" | 14 #include "ui/gfx/rect_f.h" |
15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
16 | 16 |
17 namespace cc { | 17 namespace cc { |
18 | 18 |
19 // Used for on-demand tile rasterization. | 19 // Used for on-demand tile rasterization. |
20 class CC_EXPORT PictureDrawQuad : public ContentDrawQuadBase { | 20 class CC_EXPORT PictureDrawQuad : public ContentDrawQuadBase { |
21 public: | 21 public: |
22 static scoped_ptr<PictureDrawQuad> Create(); | 22 static scoped_ptr<PictureDrawQuad> Create(); |
23 virtual ~PictureDrawQuad(); | 23 virtual ~PictureDrawQuad(); |
24 | 24 |
25 void SetNew(const SharedQuadState* shared_quad_state, | 25 void SetNew(const SharedQuadState* shared_quad_state, |
26 gfx::Rect rect, | 26 const gfx::Rect& rect, |
27 gfx::Rect opaque_rect, | 27 const gfx::Rect& opaque_rect, |
28 const gfx::RectF& tex_coord_rect, | 28 const gfx::RectF& tex_coord_rect, |
29 gfx::Size texture_size, | 29 gfx::Size texture_size, |
30 ResourceFormat texture_format, | 30 ResourceFormat texture_format, |
31 gfx::Rect content_rect, | 31 const gfx::Rect& content_rect, |
32 float contents_scale, | 32 float contents_scale, |
33 scoped_refptr<PicturePileImpl> picture_pile); | 33 scoped_refptr<PicturePileImpl> picture_pile); |
34 | 34 |
35 void SetAll(const SharedQuadState* shared_quad_state, | 35 void SetAll(const SharedQuadState* shared_quad_state, |
36 gfx::Rect rect, | 36 const gfx::Rect& rect, |
37 gfx::Rect opaque_rect, | 37 const gfx::Rect& opaque_rect, |
38 gfx::Rect visible_rect, | 38 const gfx::Rect& visible_rect, |
39 bool needs_blending, | 39 bool needs_blending, |
40 const gfx::RectF& tex_coord_rect, | 40 const gfx::RectF& tex_coord_rect, |
41 gfx::Size texture_size, | 41 gfx::Size texture_size, |
42 ResourceFormat texture_format, | 42 ResourceFormat texture_format, |
43 gfx::Rect content_rect, | 43 const gfx::Rect& content_rect, |
44 float contents_scale, | 44 float contents_scale, |
45 scoped_refptr<PicturePileImpl> picture_pile); | 45 scoped_refptr<PicturePileImpl> picture_pile); |
46 | 46 |
47 gfx::Rect content_rect; | 47 gfx::Rect content_rect; |
48 float contents_scale; | 48 float contents_scale; |
49 scoped_refptr<PicturePileImpl> picture_pile; | 49 scoped_refptr<PicturePileImpl> picture_pile; |
50 ResourceFormat texture_format; | 50 ResourceFormat texture_format; |
51 | 51 |
52 virtual void IterateResources(const ResourceIteratorCallback& callback) | 52 virtual void IterateResources(const ResourceIteratorCallback& callback) |
53 OVERRIDE; | 53 OVERRIDE; |
54 | 54 |
55 static const PictureDrawQuad* MaterialCast(const DrawQuad* quad); | 55 static const PictureDrawQuad* MaterialCast(const DrawQuad* quad); |
56 | 56 |
57 private: | 57 private: |
58 PictureDrawQuad(); | 58 PictureDrawQuad(); |
59 virtual void ExtendValue(base::DictionaryValue* value) const OVERRIDE; | 59 virtual void ExtendValue(base::DictionaryValue* value) const OVERRIDE; |
60 }; | 60 }; |
61 | 61 |
62 } // namespace cc | 62 } // namespace cc |
63 | 63 |
64 #endif // CC_QUADS_PICTURE_DRAW_QUAD_H_ | 64 #endif // CC_QUADS_PICTURE_DRAW_QUAD_H_ |
OLD | NEW |