| Index: cc/layers/layer.cc
|
| diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
|
| index 53a3390ec15c0c3196850e571a88bc1349722e49..a04f8e4e8d08bcd3a4791cdce60e96738e254e14 100644
|
| --- a/cc/layers/layer.cc
|
| +++ b/cc/layers/layer.cc
|
| @@ -39,7 +39,6 @@ Layer::Layer()
|
| opacity_(1.f),
|
| anchor_point_z_(0.f),
|
| is_container_for_fixed_position_layers_(false),
|
| - fixed_to_container_layer_(false),
|
| is_drawable_(false),
|
| masks_to_bounds_(false),
|
| contents_opaque_(false),
|
| @@ -414,6 +413,14 @@ void Layer::SetPosition(gfx::PointF position) {
|
| SetNeedsCommit();
|
| }
|
|
|
| +bool Layer::is_container_for_fixed_position_layers() const {
|
| + if (!transform_.IsIdentityOrTranslation())
|
| + return true;
|
| + if (parent_ && !parent_->sublayer_transform_.IsIdentityOrTranslation())
|
| + return true;
|
| + return is_container_for_fixed_position_layers_;
|
| +}
|
| +
|
| void Layer::SetSublayerTransform(const gfx::Transform& sublayer_transform) {
|
| if (sublayer_transform_ == sublayer_transform)
|
| return;
|
| @@ -531,7 +538,7 @@ void Layer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
|
|
|
| bool Layer::DescendantIsFixedToContainerLayer() const {
|
| for (size_t i = 0; i < children_.size(); ++i) {
|
| - if (children_[i]->fixed_to_container_layer() ||
|
| + if (children_[i]->position_constraint_.is_fixed_position() ||
|
| children_[i]->DescendantIsFixedToContainerLayer())
|
| return true;
|
| }
|
| @@ -551,11 +558,11 @@ void Layer::SetIsContainerForFixedPositionLayers(bool container) {
|
| SetNeedsCommit();
|
| }
|
|
|
| -void Layer::SetFixedToContainerLayer(bool fixed_to_container_layer) {
|
| - if (fixed_to_container_layer_ == fixed_to_container_layer)
|
| - return;
|
| - fixed_to_container_layer_ = fixed_to_container_layer;
|
| - SetNeedsCommit();
|
| +void Layer::SetPositionConstraint(const LayerPositionConstraint& constraint) {
|
| + if (position_constraint_ == constraint)
|
| + return;
|
| + position_constraint_ = constraint;
|
| + SetNeedsCommit();
|
| }
|
|
|
| void Layer::PushPropertiesTo(LayerImpl* layer) {
|
| @@ -586,7 +593,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
|
| layer->SetPosition(position_);
|
| layer->SetIsContainerForFixedPositionLayers(
|
| is_container_for_fixed_position_layers_);
|
| - layer->SetFixedToContainerLayer(fixed_to_container_layer_);
|
| + layer->SetFixedContainerSizeDelta(gfx::Vector2dF());
|
| + layer->SetPositionConstraint(position_constraint_);
|
| layer->SetPreserves3d(preserves_3d());
|
| layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_);
|
| layer->SetSublayerTransform(sublayer_transform_);
|
|
|