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

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

Issue 2676333002: Revert "Box shadow should be recorded as main thread scrolling reasons for non-root layers." (Closed)
Patch Set: Keep histograms.xml as is to avoid messing up enum numbers Created 3 years, 10 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 8eef9f10843509642a26e3d269a9b514b57ba9c3..d025478fc3d914414951d35431bf6274eaa682cf 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -1750,15 +1750,13 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling(
return false;
bool needsCompositedScrolling = true;
- uint32_t mainThreadScrollingReasons = 0;
// TODO(flackr): Allow integer transforms as long as all of the ancestor
// transforms are also integer.
bool backgroundSupportsLCDText =
RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() &&
layer->layoutObject()->style()->isStackingContext() &&
- layer->backgroundPaintLocation(&mainThreadScrollingReasons) &
- BackgroundPaintInScrollingContents &&
+ layer->backgroundPaintLocation() & BackgroundPaintInScrollingContents &&
layer->backgroundIsKnownToBeOpaqueInRect(
toLayoutBox(layer->layoutObject())->paddingBoxRect()) &&
!layer->compositesWithTransform() && !layer->compositesWithOpacity();
@@ -1767,19 +1765,18 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling(
!layer->compositor()->preferCompositingToLCDTextEnabled() &&
!backgroundSupportsLCDText) {
if (layer->compositesWithOpacity()) {
- mainThreadScrollingReasons |=
- MainThreadScrollingReason::kHasOpacityAndLCDText;
+ addStyleRelatedMainThreadScrollingReasons(
+ MainThreadScrollingReason::kHasOpacityAndLCDText);
}
if (layer->compositesWithTransform()) {
- mainThreadScrollingReasons |=
- MainThreadScrollingReason::kHasTransformAndLCDText;
+ addStyleRelatedMainThreadScrollingReasons(
+ MainThreadScrollingReason::kHasTransformAndLCDText);
}
if (!layer->backgroundIsKnownToBeOpaqueInRect(
toLayoutBox(layer->layoutObject())->paddingBoxRect())) {
- mainThreadScrollingReasons |=
- MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText;
+ addStyleRelatedMainThreadScrollingReasons(
+ MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText);
}
-
needsCompositedScrolling = false;
}
@@ -1788,25 +1785,21 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling(
// behind dashed borders). Resolve this case, or not, and update this check
// with the results.
if (layer->layoutObject()->style()->hasBorderRadius()) {
- mainThreadScrollingReasons |= MainThreadScrollingReason::kHasBorderRadius;
+ addStyleRelatedMainThreadScrollingReasons(
+ MainThreadScrollingReason::kHasBorderRadius);
needsCompositedScrolling = false;
}
if (layer->layoutObject()->hasClip() || layer->hasDescendantWithClipPath() ||
layer->hasAncestorWithClipPath()) {
- mainThreadScrollingReasons |=
- MainThreadScrollingReason::kHasClipRelatedProperty;
+ addStyleRelatedMainThreadScrollingReasons(
+ MainThreadScrollingReason::kHasClipRelatedProperty);
needsCompositedScrolling = false;
}
-
- if (mainThreadScrollingReasons) {
- addStyleRelatedMainThreadScrollingReasons(mainThreadScrollingReasons);
- }
-
return needsCompositedScrolling;
}
void PaintLayerScrollableArea::addStyleRelatedMainThreadScrollingReasons(
- const uint32_t reasons) {
+ const uint32_t reason) {
LocalFrame* frame = box().frame();
if (!frame)
return;
@@ -1814,14 +1807,8 @@ void PaintLayerScrollableArea::addStyleRelatedMainThreadScrollingReasons(
if (!frameView)
return;
- for (uint32_t reason = 1;
- reason < 1 << MainThreadScrollingReason::kMainThreadScrollingReasonCount;
- reason <<= 1) {
- if (reasons & reason) {
- frameView->adjustStyleRelatedMainThreadScrollingReasons(reason, true);
- m_reasons |= reason;
- }
- }
+ frameView->adjustStyleRelatedMainThreadScrollingReasons(reason, true);
+ m_reasons |= reason;
}
void PaintLayerScrollableArea::removeStyleRelatedMainThreadScrollingReasons() {
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698