| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/values.h" | 14 #include "base/values.h" |
| 14 #include "cc/animation/animation_delegate.h" | 15 #include "cc/animation/animation_delegate.h" |
| 15 #include "cc/animation/layer_animation_controller.h" | 16 #include "cc/animation/layer_animation_controller.h" |
| 16 #include "cc/animation/layer_animation_value_observer.h" | 17 #include "cc/animation/layer_animation_value_observer.h" |
| 17 #include "cc/animation/layer_animation_value_provider.h" | 18 #include "cc/animation/layer_animation_value_provider.h" |
| 18 #include "cc/base/cc_export.h" | 19 #include "cc/base/cc_export.h" |
| 19 #include "cc/base/region.h" | 20 #include "cc/base/region.h" |
| 20 #include "cc/base/scoped_ptr_vector.h" | 21 #include "cc/base/scoped_ptr_vector.h" |
| 22 #include "cc/debug/layer_debug_info.h" |
| 21 #include "cc/input/input_handler.h" | 23 #include "cc/input/input_handler.h" |
| 22 #include "cc/layers/draw_properties.h" | 24 #include "cc/layers/draw_properties.h" |
| 25 #include "cc/layers/layer_client.h" |
| 23 #include "cc/layers/layer_lists.h" | 26 #include "cc/layers/layer_lists.h" |
| 24 #include "cc/layers/layer_position_constraint.h" | 27 #include "cc/layers/layer_position_constraint.h" |
| 25 #include "cc/layers/render_surface_impl.h" | 28 #include "cc/layers/render_surface_impl.h" |
| 26 #include "cc/output/filter_operations.h" | 29 #include "cc/output/filter_operations.h" |
| 27 #include "cc/quads/shared_quad_state.h" | 30 #include "cc/quads/shared_quad_state.h" |
| 28 #include "cc/resources/resource_provider.h" | 31 #include "cc/resources/resource_provider.h" |
| 29 #include "skia/ext/refptr.h" | 32 #include "skia/ext/refptr.h" |
| 30 #include "third_party/skia/include/core/SkColor.h" | 33 #include "third_party/skia/include/core/SkColor.h" |
| 31 #include "third_party/skia/include/core/SkImageFilter.h" | 34 #include "third_party/skia/include/core/SkImageFilter.h" |
| 32 #include "third_party/skia/include/core/SkPicture.h" | 35 #include "third_party/skia/include/core/SkPicture.h" |
| 33 #include "ui/gfx/point3_f.h" | 36 #include "ui/gfx/point3_f.h" |
| 34 #include "ui/gfx/rect.h" | 37 #include "ui/gfx/rect.h" |
| 35 #include "ui/gfx/rect_f.h" | 38 #include "ui/gfx/rect_f.h" |
| 36 #include "ui/gfx/transform.h" | 39 #include "ui/gfx/transform.h" |
| 37 | 40 |
| 38 namespace base { | 41 namespace base { |
| 39 namespace debug { | 42 namespace debug { |
| 40 class ConvertableToTraceFormat; | 43 class ConvertableToTraceFormat; |
| 41 class TracedValue; | 44 class TracedValue; |
| 42 } | 45 } |
| 43 | 46 |
| 44 class DictionaryValue; | 47 class DictionaryValue; |
| 45 } | 48 } |
| 46 | 49 |
| 47 namespace cc { | 50 namespace cc { |
| 48 | 51 |
| 52 struct DebugRect; |
| 49 class LayerTreeHostImpl; | 53 class LayerTreeHostImpl; |
| 50 class LayerTreeImpl; | 54 class LayerTreeImpl; |
| 51 class MicroBenchmarkImpl; | 55 class MicroBenchmarkImpl; |
| 52 class Occlusion; | 56 class Occlusion; |
| 53 template <typename LayerType> | 57 template <typename LayerType> |
| 54 class OcclusionTracker; | 58 class OcclusionTracker; |
| 55 class RenderPass; | 59 class RenderPass; |
| 56 class RenderPassId; | 60 class RenderPassId; |
| 57 class Renderer; | 61 class Renderer; |
| 58 class ScrollbarAnimationController; | 62 class ScrollbarAnimationController; |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 const gfx::Transform& transform() const { return transform_; } | 466 const gfx::Transform& transform() const { return transform_; } |
| 463 bool TransformIsAnimating() const; | 467 bool TransformIsAnimating() const; |
| 464 bool TransformIsAnimatingOnImplOnly() const; | 468 bool TransformIsAnimatingOnImplOnly() const; |
| 465 void SetTransformAndInvertibility(const gfx::Transform& transform, | 469 void SetTransformAndInvertibility(const gfx::Transform& transform, |
| 466 bool transform_is_invertible); | 470 bool transform_is_invertible); |
| 467 bool transform_is_invertible() const { return transform_is_invertible_; } | 471 bool transform_is_invertible() const { return transform_is_invertible_; } |
| 468 | 472 |
| 469 // Note this rect is in layer space (not content space). | 473 // Note this rect is in layer space (not content space). |
| 470 void SetUpdateRect(const gfx::RectF& update_rect); | 474 void SetUpdateRect(const gfx::RectF& update_rect); |
| 471 | 475 |
| 476 virtual bool GetDetailedPaintRects(std::vector<DebugRect>*); |
| 477 |
| 472 const gfx::RectF& update_rect() const { return update_rect_; } | 478 const gfx::RectF& update_rect() const { return update_rect_; } |
| 473 | 479 |
| 474 void AddDamageRect(const gfx::RectF& damage_rect); | 480 void AddDamageRect(const gfx::RectF& damage_rect); |
| 475 | 481 |
| 476 const gfx::RectF& damage_rect() const { return damage_rect_; } | 482 const gfx::RectF& damage_rect() const { return damage_rect_; } |
| 477 | 483 |
| 478 virtual base::DictionaryValue* LayerTreeAsJson() const; | 484 virtual base::DictionaryValue* LayerTreeAsJson() const; |
| 479 | 485 |
| 480 void SetStackingOrderChanged(bool stacking_order_changed); | 486 void SetStackingOrderChanged(bool stacking_order_changed); |
| 481 | 487 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 return needs_push_properties() || descendant_needs_push_properties(); | 541 return needs_push_properties() || descendant_needs_push_properties(); |
| 536 } | 542 } |
| 537 | 543 |
| 538 bool needs_push_properties() const { return needs_push_properties_; } | 544 bool needs_push_properties() const { return needs_push_properties_; } |
| 539 bool descendant_needs_push_properties() const { | 545 bool descendant_needs_push_properties() const { |
| 540 return num_dependents_need_push_properties_ > 0; | 546 return num_dependents_need_push_properties_ > 0; |
| 541 } | 547 } |
| 542 | 548 |
| 543 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark); | 549 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark); |
| 544 | 550 |
| 545 virtual void SetDebugInfo( | 551 virtual void SetDebugInfo(scoped_refptr<LayerDebugInfo> other); |
| 546 scoped_refptr<base::debug::ConvertableToTraceFormat> other); | 552 scoped_refptr<LayerDebugInfo> debug_info() const { return debug_info_; } |
| 547 | 553 |
| 548 bool IsDrawnRenderSurfaceLayerListMember() const; | 554 bool IsDrawnRenderSurfaceLayerListMember() const; |
| 549 | 555 |
| 550 void Set3dSortingContextId(int id); | 556 void Set3dSortingContextId(int id); |
| 551 int sorting_context_id() { return sorting_context_id_; } | 557 int sorting_context_id() { return sorting_context_id_; } |
| 552 | 558 |
| 553 protected: | 559 protected: |
| 554 LayerImpl(LayerTreeImpl* layer_impl, int id); | 560 LayerImpl(LayerTreeImpl* layer_impl, int id); |
| 555 | 561 |
| 556 // Get the color and size of the layer's debug border. | 562 // Get the color and size of the layer's debug border. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 bool draw_checkerboard_for_missing_tiles_ : 1; | 636 bool draw_checkerboard_for_missing_tiles_ : 1; |
| 631 bool draws_content_ : 1; | 637 bool draws_content_ : 1; |
| 632 bool hide_layer_and_subtree_ : 1; | 638 bool hide_layer_and_subtree_ : 1; |
| 633 bool force_render_surface_ : 1; | 639 bool force_render_surface_ : 1; |
| 634 | 640 |
| 635 // Cache transform_'s invertibility. | 641 // Cache transform_'s invertibility. |
| 636 bool transform_is_invertible_ : 1; | 642 bool transform_is_invertible_ : 1; |
| 637 | 643 |
| 638 // Set for the layer that other layers are fixed to. | 644 // Set for the layer that other layers are fixed to. |
| 639 bool is_container_for_fixed_position_layers_ : 1; | 645 bool is_container_for_fixed_position_layers_ : 1; |
| 646 |
| 640 Region non_fast_scrollable_region_; | 647 Region non_fast_scrollable_region_; |
| 641 Region touch_event_handler_region_; | 648 Region touch_event_handler_region_; |
| 642 SkColor background_color_; | 649 SkColor background_color_; |
| 643 | 650 |
| 644 float opacity_; | 651 float opacity_; |
| 645 SkXfermode::Mode blend_mode_; | 652 SkXfermode::Mode blend_mode_; |
| 646 gfx::PointF position_; | 653 gfx::PointF position_; |
| 647 gfx::Transform transform_; | 654 gfx::Transform transform_; |
| 648 | 655 |
| 649 LayerPositionConstraint position_constraint_; | 656 LayerPositionConstraint position_constraint_; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 scoped_ptr<ScrollbarAnimationController> scrollbar_animation_controller_; | 703 scoped_ptr<ScrollbarAnimationController> scrollbar_animation_controller_; |
| 697 | 704 |
| 698 scoped_ptr<ScrollbarSet> scrollbars_; | 705 scoped_ptr<ScrollbarSet> scrollbars_; |
| 699 | 706 |
| 700 ScopedPtrVector<CopyOutputRequest> copy_requests_; | 707 ScopedPtrVector<CopyOutputRequest> copy_requests_; |
| 701 | 708 |
| 702 // Group of properties that need to be computed based on the layer tree | 709 // Group of properties that need to be computed based on the layer tree |
| 703 // hierarchy before layers can be drawn. | 710 // hierarchy before layers can be drawn. |
| 704 DrawProperties<LayerImpl> draw_properties_; | 711 DrawProperties<LayerImpl> draw_properties_; |
| 705 | 712 |
| 706 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 713 scoped_refptr<LayerDebugInfo> debug_info_; |
| 707 | 714 |
| 708 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 715 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 709 }; | 716 }; |
| 710 | 717 |
| 711 } // namespace cc | 718 } // namespace cc |
| 712 | 719 |
| 713 #endif // CC_LAYERS_LAYER_IMPL_H_ | 720 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |