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

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

Issue 2001803002: Use counters for opacity with transform-style:preserve-3d (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: 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 36fd72053d6480b4c617dda7d2daa6e6123096b6..05a849ab41accbdea4589932c1eec4610074a0ef 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,6 +554,10 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
updateElementIdAndCompositorMutableProperties();
+ 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