| 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_H_ | 5 #ifndef CC_QUADS_RENDER_PASS_H_ |
| 6 #define CC_QUADS_RENDER_PASS_H_ | 6 #define CC_QUADS_RENDER_PASS_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 ScopedPtrVector<RenderPass>* out); | 67 ScopedPtrVector<RenderPass>* out); |
| 68 | 68 |
| 69 void SetNew(RenderPassId id, | 69 void SetNew(RenderPassId id, |
| 70 const gfx::Rect& output_rect, | 70 const gfx::Rect& output_rect, |
| 71 const gfx::Rect& damage_rect, | 71 const gfx::Rect& damage_rect, |
| 72 const gfx::Transform& transform_to_root_target); | 72 const gfx::Transform& transform_to_root_target); |
| 73 | 73 |
| 74 void SetAll(RenderPassId id, | 74 void SetAll(RenderPassId id, |
| 75 const gfx::Rect& output_rect, | 75 const gfx::Rect& output_rect, |
| 76 const gfx::Rect& damage_rect, | 76 const gfx::Rect& damage_rect, |
| 77 const gfx::Rect& overlay_rect, |
| 77 const gfx::Transform& transform_to_root_target, | 78 const gfx::Transform& transform_to_root_target, |
| 78 bool has_transparent_background); | 79 bool has_transparent_background); |
| 79 | 80 |
| 80 void AsValueInto(base::trace_event::TracedValue* dict) const; | 81 void AsValueInto(base::trace_event::TracedValue* dict) const; |
| 81 | 82 |
| 82 SharedQuadState* CreateAndAppendSharedQuadState(); | 83 SharedQuadState* CreateAndAppendSharedQuadState(); |
| 83 | 84 |
| 84 template <typename DrawQuadType> | 85 template <typename DrawQuadType> |
| 85 DrawQuadType* CreateAndAppendDrawQuad() { | 86 DrawQuadType* CreateAndAppendDrawQuad() { |
| 86 return quad_list.AllocateAndConstruct<DrawQuadType>(); | 87 return quad_list.AllocateAndConstruct<DrawQuadType>(); |
| 87 } | 88 } |
| 88 | 89 |
| 89 RenderPassDrawQuad* CopyFromAndAppendRenderPassDrawQuad( | 90 RenderPassDrawQuad* CopyFromAndAppendRenderPassDrawQuad( |
| 90 const RenderPassDrawQuad* quad, | 91 const RenderPassDrawQuad* quad, |
| 91 const SharedQuadState* shared_quad_state, | 92 const SharedQuadState* shared_quad_state, |
| 92 RenderPassId render_pass_id); | 93 RenderPassId render_pass_id); |
| 93 DrawQuad* CopyFromAndAppendDrawQuad(const DrawQuad* quad, | 94 DrawQuad* CopyFromAndAppendDrawQuad(const DrawQuad* quad, |
| 94 const SharedQuadState* shared_quad_state); | 95 const SharedQuadState* shared_quad_state); |
| 95 | 96 |
| 97 // Recalculates |overlay_damage|, call this when overlay quads are removed |
| 98 // from the list. |
| 99 void RecalculateOverlayDamage(); |
| 100 |
| 101 // Unions |overlay_rect| into |damage_rect|. |
| 102 void UnionOverlayDamage(); |
| 103 |
| 104 gfx::Rect GetFullDamageRect(); |
| 105 |
| 96 // Uniquely identifies the render pass in the compositor's current frame. | 106 // Uniquely identifies the render pass in the compositor's current frame. |
| 97 RenderPassId id; | 107 RenderPassId id; |
| 98 | 108 |
| 99 // These are in the space of the render pass' physical pixels. | 109 // These are in the space of the render pass' physical pixels. |
| 100 gfx::Rect output_rect; | 110 gfx::Rect output_rect; |
| 101 gfx::Rect damage_rect; | 111 gfx::Rect damage_rect; |
| 112 gfx::Rect overlay_rect; |
| 102 | 113 |
| 103 // Transforms from the origin of the |output_rect| to the origin of the root | 114 // Transforms from the origin of the |output_rect| to the origin of the root |
| 104 // render pass' |output_rect|. | 115 // render pass' |output_rect|. |
| 105 gfx::Transform transform_to_root_target; | 116 gfx::Transform transform_to_root_target; |
| 106 | 117 |
| 107 // If false, the pixels in the render pass' texture are all opaque. | 118 // If false, the pixels in the render pass' texture are all opaque. |
| 108 bool has_transparent_background; | 119 bool has_transparent_background; |
| 109 | 120 |
| 110 // If non-empty, the renderer should produce a copy of the render pass' | 121 // If non-empty, the renderer should produce a copy of the render pass' |
| 111 // contents as a bitmap, and give a copy of the bitmap to each callback in | 122 // contents as a bitmap, and give a copy of the bitmap to each callback in |
| (...skipping 28 matching lines...) Expand all Loading... |
| 140 } | 151 } |
| 141 }; | 152 }; |
| 142 } // namespace BASE_HASH_NAMESPACE | 153 } // namespace BASE_HASH_NAMESPACE |
| 143 | 154 |
| 144 namespace cc { | 155 namespace cc { |
| 145 typedef ScopedPtrVector<RenderPass> RenderPassList; | 156 typedef ScopedPtrVector<RenderPass> RenderPassList; |
| 146 typedef base::hash_map<RenderPassId, RenderPass*> RenderPassIdHashMap; | 157 typedef base::hash_map<RenderPassId, RenderPass*> RenderPassIdHashMap; |
| 147 } // namespace cc | 158 } // namespace cc |
| 148 | 159 |
| 149 #endif // CC_QUADS_RENDER_PASS_H_ | 160 #endif // CC_QUADS_RENDER_PASS_H_ |
| OLD | NEW |