Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2968)

Unified Diff: cc/layers/layer_impl.cc

Issue 2615773003: Replace LayerImpl::sorting_context_id with transform reference. (Closed)
Patch Set: Update tests. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 6607c14a98a5eea52284b16e6abd3d7a103aa742..822fb1e8d35f915f8709380647d73d23ed2ebcf9 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -75,7 +75,6 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
effect_tree_index_(EffectTree::kInvalidNodeId),
clip_tree_index_(ClipTree::kInvalidNodeId),
scroll_tree_index_(ScrollTree::kInvalidNodeId),
- sorting_context_id_(0),
current_draw_mode_(DRAW_MODE_NONE),
mutable_properties_(MutableProperty::kNone),
debug_info_(nullptr),
@@ -170,7 +169,7 @@ void LayerImpl::PopulateSharedQuadState(SharedQuadState* state) const {
state->SetAll(draw_properties_.target_space_transform, bounds(),
draw_properties_.visible_layer_rect, draw_properties_.clip_rect,
draw_properties_.is_clipped, draw_properties_.opacity,
- draw_blend_mode_, sorting_context_id_);
+ draw_blend_mode_, GetSortingContextId());
}
void LayerImpl::PopulateScaledSharedQuadState(
@@ -190,7 +189,7 @@ void LayerImpl::PopulateScaledSharedQuadState(
state->SetAll(scaled_draw_transform, scaled_bounds, scaled_visible_layer_rect,
draw_properties().clip_rect, draw_properties().is_clipped,
draw_properties().opacity, draw_blend_mode_,
- sorting_context_id_);
+ GetSortingContextId());
}
bool LayerImpl::WillDraw(DrawMode draw_mode,
@@ -353,7 +352,6 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
layer->effect_tree_index_ = effect_tree_index_;
layer->clip_tree_index_ = clip_tree_index_;
layer->scroll_tree_index_ = scroll_tree_index_;
- layer->sorting_context_id_ = sorting_context_id_;
layer->has_will_change_transform_hint_ = has_will_change_transform_hint_;
layer->scrollbars_hidden_ = scrollbars_hidden_;
@@ -450,8 +448,7 @@ std::unique_ptr<base::DictionaryValue> LayerImpl::LayerTreeAsJson() {
}
bool LayerImpl::LayerPropertyChanged() const {
- if (layer_property_changed_ ||
- (GetPropertyTrees() && GetPropertyTrees()->full_tree_damaged))
+ if (layer_property_changed_ || GetPropertyTrees()->full_tree_damaged)
return true;
if (transform_tree_index() == TransformTree::kInvalidNodeId)
return false;
@@ -768,10 +765,6 @@ void LayerImpl::SetPosition(const gfx::PointF& position) {
position_ = position;
}
-void LayerImpl::Set3dSortingContextId(int id) {
- sorting_context_id_ = id;
-}
-
bool LayerImpl::TransformIsAnimating() const {
return GetMutatorHost()->IsAnimatingTransformProperty(
element_id(), GetElementTypeForAnimation());
@@ -1038,6 +1031,13 @@ bool LayerImpl::CanUseLCDText() const {
return true;
}
+int LayerImpl::GetSortingContextId() const {
+ return layer_tree_impl()
+ ->property_trees()
+ ->transform_tree.Node(transform_tree_index())
+ ->sorting_context_id;
+}
+
Region LayerImpl::GetInvalidationRegionForDebugging() {
return Region(update_rect_);
}

Powered by Google App Engine
This is Rietveld 408576698