1 // Copyright 2011 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_RENDER_PASS_DRAW_QUAD_H_
6 #define CC_QUADS_RENDER_PASS_DRAW_QUAD_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "cc/base/cc_export.h"
11 #include "cc/output/filter_operations.h"
12 #include "cc/quads/draw_quad.h"
13 #include "cc/quads/render_pass.h"
14 #include "cc/resources/resource_provider.h"
18 class CC_EXPORT RenderPassDrawQuad
: public DrawQuad
{
21 virtual ~RenderPassDrawQuad();
23 void SetNew(const SharedQuadState
* shared_quad_state
,
24 const gfx::Rect
& rect
,
25 const gfx::Rect
& visible_rect
,
26 RenderPass::Id render_pass_id
,
27 ResourceProvider::ResourceId mask_resource_id
,
28 const gfx::RectF
& mask_uv_rect
,
29 const FilterOperations
& filters
,
30 const gfx::Vector2dF
& filters_scale
,
31 const FilterOperations
& background_filters
);
33 void SetAll(const SharedQuadState
* shared_quad_state
,
34 const gfx::Rect
& rect
,
35 const gfx::Rect
& opaque_rect
,
36 const gfx::Rect
& visible_rect
,
38 RenderPass::Id render_pass_id
,
39 ResourceProvider::ResourceId mask_resource_id
,
40 const gfx::RectF
& mask_uv_rect
,
41 const FilterOperations
& filters
,
42 const gfx::Vector2dF
& filters_scale
,
43 const FilterOperations
& background_filters
);
45 RenderPass::Id render_pass_id
;
46 ResourceProvider::ResourceId mask_resource_id
;
47 gfx::RectF mask_uv_rect
;
49 // Post-processing filters, applied to the pixels in the render pass' texture.
50 FilterOperations filters
;
52 // The scale from layer space of the root layer of the render pass to
53 // the render pass physical pixels. This scale is applied to the filter
54 // parameters for pixel-moving filters. This scale should include
55 // content-to-target-space scale, and device pixel ratio.
56 gfx::Vector2dF filters_scale
;
58 // Post-processing filters, applied to the pixels showing through the
59 // background of the render pass, from behind it.
60 FilterOperations background_filters
;
62 virtual void IterateResources(const ResourceIteratorCallback
& callback
)
65 static const RenderPassDrawQuad
* MaterialCast(const DrawQuad
*);
68 virtual void ExtendValue(base::debug::TracedValue
* value
) const OVERRIDE
;
73 #endif // CC_QUADS_RENDER_PASS_DRAW_QUAD_H_