Chromium Code Reviews

Unified Diff: Source/core/rendering/RenderLayer.h

Issue 24921002: Make compositingState explicit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed first round of reviewer comments Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: Source/core/rendering/RenderLayer.h
diff --git a/Source/core/rendering/RenderLayer.h b/Source/core/rendering/RenderLayer.h
index 2b071c9beae4337f63d2b430a4a18b5f53f10a31..3ea2dc7622c0b0533e520c0881e00529559b71e6 100644
--- a/Source/core/rendering/RenderLayer.h
+++ b/Source/core/rendering/RenderLayer.h
@@ -462,12 +462,21 @@ public:
// Only safe to call from RenderLayerModelObject::destroyLayer()
void operator delete(void*);
- bool isComposited() const { return m_backing != 0; }
- bool hasCompositedMask() const;
- bool hasCompositedClippingMask() const;
- RenderLayerBacking* backing() const { return m_backing.get(); }
+ CompositingState compositingState() const;
+
+ RenderLayerBacking* backing() const
+ {
+ // NOTE: Checking whether backing exists is equivalent to asking if you are in one of these two compositing states.
+ // If this is why you are using backing(), please try to use compositingState() instead.
+ ASSERT(compositingState() == HasOwnBackingButPaintsIntoAncestor || compositingState() == PaintsIntoOwnBacking);
+ return m_backing.get();
+ }
+
RenderLayerBacking* ensureBacking();
void clearBacking(bool layerBeingDestroyed = false);
+
+ bool hasCompositedMask() const;
+ bool hasCompositedClippingMask() const;
bool needsCompositedScrolling() const;
bool needsToBeStackingContainer() const;
@@ -480,7 +489,7 @@ public:
bool paintsWithTransparency(PaintBehavior paintBehavior) const
{
- return isTransparent() && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || !isComposited());
+ return isTransparent() && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || compositingState() != PaintsIntoOwnBacking);
}
bool paintsWithTransform(PaintBehavior) const;

Powered by Google App Engine