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

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

Issue 2638013002: Record box shadow as main thread scrolling reasons (Closed)
Patch Set: Add flag related test && bug fix 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 d2c84bbc433e9098dddcd9f950068771ade68037..dc274855b0d94c2d0be7e4885dff2831e36fe2d9 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -1752,6 +1752,23 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling(
bool needsCompositedScrolling = true;
+ bool hasTranslucentBorder =
+ layer->layoutObject()
+ ->style()
+ ->visitedDependentColor(CSSPropertyBorderLeftColor)
+ .hasAlpha() ||
+ layer->layoutObject()
+ ->style()
+ ->visitedDependentColor(CSSPropertyBorderRightColor)
+ .hasAlpha() ||
+ layer->layoutObject()
+ ->style()
+ ->visitedDependentColor(CSSPropertyBorderTopColor)
+ .hasAlpha() ||
+ layer->layoutObject()
+ ->style()
+ ->visitedDependentColor(CSSPropertyBorderBottomColor)
+ .hasAlpha();
// TODO(flackr): Allow integer transforms as long as all of the ancestor
// transforms are also integer.
bool backgroundSupportsLCDText =
@@ -1760,7 +1777,8 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling(
layer->backgroundPaintLocation() & BackgroundPaintInScrollingContents &&
layer->backgroundIsKnownToBeOpaqueInRect(
toLayoutBox(layer->layoutObject())->paddingBoxRect()) &&
- !layer->compositesWithTransform() && !layer->compositesWithOpacity();
+ !layer->compositesWithTransform() && !layer->compositesWithOpacity() &&
+ !layer->layoutObject()->style()->boxShadow();
bokan 2017/01/17 21:36:55 This looks like it's doing more than just recordin
flackr 2017/01/17 21:59:42 We have this condition in https://cs.chromium.org/
yigu 2017/01/23 18:53:51 Done.
if (mode == PaintLayerScrollableArea::ConsiderLCDText &&
!layer->compositor()->preferCompositingToLCDTextEnabled() &&
@@ -1778,6 +1796,15 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling(
addStyleRelatedMainThreadScrollingReasons(
MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText);
}
+ if (layer->layoutBox()->style()->boxShadow()) {
+ addStyleRelatedMainThreadScrollingReasons(
+ MainThreadScrollingReason::kHasBoxShadowAndLCDText);
+ }
+ if (!RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() &&
+ hasTranslucentBorder) {
+ addStyleRelatedMainThreadScrollingReasons(
+ MainThreadScrollingReason::kHasTranslucentBorderAndLCDText);
+ }
needsCompositedScrolling = false;
}
« no previous file with comments | « cc/input/main_thread_scrolling_reason.h ('k') | third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698