| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "cc/layers/draw_properties.h" | 27 #include "cc/layers/draw_properties.h" |
| 28 #include "cc/layers/layer_collections.h" | 28 #include "cc/layers/layer_collections.h" |
| 29 #include "cc/layers/layer_impl_test_properties.h" | 29 #include "cc/layers/layer_impl_test_properties.h" |
| 30 #include "cc/layers/layer_position_constraint.h" | 30 #include "cc/layers/layer_position_constraint.h" |
| 31 #include "cc/layers/performance_properties.h" | 31 #include "cc/layers/performance_properties.h" |
| 32 #include "cc/layers/render_surface_impl.h" | 32 #include "cc/layers/render_surface_impl.h" |
| 33 #include "cc/output/filter_operations.h" | 33 #include "cc/output/filter_operations.h" |
| 34 #include "cc/quads/shared_quad_state.h" | 34 #include "cc/quads/shared_quad_state.h" |
| 35 #include "cc/resources/resource_provider.h" | 35 #include "cc/resources/resource_provider.h" |
| 36 #include "cc/tiles/tile_priority.h" | 36 #include "cc/tiles/tile_priority.h" |
| 37 #include "cc/trees/mutator_host_client.h" |
| 37 #include "third_party/skia/include/core/SkColor.h" | 38 #include "third_party/skia/include/core/SkColor.h" |
| 38 #include "third_party/skia/include/core/SkXfermode.h" | 39 #include "third_party/skia/include/core/SkXfermode.h" |
| 39 #include "ui/gfx/geometry/point3_f.h" | 40 #include "ui/gfx/geometry/point3_f.h" |
| 40 #include "ui/gfx/geometry/rect.h" | 41 #include "ui/gfx/geometry/rect.h" |
| 41 #include "ui/gfx/geometry/rect_f.h" | 42 #include "ui/gfx/geometry/rect_f.h" |
| 42 #include "ui/gfx/geometry/scroll_offset.h" | 43 #include "ui/gfx/geometry/scroll_offset.h" |
| 43 #include "ui/gfx/transform.h" | 44 #include "ui/gfx/transform.h" |
| 44 | 45 |
| 45 namespace base { | 46 namespace base { |
| 46 namespace trace_event { | 47 namespace trace_event { |
| 47 class ConvertableToTraceFormat; | 48 class ConvertableToTraceFormat; |
| 48 class TracedValue; | 49 class TracedValue; |
| 49 } | 50 } |
| 50 class DictionaryValue; | 51 class DictionaryValue; |
| 51 } | 52 } |
| 52 | 53 |
| 53 namespace cc { | 54 namespace cc { |
| 54 | 55 |
| 56 class AnimationHost; |
| 55 class LayerTreeHostImpl; | 57 class LayerTreeHostImpl; |
| 56 class LayerTreeImpl; | 58 class LayerTreeImpl; |
| 57 class MicroBenchmarkImpl; | 59 class MicroBenchmarkImpl; |
| 58 class Occlusion; | 60 class Occlusion; |
| 59 class EffectTree; | 61 class EffectTree; |
| 60 class PrioritizedTile; | 62 class PrioritizedTile; |
| 61 class RenderPass; | 63 class RenderPass; |
| 62 class RenderPassId; | 64 class RenderPassId; |
| 63 class Renderer; | 65 class Renderer; |
| 64 class ScrollbarLayerImplBase; | 66 class ScrollbarLayerImplBase; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 bool FilterIsAnimating() const; | 197 bool FilterIsAnimating() const; |
| 196 bool HasPotentiallyRunningFilterAnimation() const; | 198 bool HasPotentiallyRunningFilterAnimation() const; |
| 197 | 199 |
| 198 void SetMasksToBounds(bool masks_to_bounds); | 200 void SetMasksToBounds(bool masks_to_bounds); |
| 199 bool masks_to_bounds() const { return masks_to_bounds_; } | 201 bool masks_to_bounds() const { return masks_to_bounds_; } |
| 200 | 202 |
| 201 void SetContentsOpaque(bool opaque); | 203 void SetContentsOpaque(bool opaque); |
| 202 bool contents_opaque() const { return contents_opaque_; } | 204 bool contents_opaque() const { return contents_opaque_; } |
| 203 | 205 |
| 204 float Opacity() const; | 206 float Opacity() const; |
| 205 bool OpacityIsAnimating() const; | |
| 206 bool HasPotentiallyRunningOpacityAnimation() const; | |
| 207 | 207 |
| 208 void SetElementId(ElementId element_id); | 208 void SetElementId(ElementId element_id); |
| 209 ElementId element_id() const { return element_id_; } | 209 ElementId element_id() const { return element_id_; } |
| 210 | 210 |
| 211 void SetMutableProperties(uint32_t properties); | 211 void SetMutableProperties(uint32_t properties); |
| 212 uint32_t mutable_properties() const { return mutable_properties_; } | 212 uint32_t mutable_properties() const { return mutable_properties_; } |
| 213 | 213 |
| 214 void SetBlendMode(SkXfermode::Mode); | 214 void SetBlendMode(SkXfermode::Mode); |
| 215 SkXfermode::Mode blend_mode() const { return blend_mode_; } | 215 SkXfermode::Mode blend_mode() const { return blend_mode_; } |
| 216 void set_draw_blend_mode(SkXfermode::Mode blend_mode) { | 216 void set_draw_blend_mode(SkXfermode::Mode blend_mode) { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 touch_event_handler_region_ = region; | 357 touch_event_handler_region_ = region; |
| 358 } | 358 } |
| 359 const Region& touch_event_handler_region() const { | 359 const Region& touch_event_handler_region() const { |
| 360 return touch_event_handler_region_; | 360 return touch_event_handler_region_; |
| 361 } | 361 } |
| 362 | 362 |
| 363 void SetTransform(const gfx::Transform& transform); | 363 void SetTransform(const gfx::Transform& transform); |
| 364 const gfx::Transform& transform() const { return transform_; } | 364 const gfx::Transform& transform() const { return transform_; } |
| 365 bool TransformIsAnimating() const; | 365 bool TransformIsAnimating() const; |
| 366 bool HasPotentiallyRunningTransformAnimation() const; | 366 bool HasPotentiallyRunningTransformAnimation() const; |
| 367 bool HasOnlyTranslationTransforms() const; | |
| 368 bool AnimationsPreserveAxisAlignment() const; | |
| 369 | |
| 370 bool MaximumTargetScale(float* max_scale) const; | |
| 371 bool AnimationStartScale(float* start_scale) const; | |
| 372 | |
| 373 // This includes all animations, even those that are finished but haven't yet | |
| 374 // been deleted. | |
| 375 bool HasAnyAnimationTargetingProperty(TargetProperty::Type property) const; | |
| 376 | 367 |
| 377 bool HasFilterAnimationThatInflatesBounds() const; | 368 bool HasFilterAnimationThatInflatesBounds() const; |
| 378 bool HasTransformAnimationThatInflatesBounds() const; | 369 bool HasTransformAnimationThatInflatesBounds() const; |
| 379 bool HasAnimationThatInflatesBounds() const; | 370 bool HasAnimationThatInflatesBounds() const; |
| 380 | 371 |
| 381 bool FilterAnimationBoundsForBox(const gfx::BoxF& box, | 372 bool FilterAnimationBoundsForBox(const gfx::BoxF& box, |
| 382 gfx::BoxF* bounds) const; | 373 gfx::BoxF* bounds) const; |
| 383 bool TransformAnimationBoundsForBox(const gfx::BoxF& box, | 374 bool TransformAnimationBoundsForBox(const gfx::BoxF& box, |
| 384 gfx::BoxF* bounds) const; | 375 gfx::BoxF* bounds) const; |
| 385 | 376 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 was_ever_ready_since_last_transform_animation_ = was_ready; | 458 was_ever_ready_since_last_transform_animation_ = was_ready; |
| 468 } | 459 } |
| 469 | 460 |
| 470 void NoteLayerPropertyChanged(); | 461 void NoteLayerPropertyChanged(); |
| 471 | 462 |
| 472 void SetHasWillChangeTransformHint(bool has_will_change); | 463 void SetHasWillChangeTransformHint(bool has_will_change); |
| 473 bool has_will_change_transform_hint() const { | 464 bool has_will_change_transform_hint() const { |
| 474 return has_will_change_transform_hint_; | 465 return has_will_change_transform_hint_; |
| 475 } | 466 } |
| 476 | 467 |
| 468 AnimationHost* GetAnimationHost() const; |
| 469 |
| 470 ElementListType GetElementTypeForAnimation() const; |
| 471 |
| 477 protected: | 472 protected: |
| 478 LayerImpl(LayerTreeImpl* layer_impl, | 473 LayerImpl(LayerTreeImpl* layer_impl, |
| 479 int id, | 474 int id, |
| 480 scoped_refptr<SyncedScrollOffset> scroll_offset); | 475 scoped_refptr<SyncedScrollOffset> scroll_offset); |
| 481 LayerImpl(LayerTreeImpl* layer_impl, int id); | 476 LayerImpl(LayerTreeImpl* layer_impl, int id); |
| 482 | 477 |
| 483 // Get the color and size of the layer's debug border. | 478 // Get the color and size of the layer's debug border. |
| 484 virtual void GetDebugBorderProperties(SkColor* color, float* width) const; | 479 virtual void GetDebugBorderProperties(SkColor* color, float* width) const; |
| 485 | 480 |
| 486 void AppendDebugBorderQuad(RenderPass* render_pass, | 481 void AppendDebugBorderQuad(RenderPass* render_pass, |
| 487 const gfx::Size& bounds, | 482 const gfx::Size& bounds, |
| 488 const SharedQuadState* shared_quad_state, | 483 const SharedQuadState* shared_quad_state, |
| 489 AppendQuadsData* append_quads_data) const; | 484 AppendQuadsData* append_quads_data) const; |
| 490 void AppendDebugBorderQuad(RenderPass* render_pass, | 485 void AppendDebugBorderQuad(RenderPass* render_pass, |
| 491 const gfx::Size& bounds, | 486 const gfx::Size& bounds, |
| 492 const SharedQuadState* shared_quad_state, | 487 const SharedQuadState* shared_quad_state, |
| 493 AppendQuadsData* append_quads_data, | 488 AppendQuadsData* append_quads_data, |
| 494 SkColor color, | 489 SkColor color, |
| 495 float width) const; | 490 float width) const; |
| 496 | 491 |
| 497 gfx::Rect GetScaledEnclosingRectInTargetSpace(float scale) const; | 492 gfx::Rect GetScaledEnclosingRectInTargetSpace(float scale) const; |
| 498 | 493 |
| 499 private: | 494 private: |
| 495 bool HasOnlyTranslationTransforms() const; |
| 496 |
| 497 // This includes all animations, even those that are finished but haven't yet |
| 498 // been deleted. |
| 499 bool HasAnyAnimationTargetingProperty(TargetProperty::Type property) const; |
| 500 |
| 500 void ValidateQuadResourcesInternal(DrawQuad* quad) const; | 501 void ValidateQuadResourcesInternal(DrawQuad* quad) const; |
| 501 | 502 |
| 502 virtual const char* LayerTypeAsString() const; | 503 virtual const char* LayerTypeAsString() const; |
| 503 | 504 |
| 504 int layer_id_; | 505 int layer_id_; |
| 505 LayerTreeImpl* layer_tree_impl_; | 506 LayerTreeImpl* layer_tree_impl_; |
| 506 | 507 |
| 507 std::unique_ptr<LayerImplTestProperties> test_properties_; | 508 std::unique_ptr<LayerImplTestProperties> test_properties_; |
| 508 | 509 |
| 509 gfx::Vector2dF bounds_delta_; | 510 gfx::Vector2dF bounds_delta_; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 bool scrolls_drawn_descendant_ : 1; | 590 bool scrolls_drawn_descendant_ : 1; |
| 590 bool has_will_change_transform_hint_ : 1; | 591 bool has_will_change_transform_hint_ : 1; |
| 591 bool needs_push_properties_ : 1; | 592 bool needs_push_properties_ : 1; |
| 592 | 593 |
| 593 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 594 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 594 }; | 595 }; |
| 595 | 596 |
| 596 } // namespace cc | 597 } // namespace cc |
| 597 | 598 |
| 598 #endif // CC_LAYERS_LAYER_IMPL_H_ | 599 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |