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
3 // found in the LICENSE file.
5 #ifndef CC_QUADS_PICTURE_DRAW_QUAD_H_
6 #define CC_QUADS_PICTURE_DRAW_QUAD_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "cc/base/cc_export.h"
11 #include "cc/playback/raster_source.h"
12 #include "cc/quads/content_draw_quad_base.h"
13 #include "cc/resources/resource_provider.h"
14 #include "ui/gfx/geometry/rect.h"
15 #include "ui/gfx/geometry/rect_f.h"
16 #include "ui/gfx/geometry/size.h"
20 // Used for on-demand tile rasterization.
21 class CC_EXPORT PictureDrawQuad
: public ContentDrawQuadBase
{
24 ~PictureDrawQuad() override
;
26 void SetNew(const SharedQuadState
* shared_quad_state
,
27 const gfx::Rect
& rect
,
28 const gfx::Rect
& opaque_rect
,
29 const gfx::Rect
& visible_rect
,
30 const gfx::RectF
& tex_coord_rect
,
31 const gfx::Size
& texture_size
,
32 bool nearest_neighbor
,
33 ResourceFormat texture_format
,
34 const gfx::Rect
& content_rect
,
36 scoped_refptr
<RasterSource
> raster_source
);
38 void SetAll(const SharedQuadState
* shared_quad_state
,
39 const gfx::Rect
& rect
,
40 const gfx::Rect
& opaque_rect
,
41 const gfx::Rect
& visible_rect
,
43 const gfx::RectF
& tex_coord_rect
,
44 const gfx::Size
& texture_size
,
45 bool nearest_neighbor
,
46 ResourceFormat texture_format
,
47 const gfx::Rect
& content_rect
,
49 scoped_refptr
<RasterSource
> raster_source
);
51 gfx::Rect content_rect
;
53 scoped_refptr
<RasterSource
> raster_source
;
54 ResourceFormat texture_format
;
56 static const PictureDrawQuad
* MaterialCast(const DrawQuad
* quad
);
59 void ExtendValue(base::trace_event::TracedValue
* value
) const override
;
64 #endif // CC_QUADS_PICTURE_DRAW_QUAD_H_