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/playback/raster_source.h" | 11 #include "cc/playback/display_list_raster_source.h" |
12 #include "cc/quads/content_draw_quad_base.h" | 12 #include "cc/quads/content_draw_quad_base.h" |
13 #include "cc/resources/resource_provider.h" | 13 #include "cc/resources/resource_provider.h" |
14 #include "ui/gfx/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" |
15 #include "ui/gfx/geometry/rect_f.h" | 15 #include "ui/gfx/geometry/rect_f.h" |
16 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
17 | 17 |
18 namespace cc { | 18 namespace cc { |
19 | 19 |
20 // Used for on-demand tile rasterization. | 20 // Used for on-demand tile rasterization. |
21 class CC_EXPORT PictureDrawQuad : public ContentDrawQuadBase { | 21 class CC_EXPORT PictureDrawQuad : public ContentDrawQuadBase { |
22 public: | 22 public: |
23 PictureDrawQuad(); | 23 PictureDrawQuad(); |
24 ~PictureDrawQuad() override; | 24 ~PictureDrawQuad() override; |
25 | 25 |
26 void SetNew(const SharedQuadState* shared_quad_state, | 26 void SetNew(const SharedQuadState* shared_quad_state, |
27 const gfx::Rect& rect, | 27 const gfx::Rect& rect, |
28 const gfx::Rect& opaque_rect, | 28 const gfx::Rect& opaque_rect, |
29 const gfx::Rect& visible_rect, | 29 const gfx::Rect& visible_rect, |
30 const gfx::RectF& tex_coord_rect, | 30 const gfx::RectF& tex_coord_rect, |
31 const gfx::Size& texture_size, | 31 const gfx::Size& texture_size, |
32 bool nearest_neighbor, | 32 bool nearest_neighbor, |
33 ResourceFormat texture_format, | 33 ResourceFormat texture_format, |
34 const gfx::Rect& content_rect, | 34 const gfx::Rect& content_rect, |
35 float contents_scale, | 35 float contents_scale, |
36 scoped_refptr<RasterSource> raster_source); | 36 scoped_refptr<DisplayListRasterSource> raster_source); |
37 | 37 |
38 void SetAll(const SharedQuadState* shared_quad_state, | 38 void SetAll(const SharedQuadState* shared_quad_state, |
39 const gfx::Rect& rect, | 39 const gfx::Rect& rect, |
40 const gfx::Rect& opaque_rect, | 40 const gfx::Rect& opaque_rect, |
41 const gfx::Rect& visible_rect, | 41 const gfx::Rect& visible_rect, |
42 bool needs_blending, | 42 bool needs_blending, |
43 const gfx::RectF& tex_coord_rect, | 43 const gfx::RectF& tex_coord_rect, |
44 const gfx::Size& texture_size, | 44 const gfx::Size& texture_size, |
45 bool nearest_neighbor, | 45 bool nearest_neighbor, |
46 ResourceFormat texture_format, | 46 ResourceFormat texture_format, |
47 const gfx::Rect& content_rect, | 47 const gfx::Rect& content_rect, |
48 float contents_scale, | 48 float contents_scale, |
49 scoped_refptr<RasterSource> raster_source); | 49 scoped_refptr<DisplayListRasterSource> raster_source); |
50 | 50 |
51 gfx::Rect content_rect; | 51 gfx::Rect content_rect; |
52 float contents_scale; | 52 float contents_scale; |
53 scoped_refptr<RasterSource> raster_source; | 53 scoped_refptr<DisplayListRasterSource> raster_source; |
54 ResourceFormat texture_format; | 54 ResourceFormat texture_format; |
55 | 55 |
56 static const PictureDrawQuad* MaterialCast(const DrawQuad* quad); | 56 static const PictureDrawQuad* MaterialCast(const DrawQuad* quad); |
57 | 57 |
58 private: | 58 private: |
59 void ExtendValue(base::trace_event::TracedValue* value) const override; | 59 void ExtendValue(base::trace_event::TracedValue* 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 |