OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 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 | 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_RENDER_PASS_DRAW_QUAD_H_ | 5 #ifndef CC_QUADS_RENDER_PASS_DRAW_QUAD_H_ |
6 #define CC_QUADS_RENDER_PASS_DRAW_QUAD_H_ | 6 #define CC_QUADS_RENDER_PASS_DRAW_QUAD_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 14 matching lines...) Expand all Loading... |
25 RenderPassDrawQuad(const RenderPassDrawQuad& other); | 25 RenderPassDrawQuad(const RenderPassDrawQuad& other); |
26 ~RenderPassDrawQuad() override; | 26 ~RenderPassDrawQuad() override; |
27 | 27 |
28 void SetNew(const SharedQuadState* shared_quad_state, | 28 void SetNew(const SharedQuadState* shared_quad_state, |
29 const gfx::Rect& rect, | 29 const gfx::Rect& rect, |
30 const gfx::Rect& visible_rect, | 30 const gfx::Rect& visible_rect, |
31 int render_pass_id, | 31 int render_pass_id, |
32 ResourceId mask_resource_id, | 32 ResourceId mask_resource_id, |
33 const gfx::Vector2dF& mask_uv_scale, | 33 const gfx::Vector2dF& mask_uv_scale, |
34 const gfx::Size& mask_texture_size, | 34 const gfx::Size& mask_texture_size, |
35 const FilterOperations& filters, | |
36 const gfx::Vector2dF& filters_scale, | 35 const gfx::Vector2dF& filters_scale, |
37 const gfx::PointF& filters_origin, | 36 const gfx::PointF& filters_origin); |
38 const FilterOperations& background_filters); | |
39 | 37 |
40 void SetAll(const SharedQuadState* shared_quad_state, | 38 void SetAll(const SharedQuadState* shared_quad_state, |
41 const gfx::Rect& rect, | 39 const gfx::Rect& rect, |
42 const gfx::Rect& opaque_rect, | 40 const gfx::Rect& opaque_rect, |
43 const gfx::Rect& visible_rect, | 41 const gfx::Rect& visible_rect, |
44 bool needs_blending, | 42 bool needs_blending, |
45 int render_pass_id, | 43 int render_pass_id, |
46 ResourceId mask_resource_id, | 44 ResourceId mask_resource_id, |
47 const gfx::Vector2dF& mask_uv_scale, | 45 const gfx::Vector2dF& mask_uv_scale, |
48 const gfx::Size& mask_texture_size, | 46 const gfx::Size& mask_texture_size, |
49 const FilterOperations& filters, | |
50 const gfx::Vector2dF& filters_scale, | 47 const gfx::Vector2dF& filters_scale, |
51 const gfx::PointF& filters_origin, | 48 const gfx::PointF& filters_origin); |
52 const FilterOperations& background_filters); | |
53 | 49 |
54 int render_pass_id; | 50 int render_pass_id; |
55 gfx::Vector2dF mask_uv_scale; | 51 gfx::Vector2dF mask_uv_scale; |
56 gfx::Size mask_texture_size; | 52 gfx::Size mask_texture_size; |
57 | 53 |
58 // Post-processing filters, applied to the pixels in the render pass' texture. | |
59 FilterOperations filters; | |
60 | |
61 // The scale from layer space of the root layer of the render pass to | 54 // The scale from layer space of the root layer of the render pass to |
62 // the render pass physical pixels. This scale is applied to the filter | 55 // the render pass physical pixels. This scale is applied to the filter |
63 // parameters for pixel-moving filters. This scale should include | 56 // parameters for pixel-moving filters. This scale should include |
64 // content-to-target-space scale, and device pixel ratio. | 57 // content-to-target-space scale, and device pixel ratio. |
65 gfx::Vector2dF filters_scale; | 58 gfx::Vector2dF filters_scale; |
66 | 59 |
67 // The origin for post-processing filters which will be used to offset | 60 // The origin for post-processing filters which will be used to offset |
68 // crop rects, lights, etc. | 61 // crop rects, lights, etc. |
69 gfx::PointF filters_origin; | 62 gfx::PointF filters_origin; |
70 | 63 |
71 // Post-processing filters, applied to the pixels showing through the | |
72 // background of the render pass, from behind it. | |
73 FilterOperations background_filters; | |
74 | |
75 // Helper function to generate the normalized uv rect. | 64 // Helper function to generate the normalized uv rect. |
76 gfx::RectF MaskUVRect() const; | 65 gfx::RectF MaskUVRect() const; |
77 | 66 |
78 ResourceId mask_resource_id() const { | 67 ResourceId mask_resource_id() const { |
79 return resources.ids[kMaskResourceIdIndex]; | 68 return resources.ids[kMaskResourceIdIndex]; |
80 } | 69 } |
81 | 70 |
82 static const RenderPassDrawQuad* MaterialCast(const DrawQuad*); | 71 static const RenderPassDrawQuad* MaterialCast(const DrawQuad*); |
83 | 72 |
84 private: | 73 private: |
85 void ExtendValue(base::trace_event::TracedValue* value) const override; | 74 void ExtendValue(base::trace_event::TracedValue* value) const override; |
86 }; | 75 }; |
87 | 76 |
88 } // namespace cc | 77 } // namespace cc |
89 | 78 |
90 #endif // CC_QUADS_RENDER_PASS_DRAW_QUAD_H_ | 79 #endif // CC_QUADS_RENDER_PASS_DRAW_QUAD_H_ |
OLD | NEW |