| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "cc/animation/layer_animation_controller.h" | 13 #include "cc/animation/layer_animation_controller.h" |
| 14 #include "cc/animation/layer_animation_value_observer.h" | 14 #include "cc/animation/layer_animation_value_observer.h" |
| 15 #include "cc/base/cc_export.h" | 15 #include "cc/base/cc_export.h" |
| 16 #include "cc/base/region.h" | 16 #include "cc/base/region.h" |
| 17 #include "cc/base/scoped_ptr_vector.h" | 17 #include "cc/base/scoped_ptr_vector.h" |
| 18 #include "cc/input/input_handler.h" | 18 #include "cc/input/input_handler.h" |
| 19 #include "cc/layers/draw_properties.h" | 19 #include "cc/layers/draw_properties.h" |
| 20 #include "cc/layers/layer_lists.h" | 20 #include "cc/layers/layer_lists.h" |
| 21 #include "cc/layers/layer_position_constraint.h" |
| 21 #include "cc/layers/render_surface_impl.h" | 22 #include "cc/layers/render_surface_impl.h" |
| 22 #include "cc/quads/render_pass.h" | 23 #include "cc/quads/render_pass.h" |
| 23 #include "cc/quads/shared_quad_state.h" | 24 #include "cc/quads/shared_quad_state.h" |
| 24 #include "cc/resources/resource_provider.h" | 25 #include "cc/resources/resource_provider.h" |
| 25 #include "skia/ext/refptr.h" | 26 #include "skia/ext/refptr.h" |
| 26 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations
.h" | 27 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations
.h" |
| 27 #include "third_party/skia/include/core/SkColor.h" | 28 #include "third_party/skia/include/core/SkColor.h" |
| 28 #include "third_party/skia/include/core/SkImageFilter.h" | 29 #include "third_party/skia/include/core/SkImageFilter.h" |
| 29 #include "third_party/skia/include/core/SkPicture.h" | 30 #include "third_party/skia/include/core/SkPicture.h" |
| 30 #include "ui/gfx/rect.h" | 31 #include "ui/gfx/rect.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 float opacity() const { return opacity_; } | 151 float opacity() const { return opacity_; } |
| 151 bool OpacityIsAnimating() const; | 152 bool OpacityIsAnimating() const; |
| 152 bool OpacityIsAnimatingOnImplOnly() const; | 153 bool OpacityIsAnimatingOnImplOnly() const; |
| 153 | 154 |
| 154 void SetPosition(gfx::PointF position); | 155 void SetPosition(gfx::PointF position); |
| 155 gfx::PointF position() const { return position_; } | 156 gfx::PointF position() const { return position_; } |
| 156 | 157 |
| 157 void SetIsContainerForFixedPositionLayers(bool container) { | 158 void SetIsContainerForFixedPositionLayers(bool container) { |
| 158 is_container_for_fixed_position_layers_ = container; | 159 is_container_for_fixed_position_layers_ = container; |
| 159 } | 160 } |
| 160 bool is_container_for_fixed_position_layers() const { | 161 // This is a non-trivial function in Layer. |
| 162 bool IsContainerForFixedPositionLayers() const { |
| 161 return is_container_for_fixed_position_layers_; | 163 return is_container_for_fixed_position_layers_; |
| 162 } | 164 } |
| 163 | 165 |
| 164 void SetFixedToContainerLayer(bool fixed) { | 166 void SetFixedContainerSizeDelta(const gfx::Vector2dF& delta) { |
| 165 fixed_to_container_layer_ = fixed; | 167 fixed_container_size_delta_ = delta; |
| 166 } | 168 } |
| 167 bool fixed_to_container_layer() const { return fixed_to_container_layer_; } | 169 const gfx::Vector2dF& fixed_container_size_delta() const { |
| 170 return fixed_container_size_delta_; |
| 171 } |
| 172 |
| 173 void SetPositionConstraint(const LayerPositionConstraint& constraint) { |
| 174 position_constraint_ = constraint; |
| 175 } |
| 176 const LayerPositionConstraint& position_constraint() const { |
| 177 return position_constraint_; |
| 178 } |
| 168 | 179 |
| 169 void SetPreserves3d(bool preserves_3d); | 180 void SetPreserves3d(bool preserves_3d); |
| 170 bool preserves_3d() const { return preserves_3d_; } | 181 bool preserves_3d() const { return preserves_3d_; } |
| 171 | 182 |
| 172 void SetUseParentBackfaceVisibility(bool use) { | 183 void SetUseParentBackfaceVisibility(bool use) { |
| 173 use_parent_backface_visibility_ = use; | 184 use_parent_backface_visibility_ = use; |
| 174 } | 185 } |
| 175 bool use_parent_backface_visibility() const { | 186 bool use_parent_backface_visibility() const { |
| 176 return use_parent_backface_visibility_; | 187 return use_parent_backface_visibility_; |
| 177 } | 188 } |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 bool use_parent_backface_visibility_; | 479 bool use_parent_backface_visibility_; |
| 469 bool draw_checkerboard_for_missing_tiles_; | 480 bool draw_checkerboard_for_missing_tiles_; |
| 470 gfx::Transform sublayer_transform_; | 481 gfx::Transform sublayer_transform_; |
| 471 gfx::Transform transform_; | 482 gfx::Transform transform_; |
| 472 | 483 |
| 473 bool draws_content_; | 484 bool draws_content_; |
| 474 bool force_render_surface_; | 485 bool force_render_surface_; |
| 475 | 486 |
| 476 // Set for the layer that other layers are fixed to. | 487 // Set for the layer that other layers are fixed to. |
| 477 bool is_container_for_fixed_position_layers_; | 488 bool is_container_for_fixed_position_layers_; |
| 478 // This is true if the layer should be fixed to the closest ancestor | 489 // This property is effective when |
| 479 // container. | 490 // is_container_for_fixed_position_layers_ == true, |
| 480 bool fixed_to_container_layer_; | 491 gfx::Vector2dF fixed_container_size_delta_; |
| 492 |
| 493 LayerPositionConstraint position_constraint_; |
| 481 | 494 |
| 482 gfx::Vector2dF scroll_delta_; | 495 gfx::Vector2dF scroll_delta_; |
| 483 gfx::Vector2d sent_scroll_delta_; | 496 gfx::Vector2d sent_scroll_delta_; |
| 484 gfx::Vector2d max_scroll_offset_; | 497 gfx::Vector2d max_scroll_offset_; |
| 485 gfx::Transform impl_transform_; | 498 gfx::Transform impl_transform_; |
| 486 gfx::Vector2dF last_scroll_offset_; | 499 gfx::Vector2dF last_scroll_offset_; |
| 487 | 500 |
| 488 // The global depth value of the center of the layer. This value is used | 501 // The global depth value of the center of the layer. This value is used |
| 489 // to sort layers from back to front. | 502 // to sort layers from back to front. |
| 490 float draw_depth_; | 503 float draw_depth_; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 519 // Group of properties that need to be computed based on the layer tree | 532 // Group of properties that need to be computed based on the layer tree |
| 520 // hierarchy before layers can be drawn. | 533 // hierarchy before layers can be drawn. |
| 521 DrawProperties<LayerImpl, RenderSurfaceImpl> draw_properties_; | 534 DrawProperties<LayerImpl, RenderSurfaceImpl> draw_properties_; |
| 522 | 535 |
| 523 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 536 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 524 }; | 537 }; |
| 525 | 538 |
| 526 } // namespace cc | 539 } // namespace cc |
| 527 | 540 |
| 528 #endif // CC_LAYERS_LAYER_IMPL_H_ | 541 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |