Commit 54524f7c authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Remove use_parent_backface_visibility on Layer and LayerImpl.

These fields are only ever set for content layers such as canvas
and video. However, such uses don't make sense any more, because the
"parent" concept originally had to do with a parent layer, which is
no longer a concept in layer list mode.

Bug: 1008483

Change-Id: I053f9048e5a152f84c4df761f1b1500a5a0019c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2129893Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755365}
parent 00e42585
...@@ -80,7 +80,6 @@ Layer::Inputs::Inputs(int layer_id) ...@@ -80,7 +80,6 @@ Layer::Inputs::Inputs(int layer_id)
contents_opaque(false), contents_opaque(false),
is_drawable(false), is_drawable(false),
double_sided(true), double_sided(true),
use_parent_backface_visibility(false),
is_scrollbar(false), is_scrollbar(false),
has_will_change_transform_hint(false), has_will_change_transform_hint(false),
background_color(0) {} background_color(0) {}
...@@ -1253,14 +1252,6 @@ std::string Layer::ToString() const { ...@@ -1253,14 +1252,6 @@ std::string Layer::ToString() const {
effect_tree_index(), scroll_tree_index(), transform_tree_index()); effect_tree_index(), scroll_tree_index(), transform_tree_index());
} }
void Layer::SetUseParentBackfaceVisibility(bool use) {
DCHECK(IsPropertyChangeAllowed());
if (inputs_.use_parent_backface_visibility == use)
return;
inputs_.use_parent_backface_visibility = use;
SetNeedsPushProperties();
}
void Layer::SetShouldCheckBackfaceVisibility( void Layer::SetShouldCheckBackfaceVisibility(
bool should_check_backface_visibility) { bool should_check_backface_visibility) {
if (should_check_backface_visibility_ == should_check_backface_visibility) if (should_check_backface_visibility_ == should_check_backface_visibility)
...@@ -1344,7 +1335,6 @@ void Layer::PushPropertiesTo(LayerImpl* layer) { ...@@ -1344,7 +1335,6 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->SetWheelEventHandlerRegion(Region()); layer->SetWheelEventHandlerRegion(Region());
} }
layer->SetContentsOpaque(inputs_.contents_opaque); layer->SetContentsOpaque(inputs_.contents_opaque);
layer->SetUseParentBackfaceVisibility(inputs_.use_parent_backface_visibility);
layer->SetShouldCheckBackfaceVisibility(should_check_backface_visibility_); layer->SetShouldCheckBackfaceVisibility(should_check_backface_visibility_);
layer->UpdateScrollable(); layer->UpdateScrollable();
......
...@@ -491,17 +491,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> { ...@@ -491,17 +491,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> {
void SetDoubleSided(bool double_sided); void SetDoubleSided(bool double_sided);
bool double_sided() const { return inputs_.double_sided; } bool double_sided() const { return inputs_.double_sided; }
// Set or get if SetDoubleSided() for this layer should be ignored and
// inherited directly from this layer's parent instead. Used to attach this
// layer's backface visibility to the value of its parent.
//
// Note that should_check_backface_visibility() is the final computed value
// for back face visibility, which is only for internal use.
void SetUseParentBackfaceVisibility(bool use);
bool use_parent_backface_visibility() const {
return inputs_.use_parent_backface_visibility;
}
// When true the layer may contribute to the compositor's output. When false, // When true the layer may contribute to the compositor's output. When false,
// it does not. This property does not apply to children of the layer, they // it does not. This property does not apply to children of the layer, they
// may contribute while this layer does not. The layer itself will determine // may contribute while this layer does not. The layer itself will determine
...@@ -724,7 +713,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> { ...@@ -724,7 +713,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> {
// Internal to property tree construction. Set if the layer should not be // Internal to property tree construction. Set if the layer should not be
// shown when its back face is visible to the user. This is a derived value // shown when its back face is visible to the user. This is a derived value
// from SetDoubleSided() and SetUseParentBackfaceVisibility(). // from SetDoubleSided().
void SetShouldCheckBackfaceVisibility(bool should_check_backface_visibility); void SetShouldCheckBackfaceVisibility(bool should_check_backface_visibility);
bool should_check_backface_visibility() const { bool should_check_backface_visibility() const {
return should_check_backface_visibility_; return should_check_backface_visibility_;
...@@ -860,7 +849,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> { ...@@ -860,7 +849,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> {
bool is_drawable : 1; bool is_drawable : 1;
bool double_sided : 1; bool double_sided : 1;
bool use_parent_backface_visibility : 1;
// Indicates that this layer is a scrollbar. // Indicates that this layer is a scrollbar.
bool is_scrollbar : 1; bool is_scrollbar : 1;
......
...@@ -55,7 +55,6 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, ...@@ -55,7 +55,6 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl,
layer_property_changed_from_property_trees_(false), layer_property_changed_from_property_trees_(false),
may_contain_video_(false), may_contain_video_(false),
contents_opaque_(false), contents_opaque_(false),
use_parent_backface_visibility_(false),
should_check_backface_visibility_(false), should_check_backface_visibility_(false),
draws_content_(false), draws_content_(false),
contributes_to_drawn_render_surface_(false), contributes_to_drawn_render_surface_(false),
...@@ -371,7 +370,6 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) { ...@@ -371,7 +370,6 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
layer->offset_to_transform_parent_ = offset_to_transform_parent_; layer->offset_to_transform_parent_ = offset_to_transform_parent_;
layer->contents_opaque_ = contents_opaque_; layer->contents_opaque_ = contents_opaque_;
layer->may_contain_video_ = may_contain_video_; layer->may_contain_video_ = may_contain_video_;
layer->use_parent_backface_visibility_ = use_parent_backface_visibility_;
layer->should_check_backface_visibility_ = should_check_backface_visibility_; layer->should_check_backface_visibility_ = should_check_backface_visibility_;
layer->draws_content_ = draws_content_; layer->draws_content_ = draws_content_;
layer->hit_testable_ = hit_testable_; layer->hit_testable_ = hit_testable_;
......
...@@ -184,13 +184,6 @@ class CC_EXPORT LayerImpl { ...@@ -184,13 +184,6 @@ class CC_EXPORT LayerImpl {
bool Is3dSorted() const { return GetSortingContextId() != 0; } bool Is3dSorted() const { return GetSortingContextId() != 0; }
void SetUseParentBackfaceVisibility(bool use) {
use_parent_backface_visibility_ = use;
}
bool use_parent_backface_visibility() const {
return use_parent_backface_visibility_;
}
void SetShouldCheckBackfaceVisibility(bool should_check_backface_visibility) { void SetShouldCheckBackfaceVisibility(bool should_check_backface_visibility) {
should_check_backface_visibility_ = should_check_backface_visibility; should_check_backface_visibility_ = should_check_backface_visibility;
} }
...@@ -489,7 +482,6 @@ class CC_EXPORT LayerImpl { ...@@ -489,7 +482,6 @@ class CC_EXPORT LayerImpl {
bool may_contain_video_ : 1; bool may_contain_video_ : 1;
bool contents_opaque_ : 1; bool contents_opaque_ : 1;
bool use_parent_backface_visibility_ : 1;
bool should_check_backface_visibility_ : 1; bool should_check_backface_visibility_ : 1;
bool draws_content_ : 1; bool draws_content_ : 1;
bool contributes_to_drawn_render_surface_ : 1; bool contributes_to_drawn_render_surface_ : 1;
......
...@@ -365,9 +365,7 @@ void SetHasContributingLayerThatEscapesClip(int lca_clip_id, ...@@ -365,9 +365,7 @@ void SetHasContributingLayerThatEscapesClip(int lca_clip_id,
template <typename LayerType> template <typename LayerType>
int TransformTreeIndexForBackfaceVisibility(LayerType* layer, int TransformTreeIndexForBackfaceVisibility(LayerType* layer,
const TransformTree& tree) { const TransformTree& tree) {
if (!layer->use_parent_backface_visibility() || !layer->has_transform_node())
return layer->transform_tree_index(); return layer->transform_tree_index();
return tree.Node(layer->transform_tree_index())->parent_id;
} }
bool IsTargetSpaceTransformBackFaceVisible( bool IsTargetSpaceTransformBackFaceVisible(
......
...@@ -634,19 +634,12 @@ void PropertyTreeBuilderContext::AddScrollNodeIfNeeded( ...@@ -634,19 +634,12 @@ void PropertyTreeBuilderContext::AddScrollNodeIfNeeded(
} }
void SetBackfaceVisibilityTransform(Layer* layer, bool created_transform_node) { void SetBackfaceVisibilityTransform(Layer* layer, bool created_transform_node) {
if (layer->use_parent_backface_visibility()) {
DCHECK(layer->parent());
DCHECK(!layer->parent()->use_parent_backface_visibility());
layer->SetShouldCheckBackfaceVisibility(
layer->parent()->should_check_backface_visibility());
} else {
// A double-sided layer's backface can been shown when its visible. // A double-sided layer's backface can been shown when its visible.
// In addition, we need to check if (1) there might be a local 3D transform // In addition, we need to check if (1) there might be a local 3D transform
// on the layer that might turn it to the backface, or (2) it is not drawn // on the layer that might turn it to the backface, or (2) it is not drawn
// into a flattened space. // into a flattened space.
layer->SetShouldCheckBackfaceVisibility(!layer->double_sided() && layer->SetShouldCheckBackfaceVisibility(!layer->double_sided() &&
created_transform_node); created_transform_node);
}
} }
void SetSafeOpaqueBackgroundColor(const DataForRecursion& data_from_ancestor, void SetSafeOpaqueBackgroundColor(const DataForRecursion& data_from_ancestor,
......
...@@ -447,7 +447,6 @@ void GraphicsLayer::SetContentsTo(scoped_refptr<cc::Layer> layer, ...@@ -447,7 +447,6 @@ void GraphicsLayer::SetContentsTo(scoped_refptr<cc::Layer> layer,
if (layer) { if (layer) {
if (contents_layer_ != layer) { if (contents_layer_ != layer) {
contents_layer_ = std::move(layer); contents_layer_ = std::move(layer);
contents_layer_->SetUseParentBackfaceVisibility(true);
// It is necessary to call SetDrawsContent() as soon as we receive the new // It is necessary to call SetDrawsContent() as soon as we receive the new
// contents_layer, for the correctness of early exit conditions in // contents_layer, for the correctness of early exit conditions in
// SetDrawsContent() and SetContentsVisible(). // SetDrawsContent() and SetContentsVisible().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment