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

Unified Diff: Source/core/rendering/RenderLayerBacking.cpp

Issue 15973002: Remove NonCompositedContentHost -- Take 2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: adding back annotation. final rebase. Created 7 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
« no previous file with comments | « Source/core/rendering/RenderLayerBacking.h ('k') | Source/core/rendering/RenderLayerCompositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayerBacking.cpp
diff --git a/Source/core/rendering/RenderLayerBacking.cpp b/Source/core/rendering/RenderLayerBacking.cpp
index 2c41429863a1060a6d2efd30e172e3e2924e47d7..a5a84c2b7768a81120c75fe9546c869b246ec6c4 100644
--- a/Source/core/rendering/RenderLayerBacking.cpp
+++ b/Source/core/rendering/RenderLayerBacking.cpp
@@ -195,8 +195,10 @@ void RenderLayerBacking::createPrimaryGraphicsLayer()
m_graphicsLayer = createGraphicsLayer(layerName, m_owningLayer->compositingReasons());
+#if !OS(ANDROID)
if (m_isMainFrameRenderViewLayer)
- m_graphicsLayer->setContentsOpaque(true);
+ m_graphicsLayer->contentLayer()->setDrawCheckerboardForMissingTiles(true);
+#endif
updateOpacity(renderer()->style());
updateTransform(renderer()->style());
@@ -268,6 +270,13 @@ void RenderLayerBacking::updateLayerBlendMode(const RenderStyle*)
{
}
+void RenderLayerBacking::updateContentsOpaque()
+{
+ // For non-root layers, background is always painted by the primary graphics layer.
+ ASSERT(m_isMainFrameRenderViewLayer || !m_backgroundLayer);
+ m_graphicsLayer->setContentsOpaque(m_owningLayer->backgroundIsKnownToBeOpaqueInRect(compositedBounds()));
+}
+
static bool hasNonZeroTransformOrigin(const RenderObject* renderer)
{
RenderStyle* style = renderer->style();
@@ -379,7 +388,7 @@ void RenderLayerBacking::updateAfterLayout(UpdateAfterLayoutFlags flags)
}
}
- if (flags & NeedsFullRepaint && !paintsIntoWindow() && !paintsIntoCompositedAncestor())
+ if (flags & NeedsFullRepaint && !paintsIntoCompositedAncestor())
setContentsNeedDisplay();
}
@@ -572,11 +581,6 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
if (m_boundsConstrainedByClipping)
m_graphicsLayer->setNeedsDisplay();
}
- if (!m_isMainFrameRenderViewLayer) {
- // For non-root layers, background is always painted by the primary graphics layer.
- ASSERT(!m_backgroundLayer);
- m_graphicsLayer->setContentsOpaque(m_owningLayer->backgroundIsKnownToBeOpaqueInRect(localCompositingBounds));
- }
// If we have a layer that clips children, position it.
IntRect clippingBox;
@@ -726,6 +730,7 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
updateContentsRect(isSimpleContainer);
updateBackgroundColor(isSimpleContainer);
updateDrawsContent(isSimpleContainer);
+ updateContentsOpaque();
updateAfterWidgetResize();
registerScrollingLayers();
@@ -1330,7 +1335,7 @@ bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const
bool RenderLayerBacking::containsPaintedContent() const
{
- if (isSimpleContainerCompositingLayer() || paintsIntoWindow() || paintsIntoCompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflection())
+ if (isSimpleContainerCompositingLayer() || paintsIntoCompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflection())
return false;
if (isDirectlyCompositedImage())
@@ -1513,15 +1518,6 @@ GraphicsLayer* RenderLayerBacking::childForSuperlayers() const
return m_graphicsLayer.get();
}
-bool RenderLayerBacking::paintsIntoWindow() const
-{
- if (m_owningLayer->isRootLayer()) {
- return compositor()->rootLayerAttachment() != RenderLayerCompositor::RootLayerAttachedViaEnclosingFrame;
- }
-
- return false;
-}
-
void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking)
{
if (requiresOwnBacking == m_requiresOwnBackingStore)
@@ -1602,7 +1598,7 @@ void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap
const IntRect& paintDirtyRect, // In the coords of rootLayer.
PaintBehavior paintBehavior, GraphicsLayerPaintingPhase paintingPhase)
{
- if (paintsIntoWindow() || paintsIntoCompositedAncestor()) {
+ if (paintsIntoCompositedAncestor()) {
ASSERT_NOT_REACHED();
return;
}
« no previous file with comments | « Source/core/rendering/RenderLayerBacking.h ('k') | Source/core/rendering/RenderLayerCompositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698