New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 783614 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Compat



Sign in to add a comment

New frame keep generating with the visible content unchanged

Reported by manjian2...@gmail.com, Nov 10 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36

Example URL:
3g.163.com

Steps to reproduce the problem:
1. open http://3g.163.com
2. tap on the cross icon, scroll to the unchanged content.
3. show fps meter, the fps is not zero.But firefox is zero. And chrome://tracing shows actual swap buffer and texture production behavior keep popping up. 

What is the expected behavior?
fps meter goes to zero.

What went wrong?
A new layer tree is committed, but the impl-side tree fails to find out the content is not changed.

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 62.0.3202.89  Channel: stable
OS Version: 
Flash Version:
 
seem div#login_panel causes this bug.
It seems it can only be reproduced in chrome for android.
Inspector with emulator set to on, specification set to nexus 7 can also reproduce this bug.
Labels: Needs-Triage-M62
Labels: -OS-Linux OS-Android
Labels: Needs-triage-Mobile
Seems causes by composited scrolling.
#0  cc::Layer::SetSubtreePropertyChanged (this=0xb629dc00) at ../../cc/layers/layer.cc:1407
#1  cc::Layer::SetShouldFlattenTransform (this=0xb629dc00, should_flatten=<optimized out>) at ../../cc/layers/layer.cc:1028
#2  0xc83f4750 in blink::ApplyToGraphicsLayers<blink::UpdateShouldFlattenTransformFunctor> (mode=1, f=..., mapping=0x100c0640)
    at ../../third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:1992
#3  blink::CompositedLayerMapping::updateShouldFlattenTransform (this=this@entry=0x100c0640)
    at ../../third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:2086
#4  0xc83f7cb2 in blink::CompositedLayerMapping::updateGraphicsLayerGeometry (this=this@entry=0x100c0640, 
    compositingContainer=compositingContainer@entry=0xbf214d20, compositingStackingContext=0xbf214d20, layersNeedingPaintInvalidation=...)
    at ../../third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:1065

The call trace above is set should flatten transform to true, here's the call trace set should flatten transform to false:
#0  cc::Layer::SetShouldFlattenTransform (this=0xb87e7900, should_flatten=false) at ../../cc/layers/layer.cc:1024
#1  0xc83f5728 in blink::CompositedLayerMapping::updateShouldFlattenTransform (this=this@entry=0x100c0640)
    at ../../third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:2102
#2  0xc83f8cb2 in blink::CompositedLayerMapping::updateGraphicsLayerGeometry (this=this@entry=0x100c0640, 
    compositingContainer=compositingContainer@entry=0xbfd24d20, compositingStackingContext=0xbfd24d20, layersNeedingPaintInvalidation=...)
    at ../../third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp:1065


The toggle above make the cc thinks there is a sub tree property changed happened.
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 2d2167ead07f..cf0ab087762e 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -2181,8 +2181,8 @@ void CompositedLayerMapping::UpdateShouldFlattenTransform() {
   // causes unclipped render surfaces which cause bugs.
   //  http://crbug.com/521768 
   if (HasScrollingLayer()) {
-    graphics_layer_->SetShouldFlattenTransform(false);
-    scrolling_layer_->SetShouldFlattenTransform(false);
+    // graphics_layer_->SetShouldFlattenTransform(false);
+    // scrolling_layer_->SetShouldFlattenTransform(false);
   }
 }


Comment out these two lines stop the frame redundant generation.
Both the mapping->MainGraphicsLayer() and mapping->ScrollingContentsLayer() SetShouldFlattenTransform to true by UpdateShouldFlattenTransformFunctor
seem div#login_panel causes this bug.

No it's not. It is div.topnav_list
Cc: msrchandra@chromium.org
Labels: Needs-Feedback
@manjian2006 -- Thank You for the report.
Could you please provide us with device details, OS and also a screen cast which would help us triage the issue further.
Thanks in Advance.
I am using a nexus 7 model. But you don't need such a device. Just use the inspector and toggle the device toolbar then it will reproduce.
Project Member

Comment 16 by sheriffbot@chromium.org, Nov 13 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "msrchandra@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: TE-NeedsTriageHelp
Could some one from Dev team please look into the issue and provide an update.
Thanks in Advance.
Components: Internals>Compositing
Cc: pdr@chromium.org
Owner: trchen@chromium.org
Status: Assigned (was: Unconfirmed)
over to trchen@ for triage. Can confirm (via fps meter) that we do appear to keep generated frames although nothing is visibly changing.
Components: Blink>Compositing
Status: Started (was: Assigned)
Here's a minimal repro: http://jsbin.com/rojetevoji/

This bug is a combination of unfortunate multi-fail...

1. The page author added some animation (through RAF or other mechanism?) that is not visible. This caused us to recalculate style @ 60fps, which is already bad for battery even if we don't actually redraw the frame.

2. PaintLayer::StyleDidChange / PaintLayer::AttemptDirectCompositingUpdate didn't bother to look into the style diffs, and issued compositing update anyway.

3. During compositing update, CompositedLayerMapping::UpdateShouldFlattenTransform() flips flatten flag back and forth, as the reporter discovered.

4. cc::Layer::SetShouldFlattenTransform dirtied the layer too early, so the said back and forth resulted in a redraw despite nothing changed.

I don't think this needs to be cherry-picked to a branch though. 1. It doesn't seem to be a new regression, and 2. It is more of an optimization for badly-written pages and 3. It doesn't affect normal operation.

To the reporter: Thank you for reporting! Your analysis is really helpful for us to pinpoint the root cause. I will be working on a fix now.
My pleasure. I am a browser developer. So I just fix this by now allowing the CompositedLayerMapping::UpdateShouldFlattenTransform() flips flatten flag back and forth for now.
Project Member

Comment 22 by bugdroid1@chromium.org, Nov 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f498304ebf21ed9de9b459a0087d8c9817e25c52

commit f498304ebf21ed9de9b459a0087d8c9817e25c52
Author: Tien-Ren Chen <trchen@chromium.org>
Date: Tue Nov 28 00:35:47 2017

[Blink] Avoid SetShouldFlattenTransform() back and forth

In CompositedLayerMapping::UpdateShouldFlattenTransform() we apply
different values on the same layer multiple times for different layer
configuration. This resulted in unnecessary redraw in the compositor.

This CL collapsed the logic so that each layer will be programmed
exactly one time.

BUG= 783614 

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Id2551e6e49d2555359da9d954b44555cb1f41a63
Reviewed-on: https://chromium-review.googlesource.com/780803
Commit-Queue: Tien-Ren Chen <trchen@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519477}
[modify] https://crrev.com/f498304ebf21ed9de9b459a0087d8c9817e25c52/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp

Status: Fixed (was: Started)

Sign in to add a comment