Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2613743002: Clip related property and border radius are now recorded for UMA (Closed)
Patch Set: Test both LCD and non-LCD reasons Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
index 99602b8289bc03bb1fdc0aa58eac80b373ff37ae..d045dd9c16a85bd3293ffd74240a7608e4077fae 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -1728,6 +1728,8 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling(
const PaintLayer* layer) {
if (!layer->scrollsOverflow())
return false;
+ if (layer->size().isEmpty())
bokan 2017/01/05 14:52:41 It might change behavior to have this above the `i
yigu 2017/01/05 20:20:27 Done.
+ return false;
Node* node = layer->enclosingNode();
if (node && node->isElementNode() &&
@@ -1736,6 +1738,8 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling(
CompositorMutableProperty::kScrollLeft)))
return true;
+ bool needsCompositedScrolling = true;
+
// TODO(flackr): Allow integer transforms as long as all of the ancestor
// transforms are also integer.
bool backgroundSupportsLCDText =
@@ -1762,17 +1766,26 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling(
addStyleRelatedMainThreadScrollingReasons(
MainThreadScrollingReason::kBackgroundNotOpaqueInRect);
}
- return false;
+ needsCompositedScrolling = false;
}
// TODO(schenney) Tests fail if we do not also exclude
// layer->layoutObject()->style()->hasBorderDecoration() (missing background
// behind dashed borders). Resolve this case, or not, and update this check
// with the results.
- return !(layer->size().isEmpty() || layer->hasDescendantWithClipPath() ||
- layer->hasAncestorWithClipPath() ||
- layer->layoutObject()->style()->hasBorderRadius() ||
- layer->layoutObject()->hasClip());
+ if (layer->layoutObject()->style()->hasBorderRadius()) {
+ addStyleRelatedMainThreadScrollingReasons(
+ MainThreadScrollingReason::kHasBorderRadius);
+ needsCompositedScrolling = false;
+ }
+ if (layer->layoutObject()->hasClip() ||
+ layer->layoutObject()->hasClipPath() ||
+ layer->hasDescendantWithClipPath() || layer->hasAncestorWithClipPath()) {
+ addStyleRelatedMainThreadScrollingReasons(
+ MainThreadScrollingReason::kHasClipRelatedProperty);
+ needsCompositedScrolling = false;
+ }
+ return needsCompositedScrolling;
}
void PaintLayerScrollableArea::addStyleRelatedMainThreadScrollingReasons(

Powered by Google App Engine
This is Rietveld 408576698