Commit d111b257 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Let viewport transform nodes use CompositingReason::kViewport

Use the new compositing reason instead of kWillChangeTransform to
distinguish from will-change:transform specified in web pages which
implies that the transform may change to any arbitrary value.

Bug: 1114504
Change-Id: I8a1b4e5fa909dd50f3ae6465cb40d9336c9cd640
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2367446Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800293}
parent 3d77d782
...@@ -178,7 +178,7 @@ PaintPropertyChangeType VisualViewport::UpdatePaintPropertyNodesIfNeeded( ...@@ -178,7 +178,7 @@ PaintPropertyChangeType VisualViewport::UpdatePaintPropertyNodesIfNeeded(
if (scale_ != 1.f) if (scale_ != 1.f)
state.transform_and_origin = {TransformationMatrix().Scale(scale_)}; state.transform_and_origin = {TransformationMatrix().Scale(scale_)};
state.flags.in_subtree_of_page_scale = false; state.flags.in_subtree_of_page_scale = false;
state.direct_compositing_reasons = CompositingReason::kWillChangeTransform; state.direct_compositing_reasons = CompositingReason::kViewport;
state.compositor_element_id = page_scale_element_id_; state.compositor_element_id = page_scale_element_id_;
if (!page_scale_node_) { if (!page_scale_node_) {
...@@ -259,7 +259,7 @@ PaintPropertyChangeType VisualViewport::UpdatePaintPropertyNodesIfNeeded( ...@@ -259,7 +259,7 @@ PaintPropertyChangeType VisualViewport::UpdatePaintPropertyNodesIfNeeded(
TransformPaintPropertyNode::State state{ TransformPaintPropertyNode::State state{
FloatSize(-scroll_position.Width(), -scroll_position.Height())}; FloatSize(-scroll_position.Width(), -scroll_position.Height())};
state.scroll = scroll_node_; state.scroll = scroll_node_;
state.direct_compositing_reasons = CompositingReason::kWillChangeTransform; state.direct_compositing_reasons = CompositingReason::kViewport;
if (!scroll_translation_node_) { if (!scroll_translation_node_) {
scroll_translation_node_ = TransformPaintPropertyNode::Create( scroll_translation_node_ = TransformPaintPropertyNode::Create(
*page_scale_node_, std::move(state)); *page_scale_node_, std::move(state));
......
...@@ -46,6 +46,7 @@ using CompositingReasons = uint64_t; ...@@ -46,6 +46,7 @@ using CompositingReasons = uint64_t;
V(BackdropFilter) \ V(BackdropFilter) \
V(RootScroller) \ V(RootScroller) \
V(XrOverlay) \ V(XrOverlay) \
V(Viewport) \
\ \
/* Overlap reasons that require knowing what's behind you in paint-order \ /* Overlap reasons that require knowing what's behind you in paint-order \
before knowing the answer. */ \ before knowing the answer. */ \
......
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