-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move inspector layer view update after LayerTreeHost::UpdateLayers
The inspector uses layer and cc property tree information to update the layer view via LayerTreeDidChange. Previously, this was called after paint but before the property trees had updated to-screen transforms (calculated in draw_property_utils::UpdatePropertyTrees) which resulted in incorrect layer positions. This patch moves the LayerTreeDidChange notification after LayerTreeHost::UpdateLayers which is the first point where cc property trees have correct to-screen transforms. This fixes the inspector layer positioning. Bug: 977578 Change-Id: Ie033508eb2985b3bce8c8494558a4788b9c65fa2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726874 Commit-Queue: Philip Rogers <pdr@chromium.org> Reviewed-by: Chris Harrelson OOO <chrishtr@chromium.org> Cr-Commit-Position: refs/heads/master@{#685866}
- Loading branch information
Showing
5 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...party/blink/web_tests/http/tests/devtools/layers/layers-3d-view-after-update-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Layers after update in Layers3DView | ||
|
||
Pass: Layer quads are unchanged by no-op update | ||
|
41 changes: 41 additions & 0 deletions
41
third_party/blink/web_tests/http/tests/devtools/layers/layers-3d-view-after-update.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
(async function() { | ||
TestRunner.addResult(`Layers after update in Layers3DView\n`); | ||
await TestRunner.loadModule('layers_test_runner'); | ||
|
||
await TestRunner.loadHTML(` | ||
<style> | ||
#layer { | ||
will-change: transform; | ||
width: 300px; | ||
height: 300px; | ||
transform: translate(100px, 100px); | ||
} | ||
</style> | ||
<div id="layer"></div> | ||
`); | ||
|
||
TestRunner.showPanel('layers'); | ||
await LayersTestRunner.requestLayers(); | ||
var layer = LayersTestRunner.findLayerByNodeIdAttribute('layer'); | ||
initialQuads = layer.quad().toString(); | ||
|
||
// Updating layers should not produce invalid layer to-screen transforms | ||
// (see: https://crbug.com/977578). Backface visibility is changed, rather | ||
// than just adjusting the transform, to ensure fast-path optimizations do not | ||
// prevent a full layer tree update. | ||
await LayersTestRunner.evaluateAndWaitForTreeChange( | ||
'layer.style.backfaceVisibility = "hidden";'); | ||
|
||
layer = LayersTestRunner.findLayerByNodeIdAttribute('layer'); | ||
if (initialQuads === layer.quad().toString()) | ||
TestRunner.addResult('Pass: Layer quads are unchanged by no-op update'); | ||
else | ||
TestRunner.addResult('Fail: Layer quads are changed by no-op update'); | ||
|
||
TestRunner.completeTest(); | ||
})(); | ||
|