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_RENDER_PASS_H_ | 5 #ifndef CC_RENDER_PASS_H_ |
6 #define CC_RENDER_PASS_H_ | 6 #define CC_RENDER_PASS_H_ |
7 | 7 |
8 #include <public/WebFilterOperations.h> | 8 #include <public/WebFilterOperations.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "cc/cc_export.h" | 12 #include "cc/cc_export.h" |
13 #include "cc/draw_quad.h" | 13 #include "cc/draw_quad.h" |
14 #include "cc/hash_pair.h" | 14 #include "cc/hash_pair.h" |
15 #include "cc/scoped_ptr_hash_map.h" | 15 #include "cc/scoped_ptr_hash_map.h" |
16 #include "cc/scoped_ptr_vector.h" | 16 #include "cc/scoped_ptr_vector.h" |
17 #include "cc/shared_quad_state.h" | 17 #include "cc/shared_quad_state.h" |
| 18 #include "cc/skia_refptr.h" |
18 #include "third_party/skia/include/core/SkColor.h" | 19 #include "third_party/skia/include/core/SkColor.h" |
| 20 #include "third_party/skia/include/core/SkImageFilter.h" |
19 #include "ui/gfx/rect_f.h" | 21 #include "ui/gfx/rect_f.h" |
20 #include "ui/gfx/transform.h" | 22 #include "ui/gfx/transform.h" |
21 | 23 |
22 class SkImageFilter; | |
23 | |
24 namespace cc { | 24 namespace cc { |
25 | 25 |
26 // A list of DrawQuad objects, sorted internally in front-to-back order. | 26 // A list of DrawQuad objects, sorted internally in front-to-back order. |
27 class QuadList : public ScopedPtrVector<DrawQuad> { | 27 class QuadList : public ScopedPtrVector<DrawQuad> { |
28 public: | 28 public: |
29 typedef reverse_iterator backToFrontIterator; | 29 typedef reverse_iterator backToFrontIterator; |
30 typedef const_reverse_iterator constBackToFrontIterator; | 30 typedef const_reverse_iterator constBackToFrontIterator; |
31 | 31 |
32 inline backToFrontIterator backToFrontBegin() { return rbegin(); } | 32 inline backToFrontIterator backToFrontBegin() { return rbegin(); } |
33 inline backToFrontIterator backToFrontEnd() { return rend(); } | 33 inline backToFrontIterator backToFrontEnd() { return rend(); } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 gfx::RectF damage_rect, | 69 gfx::RectF damage_rect, |
70 const gfx::Transform& transform_to_root_target); | 70 const gfx::Transform& transform_to_root_target); |
71 | 71 |
72 void SetAll(Id id, | 72 void SetAll(Id id, |
73 gfx::Rect output_rect, | 73 gfx::Rect output_rect, |
74 gfx::RectF damage_rect, | 74 gfx::RectF damage_rect, |
75 const gfx::Transform& transform_to_root_target, | 75 const gfx::Transform& transform_to_root_target, |
76 bool has_transparent_background, | 76 bool has_transparent_background, |
77 bool has_occlusion_from_outside_target_surface, | 77 bool has_occlusion_from_outside_target_surface, |
78 const WebKit::WebFilterOperations& filters, | 78 const WebKit::WebFilterOperations& filters, |
79 SkImageFilter* filter, | 79 const SkiaRefPtr<SkImageFilter>& filter, |
80 const WebKit::WebFilterOperations& background_filters); | 80 const WebKit::WebFilterOperations& background_filters); |
81 | 81 |
82 // Uniquely identifies the render pass in the compositor's current frame. | 82 // Uniquely identifies the render pass in the compositor's current frame. |
83 Id id; | 83 Id id; |
84 | 84 |
85 // These are in the space of the render pass' physical pixels. | 85 // These are in the space of the render pass' physical pixels. |
86 gfx::Rect output_rect; | 86 gfx::Rect output_rect; |
87 gfx::RectF damage_rect; | 87 gfx::RectF damage_rect; |
88 | 88 |
89 // Transforms from the origin of the |output_rect| to the origin of the root | 89 // Transforms from the origin of the |output_rect| to the origin of the root |
90 // render pass' |output_rect|. | 90 // render pass' |output_rect|. |
91 gfx::Transform transform_to_root_target; | 91 gfx::Transform transform_to_root_target; |
92 | 92 |
93 // If false, the pixels in the render pass' texture are all opaque. | 93 // If false, the pixels in the render pass' texture are all opaque. |
94 bool has_transparent_background; | 94 bool has_transparent_background; |
95 | 95 |
96 // If true, then there may be pixels in the render pass' texture that are not | 96 // If true, then there may be pixels in the render pass' texture that are not |
97 // complete, since they are occluded. | 97 // complete, since they are occluded. |
98 bool has_occlusion_from_outside_target_surface; | 98 bool has_occlusion_from_outside_target_surface; |
99 | 99 |
100 // Deprecated post-processing filters, applied to the pixels in the render | 100 // Deprecated post-processing filters, applied to the pixels in the render |
101 // pass' texture. | 101 // pass' texture. |
102 WebKit::WebFilterOperations filters; | 102 WebKit::WebFilterOperations filters; |
103 // Post-processing filter applied to the pixels in the render pass' texture. | 103 // Post-processing filter applied to the pixels in the render pass' texture. |
104 SkImageFilter* filter; | 104 SkiaRefPtr<SkImageFilter> filter; |
105 | 105 |
106 // Post-processing filters, applied to the pixels showing through the | 106 // Post-processing filters, applied to the pixels showing through the |
107 // background of the render pass, from behind it. | 107 // background of the render pass, from behind it. |
108 WebKit::WebFilterOperations background_filters; | 108 WebKit::WebFilterOperations background_filters; |
109 | 109 |
110 QuadList quad_list; | 110 QuadList quad_list; |
111 SharedQuadStateList shared_quad_state_list; | 111 SharedQuadStateList shared_quad_state_list; |
112 | 112 |
113 protected: | 113 protected: |
114 RenderPass(); | 114 RenderPass(); |
(...skipping 22 matching lines...) Expand all Loading... |
137 #error define a hash function for your compiler | 137 #error define a hash function for your compiler |
138 #endif // COMPILER | 138 #endif // COMPILER |
139 } | 139 } |
140 | 140 |
141 namespace cc { | 141 namespace cc { |
142 typedef std::vector<RenderPass*> RenderPassList; | 142 typedef std::vector<RenderPass*> RenderPassList; |
143 typedef ScopedPtrHashMap<RenderPass::Id, RenderPass> RenderPassIdHashMap; | 143 typedef ScopedPtrHashMap<RenderPass::Id, RenderPass> RenderPassIdHashMap; |
144 } // namespace cc | 144 } // namespace cc |
145 | 145 |
146 #endif // CC_RENDER_PASS_H_ | 146 #endif // CC_RENDER_PASS_H_ |
OLD | NEW |