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

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

Issue 2258523006: Convert Settings::rootLayerScrolls to RuntimeEnabledFeatures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add RAII-style helper to toggle REF. Rebase. Created 4 years, 4 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/PaintPropertyTreeBuilder.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
index e89252baba089cfe474b309d884650795ab36f7d..f57b66166d4eb51fe2e352176ad8449a072603d3 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -21,8 +21,7 @@ namespace blink {
void PaintPropertyTreeBuilder::buildTreeRootNodes(FrameView& rootFrame, PaintPropertyTreeBuilderContext& context)
{
- Settings* settings = rootFrame.frame().settings();
- if (settings && settings->rootLayerScrolls())
+ if (RuntimeEnabledFeatures::rootLayerScrollingEnabled())
return;
if (!rootFrame.rootTransform() || rootFrame.rootTransform()->parent()) {
@@ -41,8 +40,7 @@ void PaintPropertyTreeBuilder::buildTreeRootNodes(FrameView& rootFrame, PaintPro
void PaintPropertyTreeBuilder::buildTreeNodes(FrameView& frameView, PaintPropertyTreeBuilderContext& context)
{
- Settings* settings = frameView.frame().settings();
- if (settings && settings->rootLayerScrolls()) {
+ if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
LayoutView* layoutView = frameView.layoutView();
if (!layoutView)
return;
@@ -195,7 +193,7 @@ void PaintPropertyTreeBuilder::updateEffect(const LayoutObject& object, PaintPro
{
if (object.isLayoutView() && !context.currentEffect) {
const LayoutView& layoutView = toLayoutView(object);
- DCHECK(layoutView.frameView()->frame().settings()->rootLayerScrolls());
+ DCHECK(RuntimeEnabledFeatures::rootLayerScrollingEnabled());
DCHECK(layoutView.frameView()->frame().isMainFrame());
context.currentEffect = layoutView.getMutableForPainting().ensureObjectPaintProperties().createOrUpdateEffect(nullptr, 1.0);
return;
@@ -243,7 +241,7 @@ void PaintPropertyTreeBuilder::updateLocalBorderBoxContext(const LayoutObject& o
if (!context.current.clip) {
DCHECK(object.isLayoutView());
DCHECK(toLayoutView(object).frameView()->frame().isMainFrame());
- DCHECK(toLayoutView(object).frameView()->frame().settings()->rootLayerScrolls());
+ DCHECK(RuntimeEnabledFeatures::rootLayerScrollingEnabled());
borderBoxContext->propertyTreeState.clip = ClipPaintPropertyNode::create(nullptr, context.current.transform, FloatRoundedRect(LayoutRect::infiniteIntRect()));
context.current.clip = borderBoxContext->propertyTreeState.clip.get();
}
@@ -362,11 +360,7 @@ void PaintPropertyTreeBuilder::updateScrollTranslation(const LayoutObject& objec
PaintLayer* layer = toLayoutBoxModelObject(object).layer();
DCHECK(layer);
DoubleSize scrollOffset = layer->getScrollableArea()->scrollOffset();
- bool forceScrollingForLayoutView = false;
- if (object.isLayoutView()) {
- Settings* settings = object.document().settings();
- forceScrollingForLayoutView = (settings && settings->rootLayerScrolls());
- }
+ bool forceScrollingForLayoutView = object.isLayoutView() && RuntimeEnabledFeatures::rootLayerScrollingEnabled();
if (forceScrollingForLayoutView || !scrollOffset.isZero() || layer->scrollsOverflow()) {
TransformationMatrix matrix = TransformationMatrix().translate(-scrollOffset.width(), -scrollOffset.height());
context.current.transform = object.getMutableForPainting().ensureObjectPaintProperties().createOrUpdateScrollTranslation(
@@ -388,8 +382,7 @@ void PaintPropertyTreeBuilder::updateOutOfFlowContext(const LayoutObject& object
}
if (object.isLayoutView()) {
- Settings* settings = object.document().settings();
- if (settings && settings->rootLayerScrolls()) {
+ if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
context.fixedPosition = context.current;
const TransformPaintPropertyNode* transform = object.objectPaintProperties()->paintOffsetTranslation();
DCHECK(transform);

Powered by Google App Engine
This is Rietveld 408576698