| 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_LAYERS_RENDER_SURFACE_IMPL_H_ | 5 #ifndef CC_LAYERS_RENDER_SURFACE_IMPL_H_ |
| 6 #define CC_LAYERS_RENDER_SURFACE_IMPL_H_ | 6 #define CC_LAYERS_RENDER_SURFACE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "cc/base/cc_export.h" | 15 #include "cc/base/cc_export.h" |
| 16 #include "cc/layers/layer_collections.h" | 16 #include "cc/layers/layer_collections.h" |
| 17 #include "cc/quads/render_pass.h" | 17 #include "cc/quads/render_pass.h" |
| 18 #include "cc/quads/shared_quad_state.h" | 18 #include "cc/quads/shared_quad_state.h" |
| 19 #include "cc/trees/occlusion.h" | 19 #include "cc/trees/occlusion.h" |
| 20 #include "cc/trees/property_tree.h" |
| 20 #include "ui/gfx/geometry/rect.h" | 21 #include "ui/gfx/geometry/rect.h" |
| 21 #include "ui/gfx/geometry/rect_f.h" | 22 #include "ui/gfx/geometry/rect_f.h" |
| 22 #include "ui/gfx/transform.h" | 23 #include "ui/gfx/transform.h" |
| 23 | 24 |
| 24 namespace cc { | 25 namespace cc { |
| 25 | 26 |
| 26 class DamageTracker; | 27 class DamageTracker; |
| 27 class Occlusion; | 28 class Occlusion; |
| 28 class RenderPassId; | 29 class RenderPassId; |
| 29 class RenderPassSink; | 30 class RenderPassSink; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 void set_occlusion_in_content_space(const Occlusion& occlusion) { | 135 void set_occlusion_in_content_space(const Occlusion& occlusion) { |
| 135 occlusion_in_content_space_ = occlusion; | 136 occlusion_in_content_space_ = occlusion; |
| 136 } | 137 } |
| 137 | 138 |
| 138 LayerImplList& layer_list() { return layer_list_; } | 139 LayerImplList& layer_list() { return layer_list_; } |
| 139 void ClearLayerLists(); | 140 void ClearLayerLists(); |
| 140 | 141 |
| 141 int OwningLayerId() const; | 142 int OwningLayerId() const; |
| 142 bool HasReplica() const; | 143 bool HasReplica() const; |
| 143 const LayerImpl* ReplicaLayer() const; | 144 const LayerImpl* ReplicaLayer() const; |
| 145 LayerImpl* ReplicaLayer(); |
| 146 |
| 147 LayerImpl* MaskLayer(); |
| 148 bool HasMask() const; |
| 149 |
| 150 LayerImpl* ReplicaMaskLayer(); |
| 151 bool HasReplicaMask() const; |
| 144 | 152 |
| 145 bool HasCopyRequest() const; | 153 bool HasCopyRequest() const; |
| 146 | 154 |
| 147 void ResetPropertyChangedFlag() { surface_property_changed_ = false; } | 155 void ResetPropertyChangedFlag() { surface_property_changed_ = false; } |
| 148 bool SurfacePropertyChanged() const; | 156 bool SurfacePropertyChanged() const; |
| 149 bool SurfacePropertyChangedOnlyFromDescendant() const; | 157 bool SurfacePropertyChangedOnlyFromDescendant() const; |
| 150 | 158 |
| 151 DamageTracker* damage_tracker() const { return damage_tracker_.get(); } | 159 DamageTracker* damage_tracker() const { return damage_tracker_.get(); } |
| 152 | 160 |
| 153 RenderPassId GetRenderPassId(); | 161 RenderPassId GetRenderPassId(); |
| 154 | 162 |
| 155 void AppendRenderPasses(RenderPassSink* pass_sink); | 163 void AppendRenderPasses(RenderPassSink* pass_sink); |
| 156 void AppendQuads(RenderPass* render_pass, | 164 void AppendQuads(RenderPass* render_pass, |
| 157 const gfx::Transform& draw_transform, | 165 const gfx::Transform& draw_transform, |
| 158 const Occlusion& occlusion_in_content_space, | 166 const Occlusion& occlusion_in_content_space, |
| 159 SkColor debug_border_color, | 167 SkColor debug_border_color, |
| 160 float debug_border_width, | 168 float debug_border_width, |
| 161 LayerImpl* mask_layer, | 169 LayerImpl* mask_layer, |
| 162 AppendQuadsData* append_quads_data, | 170 AppendQuadsData* append_quads_data, |
| 163 RenderPassId render_pass_id); | 171 RenderPassId render_pass_id); |
| 164 | 172 |
| 165 int TransformTreeIndex() const; | 173 int TransformTreeIndex() const; |
| 166 int ClipTreeIndex() const; | 174 int ClipTreeIndex() const; |
| 167 int EffectTreeIndex() const; | 175 int EffectTreeIndex() const; |
| 168 | 176 |
| 169 private: | 177 private: |
| 170 void SetContentRect(const gfx::Rect& content_rect); | 178 void SetContentRect(const gfx::Rect& content_rect); |
| 171 gfx::Rect CalculateClippedAccumulatedContentRect(); | 179 gfx::Rect CalculateClippedAccumulatedContentRect(); |
| 172 | 180 |
| 181 const EffectNode* OwningEffectNode() const; |
| 182 |
| 173 LayerImpl* owning_layer_; | 183 LayerImpl* owning_layer_; |
| 174 | 184 |
| 175 // Container for properties that render surfaces need to compute before they | 185 // Container for properties that render surfaces need to compute before they |
| 176 // can be drawn. | 186 // can be drawn. |
| 177 struct DrawProperties { | 187 struct DrawProperties { |
| 178 DrawProperties(); | 188 DrawProperties(); |
| 179 ~DrawProperties(); | 189 ~DrawProperties(); |
| 180 | 190 |
| 181 float draw_opacity; | 191 float draw_opacity; |
| 182 | 192 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 int target_render_surface_layer_index_history_; | 232 int target_render_surface_layer_index_history_; |
| 223 size_t current_layer_index_history_; | 233 size_t current_layer_index_history_; |
| 224 | 234 |
| 225 friend class LayerIterator; | 235 friend class LayerIterator; |
| 226 | 236 |
| 227 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl); | 237 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl); |
| 228 }; | 238 }; |
| 229 | 239 |
| 230 } // namespace cc | 240 } // namespace cc |
| 231 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_ | 241 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_ |
| OLD | NEW |