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

Unified Diff: cc/trees/draw_property_utils.cc

Issue 2755803003: cc: Remove SetNeedsCommitNoRebuild from Layer API (Closed)
Patch Set: check for LTH Created 3 years, 9 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/draw_property_utils.h ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/draw_property_utils.cc
diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc
index a591845f38b5c02e7e5bde6a6c134e076acbc110..9f3f3120109da91cf31ff25fabbc75aff2ea4b94 100644
--- a/cc/trees/draw_property_utils.cc
+++ b/cc/trees/draw_property_utils.cc
@@ -17,6 +17,7 @@
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/property_tree.h"
#include "cc/trees/property_tree_builder.h"
+#include "cc/trees/scroll_node.h"
#include "cc/trees/transform_node.h"
#include "ui/gfx/geometry/rect_conversions.h"
@@ -909,6 +910,23 @@ void ComputeClips(PropertyTrees* property_trees,
clip_tree->set_needs_update(false);
}
+void UpdateScrollTree(ScrollTree* scroll_tree,
+ const LayerTreeHost* layer_tree_host) {
+ if (!scroll_tree->needs_update())
+ return;
+
+ for (int i = ScrollTree::kRootNodeId;
+ i < static_cast<int>(scroll_tree->size()); ++i) {
+ ScrollNode* scroll_node = scroll_tree->Node(i);
+ if (Layer* scroll_layer =
+ layer_tree_host->LayerById(scroll_node->owning_layer_id)) {
+ if (Layer* scroll_clip_layer = scroll_layer->scroll_clip_layer()) {
+ scroll_node->scroll_clip_layer_bounds = scroll_clip_layer->bounds();
+ }
+ }
+ }
+}
+
void ComputeTransforms(TransformTree* transform_tree) {
if (!transform_tree->needs_update())
return;
@@ -1055,8 +1073,12 @@ void ComputeVisibleRects(LayerImpl* root_layer,
can_render_to_separate_surface);
}
-void UpdatePropertyTrees(PropertyTrees* property_trees,
+void UpdatePropertyTrees(LayerTreeHost* layer_tree_host,
+ PropertyTrees* property_trees,
bool can_render_to_separate_surface) {
+ DCHECK(layer_tree_host);
+ DCHECK(property_trees);
+ DCHECK_EQ(layer_tree_host->property_trees(), property_trees);
if (property_trees->non_root_surfaces_enabled !=
can_render_to_separate_surface) {
property_trees->non_root_surfaces_enabled = can_render_to_separate_surface;
@@ -1066,6 +1088,7 @@ void UpdatePropertyTrees(PropertyTrees* property_trees,
property_trees->clip_tree.set_needs_update(true);
property_trees->effect_tree.set_needs_update(true);
}
+ UpdateScrollTree(&property_trees->scroll_tree, layer_tree_host);
ComputeTransforms(&property_trees->transform_tree);
// Computation of clips uses surface contents scale which is updated while
// computing effects. So, ComputeEffects should be before ComputeClips.
« no previous file with comments | « cc/trees/draw_property_utils.h ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698