| 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/display_list_raster_source.h" | 11 #include "cc/playback/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(const PictureDrawQuad& other); | 24 PictureDrawQuad(const PictureDrawQuad& other); |
| 25 ~PictureDrawQuad() override; | 25 ~PictureDrawQuad() override; |
| 26 | 26 |
| 27 void SetNew(const SharedQuadState* shared_quad_state, | 27 void SetNew(const SharedQuadState* shared_quad_state, |
| 28 const gfx::Rect& rect, | 28 const gfx::Rect& rect, |
| 29 const gfx::Rect& opaque_rect, | 29 const gfx::Rect& opaque_rect, |
| 30 const gfx::Rect& visible_rect, | 30 const gfx::Rect& visible_rect, |
| 31 const gfx::RectF& tex_coord_rect, | 31 const gfx::RectF& tex_coord_rect, |
| 32 const gfx::Size& texture_size, | 32 const gfx::Size& texture_size, |
| 33 bool nearest_neighbor, | 33 bool nearest_neighbor, |
| 34 ResourceFormat texture_format, | 34 ResourceFormat texture_format, |
| 35 const gfx::Rect& content_rect, | 35 const gfx::Rect& content_rect, |
| 36 float contents_scale, | 36 float contents_scale, |
| 37 scoped_refptr<DisplayListRasterSource> raster_source); | 37 scoped_refptr<RasterSource> raster_source); |
| 38 | 38 |
| 39 void SetAll(const SharedQuadState* shared_quad_state, | 39 void SetAll(const SharedQuadState* shared_quad_state, |
| 40 const gfx::Rect& rect, | 40 const gfx::Rect& rect, |
| 41 const gfx::Rect& opaque_rect, | 41 const gfx::Rect& opaque_rect, |
| 42 const gfx::Rect& visible_rect, | 42 const gfx::Rect& visible_rect, |
| 43 bool needs_blending, | 43 bool needs_blending, |
| 44 const gfx::RectF& tex_coord_rect, | 44 const gfx::RectF& tex_coord_rect, |
| 45 const gfx::Size& texture_size, | 45 const gfx::Size& texture_size, |
| 46 bool nearest_neighbor, | 46 bool nearest_neighbor, |
| 47 ResourceFormat texture_format, | 47 ResourceFormat texture_format, |
| 48 const gfx::Rect& content_rect, | 48 const gfx::Rect& content_rect, |
| 49 float contents_scale, | 49 float contents_scale, |
| 50 scoped_refptr<DisplayListRasterSource> raster_source); | 50 scoped_refptr<RasterSource> raster_source); |
| 51 | 51 |
| 52 gfx::Rect content_rect; | 52 gfx::Rect content_rect; |
| 53 float contents_scale; | 53 float contents_scale; |
| 54 scoped_refptr<DisplayListRasterSource> raster_source; | 54 scoped_refptr<RasterSource> raster_source; |
| 55 ResourceFormat texture_format; | 55 ResourceFormat texture_format; |
| 56 | 56 |
| 57 static const PictureDrawQuad* MaterialCast(const DrawQuad* quad); | 57 static const PictureDrawQuad* MaterialCast(const DrawQuad* quad); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 void ExtendValue(base::trace_event::TracedValue* value) const override; | 60 void ExtendValue(base::trace_event::TracedValue* value) const override; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace cc | 63 } // namespace cc |
| 64 | 64 |
| 65 #endif // CC_QUADS_PICTURE_DRAW_QUAD_H_ | 65 #endif // CC_QUADS_PICTURE_DRAW_QUAD_H_ |
| OLD | NEW |