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_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 bool is_clipped() const { return draw_properties_.is_clipped; } | 196 bool is_clipped() const { return draw_properties_.is_clipped; } |
197 | 197 |
198 void UpdatePropertyTreeTransform(); | 198 void UpdatePropertyTreeTransform(); |
199 void UpdatePropertyTreeTransformIsAnimated(bool is_animated); | 199 void UpdatePropertyTreeTransformIsAnimated(bool is_animated); |
200 void UpdatePropertyTreeOpacity(); | 200 void UpdatePropertyTreeOpacity(); |
201 void UpdatePropertyTreeScrollOffset(); | 201 void UpdatePropertyTreeScrollOffset(); |
202 | 202 |
203 // For compatibility with Layer. | 203 // For compatibility with Layer. |
204 bool has_render_surface() const { return !!render_surface(); } | 204 bool has_render_surface() const { return !!render_surface(); } |
205 | 205 bool force_render_surface() const { return force_render_surface_; } |
206 void SetNumDescendantsThatDrawContent(int num_descendants); | 206 void SetNumDescendantsThatDrawContent(int num_descendants); |
207 void SetClipParent(LayerImpl* ancestor); | 207 void SetClipParent(LayerImpl* ancestor); |
208 | 208 |
209 LayerImpl* clip_parent() { | 209 LayerImpl* clip_parent() { |
210 return clip_parent_; | 210 return clip_parent_; |
211 } | 211 } |
212 const LayerImpl* clip_parent() const { | 212 const LayerImpl* clip_parent() const { |
213 return clip_parent_; | 213 return clip_parent_; |
214 } | 214 } |
215 | 215 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 } | 379 } |
380 | 380 |
381 bool ShowDebugBorders() const; | 381 bool ShowDebugBorders() const; |
382 | 382 |
383 // These invalidate the host's render surface layer list. The caller | 383 // These invalidate the host's render surface layer list. The caller |
384 // is responsible for calling set_needs_update_draw_properties on the tree | 384 // is responsible for calling set_needs_update_draw_properties on the tree |
385 // so that its list can be recreated. | 385 // so that its list can be recreated. |
386 void ClearRenderSurfaceLayerList(); | 386 void ClearRenderSurfaceLayerList(); |
387 void SetHasRenderSurface(bool has_render_surface); | 387 void SetHasRenderSurface(bool has_render_surface); |
388 | 388 |
| 389 void SetForceRenderSurface(bool has_render_surface); |
| 390 |
389 RenderSurfaceImpl* render_surface() const { return render_surface_.get(); } | 391 RenderSurfaceImpl* render_surface() const { return render_surface_.get(); } |
390 | 392 |
391 DrawProperties& draw_properties() { return draw_properties_; } | 393 DrawProperties& draw_properties() { return draw_properties_; } |
392 const DrawProperties& draw_properties() const { return draw_properties_; } | 394 const DrawProperties& draw_properties() const { return draw_properties_; } |
393 | 395 |
394 gfx::Transform DrawTransform() const; | 396 gfx::Transform DrawTransform() const; |
395 gfx::Transform ScreenSpaceTransform() const; | 397 gfx::Transform ScreenSpaceTransform() const; |
396 | 398 |
397 // The following are shortcut accessors to get various information from | 399 // The following are shortcut accessors to get various information from |
398 // draw_properties_ | 400 // draw_properties_ |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 529 |
528 void SetDoubleSided(bool double_sided); | 530 void SetDoubleSided(bool double_sided); |
529 bool double_sided() const { return double_sided_; } | 531 bool double_sided() const { return double_sided_; } |
530 | 532 |
531 void SetTransform(const gfx::Transform& transform); | 533 void SetTransform(const gfx::Transform& transform); |
532 const gfx::Transform& transform() const { return transform_; } | 534 const gfx::Transform& transform() const { return transform_; } |
533 bool TransformIsAnimating() const; | 535 bool TransformIsAnimating() const; |
534 bool HasPotentiallyRunningTransformAnimation() const; | 536 bool HasPotentiallyRunningTransformAnimation() const; |
535 bool TransformIsAnimatingOnImplOnly() const; | 537 bool TransformIsAnimatingOnImplOnly() const; |
536 bool HasOnlyTranslationTransforms() const; | 538 bool HasOnlyTranslationTransforms() const; |
| 539 bool AnimationsPreserveAxisAlignment() const; |
537 void SetTransformAndInvertibility(const gfx::Transform& transform, | 540 void SetTransformAndInvertibility(const gfx::Transform& transform, |
538 bool transform_is_invertible); | 541 bool transform_is_invertible); |
539 bool transform_is_invertible() const { return transform_is_invertible_; } | 542 bool transform_is_invertible() const { return transform_is_invertible_; } |
540 | 543 |
541 bool MaximumTargetScale(float* max_scale) const; | 544 bool MaximumTargetScale(float* max_scale) const; |
542 bool AnimationStartScale(float* start_scale) const; | 545 bool AnimationStartScale(float* start_scale) const; |
543 | 546 |
544 // This includes all animations, even those that are finished but haven't yet | 547 // This includes all animations, even those that are finished but haven't yet |
545 // been deleted. | 548 // been deleted. |
546 bool HasAnyAnimationTargetingProperty( | 549 bool HasAnyAnimationTargetingProperty( |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 | 869 |
867 std::vector<scoped_ptr<CopyOutputRequest>> copy_requests_; | 870 std::vector<scoped_ptr<CopyOutputRequest>> copy_requests_; |
868 | 871 |
869 // Group of properties that need to be computed based on the layer tree | 872 // Group of properties that need to be computed based on the layer tree |
870 // hierarchy before layers can be drawn. | 873 // hierarchy before layers can be drawn. |
871 DrawProperties draw_properties_; | 874 DrawProperties draw_properties_; |
872 | 875 |
873 scoped_refptr<base::trace_event::ConvertableToTraceFormat> debug_info_; | 876 scoped_refptr<base::trace_event::ConvertableToTraceFormat> debug_info_; |
874 scoped_ptr<RenderSurfaceImpl> render_surface_; | 877 scoped_ptr<RenderSurfaceImpl> render_surface_; |
875 | 878 |
| 879 bool force_render_surface_; |
| 880 |
876 std::vector<FrameTimingRequest> frame_timing_requests_; | 881 std::vector<FrameTimingRequest> frame_timing_requests_; |
877 int num_layer_or_descendants_with_copy_request_; | 882 int num_layer_or_descendants_with_copy_request_; |
878 bool frame_timing_requests_dirty_; | 883 bool frame_timing_requests_dirty_; |
879 bool visited_; | 884 bool visited_; |
880 bool layer_or_descendant_is_drawn_; | 885 bool layer_or_descendant_is_drawn_; |
881 // If true, the layer or one of its descendants has a wheel or touch handler. | 886 // If true, the layer or one of its descendants has a wheel or touch handler. |
882 bool layer_or_descendant_has_input_handler_; | 887 bool layer_or_descendant_has_input_handler_; |
883 bool sorted_for_recursion_; | 888 bool sorted_for_recursion_; |
884 | 889 |
885 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 890 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
886 }; | 891 }; |
887 | 892 |
888 } // namespace cc | 893 } // namespace cc |
889 | 894 |
890 #endif // CC_LAYERS_LAYER_IMPL_H_ | 895 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |