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

Make verbose log of graphics layer tree work with the original vmodule string

We use "--vmodule=*/paint/*=3,*/graphics/*=3" to output verbose log
for painting. However it had been mismatching the graphics layer tree
log by renderer/core/frame/local_frame_view.cc after crrev.com/823365.

Move the verbose log for graphics layer trees into
renderer/core/paint/compositing/graphics_layer_tree_as_text.cc to
make the original vmodule string work again.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I5ba5147904cf0cb7060a66c7cef8498a4e9fd001
Reviewed-on: https://chromium-review.googlesource.com/1178564
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583918}
parent 44621cb4
...@@ -2774,17 +2774,7 @@ static void PaintGraphicsLayerRecursively(GraphicsLayer* layer) { ...@@ -2774,17 +2774,7 @@ static void PaintGraphicsLayerRecursively(GraphicsLayer* layer) {
layer->PaintRecursively(); layer->PaintRecursively();
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
if (VLOG_IS_ON(2)) { VerboseLogGraphicsLayerTree(layer);
DEFINE_STATIC_LOCAL(String, s_previous_tree, ());
LayerTreeFlags flags = VLOG_IS_ON(3) ? 0xffffffff : kOutputAsLayerTree;
String new_tree = GraphicsLayerTreeAsTextForTesting(layer, flags);
if (new_tree != s_previous_tree) {
VLOG(2) << "After GraphicsLayer::PaintRecursively()\n"
<< "GraphicsLayer tree:\n"
<< new_tree.Utf8().data();
s_previous_tree = new_tree;
}
}
#endif #endif
} }
......
...@@ -352,6 +352,24 @@ String GraphicsLayerTreeAsTextForTesting(const GraphicsLayer* layer, ...@@ -352,6 +352,24 @@ String GraphicsLayerTreeAsTextForTesting(const GraphicsLayer* layer,
return GraphicsLayerTreeAsJSON(layer, flags)->ToPrettyJSONString(); return GraphicsLayerTreeAsJSON(layer, flags)->ToPrettyJSONString();
} }
#if DCHECK_IS_ON()
void VerboseLogGraphicsLayerTree(const GraphicsLayer* root) {
if (!VLOG_IS_ON(2))
return;
using GraphicsLayerTreeMap = HashMap<const GraphicsLayer*, String>;
DEFINE_STATIC_LOCAL(GraphicsLayerTreeMap, s_previous_trees, ());
LayerTreeFlags flags = VLOG_IS_ON(3) ? 0xffffffff : kOutputAsLayerTree;
String new_tree = GraphicsLayerTreeAsTextForTesting(root, flags);
auto it = s_previous_trees.find(root);
if (it == s_previous_trees.end() || it->value != new_tree) {
VLOG(2) << "GraphicsLayer tree:\n" << new_tree.Utf8().data();
s_previous_trees.Set(root, new_tree);
// For simplification, we don't remove deleted GraphicsLayers from the map.
}
}
#endif
} // namespace blink } // namespace blink
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
......
...@@ -21,6 +21,9 @@ std::unique_ptr<JSONObject> GraphicsLayerTreeAsJSON(const GraphicsLayer*, ...@@ -21,6 +21,9 @@ std::unique_ptr<JSONObject> GraphicsLayerTreeAsJSON(const GraphicsLayer*,
String CORE_EXPORT GraphicsLayerTreeAsTextForTesting(const GraphicsLayer*, String CORE_EXPORT GraphicsLayerTreeAsTextForTesting(const GraphicsLayer*,
LayerTreeFlags); LayerTreeFlags);
#if DCHECK_IS_ON()
void CORE_EXPORT VerboseLogGraphicsLayerTree(const GraphicsLayer*);
#endif
} // namespace blink } // namespace blink
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
......
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