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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 1968803002: cc : Use effect node data to determine which opacity wins at commit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 74603d51fbc0f1016e5cc45cfd7ffa8a6b09b4a4..7f2cb3adbe8f03550cd168e0ba4674e0e21a8286 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -484,6 +484,10 @@ void LayerTreeImpl::RemoveFromElementMap(LayerImpl* layer) {
element_layers_map_.erase(layer->element_id());
}
+void LayerTreeImpl::AddToOpacityAnimationsMap(int id, float opacity) {
+ opacity_animations_map_[id] = opacity;
+}
+
LayerTreeImpl::ElementLayers LayerTreeImpl::GetMutableLayers(
uint64_t element_id) {
auto iter = element_layers_map_.find(element_id);
@@ -562,6 +566,18 @@ void LayerTreeImpl::UpdatePropertyTreeScrollingAndAnimationFromMainThread() {
// frame to a newly-committed property tree.
if (!root_layer())
return;
+ for (auto& layer_id_to_opacity : opacity_animations_map_) {
+ if (LayerImpl* layer = LayerById(layer_id_to_opacity.first)) {
+ EffectNode* node =
+ property_trees_.effect_tree.Node(layer->effect_tree_index());
+ if (node->owner_id != layer->id() ||
+ !node->data.is_currently_animating_opacity)
+ continue;
+ node->data.opacity = layer_id_to_opacity.second;
+ property_trees_.effect_tree.set_needs_update(true);
+ }
+ }
+ opacity_animations_map_.clear();
LayerTreeHostCommon::CallFunctionForEveryLayer(this, [](LayerImpl* layer) {
layer->UpdatePropertyTreeForScrollingAndAnimationIfNeeded();
});
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698