Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Side by Side Diff: cc/quads/render_pass_draw_quad.h

Issue 2543473004: cc: Move filters from RenderPassDrawQuad to RenderPass (Closed)
Patch Set: Address review comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 15 matching lines...) Expand all
26 RenderPassDrawQuad(const RenderPassDrawQuad& other); 26 RenderPassDrawQuad(const RenderPassDrawQuad& other);
27 ~RenderPassDrawQuad() override; 27 ~RenderPassDrawQuad() override;
28 28
29 void SetNew(const SharedQuadState* shared_quad_state, 29 void SetNew(const SharedQuadState* shared_quad_state,
30 const gfx::Rect& rect, 30 const gfx::Rect& rect,
31 const gfx::Rect& visible_rect, 31 const gfx::Rect& visible_rect,
32 RenderPassId render_pass_id, 32 RenderPassId render_pass_id,
33 ResourceId mask_resource_id, 33 ResourceId mask_resource_id,
34 const gfx::Vector2dF& mask_uv_scale, 34 const gfx::Vector2dF& mask_uv_scale,
35 const gfx::Size& mask_texture_size, 35 const gfx::Size& mask_texture_size,
36 const FilterOperations& filters,
37 const gfx::Vector2dF& filters_scale, 36 const gfx::Vector2dF& filters_scale,
38 const gfx::PointF& filters_origin, 37 const gfx::PointF& filters_origin);
39 const FilterOperations& background_filters);
40 38
41 void SetAll(const SharedQuadState* shared_quad_state, 39 void SetAll(const SharedQuadState* shared_quad_state,
42 const gfx::Rect& rect, 40 const gfx::Rect& rect,
43 const gfx::Rect& opaque_rect, 41 const gfx::Rect& opaque_rect,
44 const gfx::Rect& visible_rect, 42 const gfx::Rect& visible_rect,
45 bool needs_blending, 43 bool needs_blending,
46 RenderPassId render_pass_id, 44 RenderPassId render_pass_id,
47 ResourceId mask_resource_id, 45 ResourceId mask_resource_id,
48 const gfx::Vector2dF& mask_uv_scale, 46 const gfx::Vector2dF& mask_uv_scale,
49 const gfx::Size& mask_texture_size, 47 const gfx::Size& mask_texture_size,
50 const FilterOperations& filters,
51 const gfx::Vector2dF& filters_scale, 48 const gfx::Vector2dF& filters_scale,
52 const gfx::PointF& filters_origin, 49 const gfx::PointF& filters_origin);
53 const FilterOperations& background_filters);
54 50
55 RenderPassId render_pass_id; 51 RenderPassId render_pass_id;
56 gfx::Vector2dF mask_uv_scale; 52 gfx::Vector2dF mask_uv_scale;
57 gfx::Size mask_texture_size; 53 gfx::Size mask_texture_size;
58 54
59 // Post-processing filters, applied to the pixels in the render pass' texture.
60 FilterOperations filters;
61
62 // The scale from layer space of the root layer of the render pass to 55 // The scale from layer space of the root layer of the render pass to
63 // the render pass physical pixels. This scale is applied to the filter 56 // the render pass physical pixels. This scale is applied to the filter
64 // parameters for pixel-moving filters. This scale should include 57 // parameters for pixel-moving filters. This scale should include
65 // content-to-target-space scale, and device pixel ratio. 58 // content-to-target-space scale, and device pixel ratio.
66 gfx::Vector2dF filters_scale; 59 gfx::Vector2dF filters_scale;
67 60
68 // The origin for post-processing filters which will be used to offset 61 // The origin for post-processing filters which will be used to offset
69 // crop rects, lights, etc. 62 // crop rects, lights, etc.
70 gfx::PointF filters_origin; 63 gfx::PointF filters_origin;
71 64
72 // Post-processing filters, applied to the pixels showing through the
73 // background of the render pass, from behind it.
74 FilterOperations background_filters;
75
76 // Helper function to generate the normalized uv rect. 65 // Helper function to generate the normalized uv rect.
77 gfx::RectF MaskUVRect() const; 66 gfx::RectF MaskUVRect() const;
78 67
79 ResourceId mask_resource_id() const { 68 ResourceId mask_resource_id() const {
80 return resources.ids[kMaskResourceIdIndex]; 69 return resources.ids[kMaskResourceIdIndex];
81 } 70 }
82 71
83 static const RenderPassDrawQuad* MaterialCast(const DrawQuad*); 72 static const RenderPassDrawQuad* MaterialCast(const DrawQuad*);
84 73
85 private: 74 private:
86 void ExtendValue(base::trace_event::TracedValue* value) const override; 75 void ExtendValue(base::trace_event::TracedValue* value) const override;
87 }; 76 };
88 77
89 } // namespace cc 78 } // namespace cc
90 79
91 #endif // CC_QUADS_RENDER_PASS_DRAW_QUAD_H_ 80 #endif // CC_QUADS_RENDER_PASS_DRAW_QUAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698