forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove blink::GraphicsLayerDebugInfo::main_thread_scrolling_reasons_ and its plumbing (cc::LayerClient::didUpdateMainThreadScrollingReasons()). Now we get it directly from cc::LayerImpl. - Change the return value of cc::LayerClient::TakeDebugInfo() to std::unique_ptr<base::trace_event::TracedValue> to simplify handling of the debug info which is now added into the layer's traced value with a new name "debug_info" instead of merging into the layer's traced value. - Remove the broken annotated invalidation tracking from blink::GraphicsLayerDebugInfo. Will fix the feature later. Also removed blink::FirstPaintInvalidationTracking. The change won't break existing features because for now the debug info data is either not used by the trace viewer or is used in a feature that is not working properly. --show-repaint-rects feature won't be affected because it uses data in cc instead of GraphicsLayerDebugInfo. See https://cs.chromium.org/chromium/src/third_party/catapult/tracing/tracing/extras/chrome/cc/layer_impl.html?q=layer_impl.html&sq=package:chromium&g=0&l=1 and https://cs.chromium.org/chromium/src/third_party/catapult/tracing/tracing/ui/extras/chrome/cc/layer_picker.html?rcl=03db8a6e5bb1eabfcbd88becac24c967597ed5bb&l=156 for the current usages of the debug info data in trace viewer. Bug: 842238 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I0bbb2c99842b0b22589a10d27d70e41eb1a6dc4a Reviewed-on: https://chromium-review.googlesource.com/1055813 Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Reviewed-by: Ian Vollick <vollick@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Cr-Commit-Position: refs/heads/master@{#559637}
- Loading branch information
1 parent
d7a51a3
commit 81f6c4d
Showing
23 changed files
with
227 additions
and
496 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Copyright 2018 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. | ||
|
||
#include "cc/input/main_thread_scrolling_reason.h" | ||
|
||
#include "base/stl_util.h" | ||
#include "base/trace_event/trace_event_argument.h" | ||
|
||
namespace cc { | ||
|
||
std::string MainThreadScrollingReason::AsText(uint32_t reasons) { | ||
base::trace_event::TracedValue traced_value; | ||
AddToTracedValue(reasons, traced_value); | ||
std::string result = traced_value.ToString(); | ||
// Remove '{main_thread_scrolling_reasons:[', ']}', and any '"' chars. | ||
size_t array_start_pos = result.find('['); | ||
size_t array_end_pos = result.find(']'); | ||
result = | ||
result.substr(array_start_pos + 1, array_end_pos - array_start_pos - 1); | ||
base::Erase(result, '\"'); | ||
return result; | ||
} | ||
|
||
void MainThreadScrollingReason::AddToTracedValue( | ||
uint32_t reasons, | ||
base::trace_event::TracedValue& traced_value) { | ||
traced_value.BeginArray("main_thread_scrolling_reasons"); | ||
|
||
if (reasons & kHasBackgroundAttachmentFixedObjects) | ||
traced_value.AppendString("Has background-attachment:fixed"); | ||
if (reasons & kHasNonLayerViewportConstrainedObjects) | ||
traced_value.AppendString("Has non-layer viewport-constrained objects"); | ||
if (reasons & kThreadedScrollingDisabled) | ||
traced_value.AppendString("Threaded scrolling is disabled"); | ||
if (reasons & kScrollbarScrolling) | ||
traced_value.AppendString("Scrollbar scrolling"); | ||
if (reasons & kPageOverlay) | ||
traced_value.AppendString("Page overlay"); | ||
if (reasons & kHandlingScrollFromMainThread) | ||
traced_value.AppendString("Handling scroll from main thread"); | ||
if (reasons & kCustomScrollbarScrolling) | ||
traced_value.AppendString("Custom scrollbar scrolling"); | ||
if (reasons & kHasOpacityAndLCDText) | ||
traced_value.AppendString("Has opacity and LCD text"); | ||
if (reasons & kHasTransformAndLCDText) | ||
traced_value.AppendString("Has transform and LCD text"); | ||
if (reasons & kBackgroundNotOpaqueInRectAndLCDText) | ||
traced_value.AppendString("Background is not opaque in rect and LCD text"); | ||
if (reasons & kHasBorderRadius) | ||
traced_value.AppendString("Has border radius"); | ||
if (reasons & kHasClipRelatedProperty) | ||
traced_value.AppendString("Has clip related property"); | ||
if (reasons & kHasBoxShadowFromNonRootLayer) | ||
traced_value.AppendString("Has box shadow from non-root layer"); | ||
if (reasons & kIsNotStackingContextAndLCDText) | ||
traced_value.AppendString("Is not stacking context and LCD text"); | ||
|
||
// Transient scrolling reasons. | ||
if (reasons & kNonFastScrollableRegion) | ||
traced_value.AppendString("Non fast scrollable region"); | ||
if (reasons & kFailedHitTest) | ||
traced_value.AppendString("Failed hit test"); | ||
if (reasons & kNoScrollingLayer) | ||
traced_value.AppendString("No scrolling layer"); | ||
if (reasons & kNotScrollable) | ||
traced_value.AppendString("Not scrollable"); | ||
if (reasons & kContinuingMainThreadScroll) | ||
traced_value.AppendString("Continuing main thread scroll"); | ||
if (reasons & kNonInvertibleTransform) | ||
traced_value.AppendString("Non-invertible transform"); | ||
if (reasons & kPageBasedScrolling) | ||
traced_value.AppendString("Page-based scrolling"); | ||
|
||
traced_value.EndArray(); | ||
} | ||
|
||
} // namespace cc |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2018 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. | ||
|
||
#include "cc/input/main_thread_scrolling_reason.h" | ||
|
||
#include "testing/gtest/include/gtest/gtest.h" | ||
|
||
namespace cc { | ||
|
||
using MainThreadScrollingReasonTest = testing::Test; | ||
|
||
TEST_F(MainThreadScrollingReasonTest, AsText) { | ||
EXPECT_EQ("", MainThreadScrollingReason::AsText(0)); | ||
EXPECT_EQ( | ||
"Has background-attachment:fixed," | ||
"Has non-layer viewport-constrained objects," | ||
"Threaded scrolling is disabled," | ||
"Scrollbar scrolling,Page overlay," | ||
"Handling scroll from main thread," | ||
"Custom scrollbar scrolling," | ||
"Has opacity and LCD text," | ||
"Has transform and LCD text," | ||
"Background is not opaque in rect and LCD text," | ||
"Has border radius,Has clip related property," | ||
"Has box shadow from non-root layer," | ||
"Is not stacking context and LCD text," | ||
"Non fast scrollable region," | ||
"Failed hit test," | ||
"No scrolling layer," | ||
"Not scrollable," | ||
"Continuing main thread scroll," | ||
"Non-invertible transform," | ||
"Page-based scrolling", | ||
MainThreadScrollingReason::AsText(0xffffffffu)); | ||
} | ||
|
||
} // namespace cc |
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
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
Oops, something went wrong.