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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 1987283003: Use counters for opacity with transform-style:preserve-3d (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index eb384f57d0eac03a348ffce525e654df8972a28a..e9ff85796c123d3768c11ef81048390a6f1f42b8 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -400,6 +400,7 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
PaintLayerCompositor* compositor = this->compositor();
LayoutObject* layoutObject = this->layoutObject();
+ const ComputedStyle& style = layoutObject->styleRef();
bool layerConfigChanged = false;
setBackgroundLayerPaintsFixedRootBackground(compositor->needsFixedRootBackgroundLayer(&m_owningLayer));
@@ -438,10 +439,7 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), requiresVerticalScrollbarLayer(), requiresScrollCornerLayer(), needsAncestorClip))
layerConfigChanged = true;
- bool hasPerspective = false;
- // FIXME: Can |style| be really null that late in the DocumentCycle?
- if (const ComputedStyle* style = layoutObject->style())
- hasPerspective = style->hasPerspective();
+ bool hasPerspective = style.hasPerspective();
bool needsChildTransformLayer = hasPerspective && layoutObject->isBox();
if (updateChildTransformLayer(needsChildTransformLayer))
layerConfigChanged = true;
@@ -471,8 +469,8 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
bool hasChildClippingLayer = compositor->clipsCompositingDescendants(&m_owningLayer) && (hasClippingLayer() || hasScrollingLayer());
// If we have a border radius or clip path on a scrolling layer, we need a clipping mask to properly
// clip the scrolled contents, even if there are no composited descendants.
- bool hasClipPath = layoutObject->style()->clipPath();
- bool needsChildClippingMask = (hasClipPath || layoutObject->style()->hasBorderRadius()) && (hasChildClippingLayer || isAcceleratedContents(layoutObject) || hasScrollingLayer());
+ bool hasClipPath = style.clipPath();
+ bool needsChildClippingMask = (hasClipPath || style.hasBorderRadius()) && (hasChildClippingLayer || isAcceleratedContents(layoutObject) || hasScrollingLayer());
GraphicsLayer* layerToApplyChildClippingMask = nullptr;
bool shouldApplyChildClippingMaskOnContents = false;
@@ -556,7 +554,11 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
updateElementIdAndCompositorMutableProperties();
- m_graphicsLayer->setHasWillChangeTransformHint(m_owningLayer.layoutObject()->styleRef().hasWillChangeTransformHint());
+ m_graphicsLayer->setHasWillChangeTransformHint(style.hasWillChangeTransformHint());
+
+ m_owningLayer.update3DTransformedDescendantStatus();
+ if (style.preserves3D() && style.hasOpacity() && m_owningLayer.has3DTransformedDescendant())
+ UseCounter::count(layoutObject->document(), UseCounter::OpacityWithPreserve3DQuirk);
return layerConfigChanged;
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/core/paint/PaintLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698