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

Side by Side Diff: Source/core/rendering/RenderLayerBacking.cpp

Issue 15425006: Revert "Remove NonCompositedContentHost" and follow-up rebaselining. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 void RenderLayerBacking::createPrimaryGraphicsLayer() 186 void RenderLayerBacking::createPrimaryGraphicsLayer()
187 { 187 {
188 String layerName; 188 String layerName;
189 #ifndef NDEBUG 189 #ifndef NDEBUG
190 layerName = m_owningLayer->debugName(); 190 layerName = m_owningLayer->debugName();
191 #endif 191 #endif
192 192
193 m_graphicsLayer = createGraphicsLayer(layerName); 193 m_graphicsLayer = createGraphicsLayer(layerName);
194 194
195 if (m_isMainFrameRenderViewLayer) { 195 if (m_isMainFrameRenderViewLayer)
196 m_graphicsLayer->setContentsOpaque(true); 196 m_graphicsLayer->setContentsOpaque(true);
197 #if !OS(ANDROID)
198 m_graphicsLayer->contentLayer()->setDrawCheckerboardForMissingTiles(true );
199 #endif
200 }
201 197
202 updateOpacity(renderer()->style()); 198 updateOpacity(renderer()->style());
203 updateTransform(renderer()->style()); 199 updateTransform(renderer()->style());
204 updateFilters(renderer()->style()); 200 updateFilters(renderer()->style());
205 201
206 if (RuntimeEnabledFeatures::cssCompositingEnabled()) 202 if (RuntimeEnabledFeatures::cssCompositingEnabled())
207 updateLayerBlendMode(renderer()->style()); 203 updateLayerBlendMode(renderer()->style());
208 } 204 }
209 205
210 void RenderLayerBacking::destroyGraphicsLayers() 206 void RenderLayerBacking::destroyGraphicsLayers()
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 362
367 if (flags & IsUpdateRoot) { 363 if (flags & IsUpdateRoot) {
368 updateGraphicsLayerGeometry(); 364 updateGraphicsLayerGeometry();
369 layerCompositor->updateRootLayerPosition(); 365 layerCompositor->updateRootLayerPosition();
370 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon tainer(); 366 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon tainer();
371 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont ainer && (stackingContainer != m_owningLayer)) 367 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont ainer && (stackingContainer != m_owningLayer))
372 layerCompositor->updateCompositingDescendantGeometry(stackingCon tainer, stackingContainer, flags & CompositingChildrenOnly); 368 layerCompositor->updateCompositingDescendantGeometry(stackingCon tainer, stackingContainer, flags & CompositingChildrenOnly);
373 } 369 }
374 } 370 }
375 371
376 if (flags & NeedsFullRepaint && !paintsIntoCompositedAncestor()) 372 if (flags & NeedsFullRepaint && !paintsIntoWindow() && !paintsIntoComposited Ancestor())
377 setContentsNeedDisplay(); 373 setContentsNeedDisplay();
378 } 374 }
379 375
380 bool RenderLayerBacking::updateGraphicsLayerConfiguration() 376 bool RenderLayerBacking::updateGraphicsLayerConfiguration()
381 { 377 {
382 RenderLayerCompositor* compositor = this->compositor(); 378 RenderLayerCompositor* compositor = this->compositor();
383 RenderObject* renderer = this->renderer(); 379 RenderObject* renderer = this->renderer();
384 380
385 m_owningLayer->updateDescendantDependentFlags(); 381 m_owningLayer->updateDescendantDependentFlags();
386 m_owningLayer->updateZOrderLists(); 382 m_owningLayer->updateZOrderLists();
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 } 1311 }
1316 1312
1317 // Conservative test for having no rendered children. 1313 // Conservative test for having no rendered children.
1318 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const 1314 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const
1319 { 1315 {
1320 return hasVisibleNonCompositingDescendant(m_owningLayer); 1316 return hasVisibleNonCompositingDescendant(m_owningLayer);
1321 } 1317 }
1322 1318
1323 bool RenderLayerBacking::containsPaintedContent() const 1319 bool RenderLayerBacking::containsPaintedContent() const
1324 { 1320 {
1325 if (isSimpleContainerCompositingLayer() || paintsIntoCompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflection()) 1321 if (isSimpleContainerCompositingLayer() || paintsIntoWindow() || paintsIntoC ompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflecti on())
1326 return false; 1322 return false;
1327 1323
1328 if (isDirectlyCompositedImage()) 1324 if (isDirectlyCompositedImage())
1329 return false; 1325 return false;
1330 1326
1331 // FIXME: we could optimize cases where the image, video or canvas is known to fill the border box entirely, 1327 // FIXME: we could optimize cases where the image, video or canvas is known to fill the border box entirely,
1332 // and set background color on the layer in that case, instead of allocating backing store and painting. 1328 // and set background color on the layer in that case, instead of allocating backing store and painting.
1333 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo() ) 1329 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo() )
1334 return m_owningLayer->hasBoxDecorationsOrBackground(); 1330 return m_owningLayer->hasBoxDecorationsOrBackground();
1335 1331
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 { 1494 {
1499 if (m_ancestorClippingLayer) 1495 if (m_ancestorClippingLayer)
1500 return m_ancestorClippingLayer.get(); 1496 return m_ancestorClippingLayer.get();
1501 1497
1502 if (m_contentsContainmentLayer) 1498 if (m_contentsContainmentLayer)
1503 return m_contentsContainmentLayer.get(); 1499 return m_contentsContainmentLayer.get();
1504 1500
1505 return m_graphicsLayer.get(); 1501 return m_graphicsLayer.get();
1506 } 1502 }
1507 1503
1504 bool RenderLayerBacking::paintsIntoWindow() const
1505 {
1506 if (m_owningLayer->isRootLayer()) {
1507 return compositor()->rootLayerAttachment() != RenderLayerCompositor::Roo tLayerAttachedViaEnclosingFrame;
1508 }
1509
1510 return false;
1511 }
1512
1508 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) 1513 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking)
1509 { 1514 {
1510 if (requiresOwnBacking == m_requiresOwnBackingStore) 1515 if (requiresOwnBacking == m_requiresOwnBackingStore)
1511 return; 1516 return;
1512 1517
1513 m_requiresOwnBackingStore = requiresOwnBacking; 1518 m_requiresOwnBackingStore = requiresOwnBacking;
1514 1519
1515 // This affects the answer to paintsIntoCompositedAncestor(), which in turn affects 1520 // This affects the answer to paintsIntoCompositedAncestor(), which in turn affects
1516 // cached clip rects, so when it changes we have to clear clip rects on desc endants. 1521 // cached clip rects, so when it changes we have to clear clip rects on desc endants.
1517 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects); 1522 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 IntRect layerDirtyRect = r; 1583 IntRect layerDirtyRect = r;
1579 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer()); 1584 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer());
1580 m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect); 1585 m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect);
1581 } 1586 }
1582 } 1587 }
1583 1588
1584 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap hicsContext* context, 1589 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap hicsContext* context,
1585 const IntRect& paintDirtyRect, // In the coords of rootLayer . 1590 const IntRect& paintDirtyRect, // In the coords of rootLayer .
1586 PaintBehavior paintBehavior, GraphicsLayerPaintingPhase pain tingPhase) 1591 PaintBehavior paintBehavior, GraphicsLayerPaintingPhase pain tingPhase)
1587 { 1592 {
1588 if (paintsIntoCompositedAncestor()) { 1593 if (paintsIntoWindow() || paintsIntoCompositedAncestor()) {
1589 ASSERT_NOT_REACHED(); 1594 ASSERT_NOT_REACHED();
1590 return; 1595 return;
1591 } 1596 }
1592 1597
1593 FontCachePurgePreventer fontCachePurgePreventer; 1598 FontCachePurgePreventer fontCachePurgePreventer;
1594 1599
1595 RenderLayer::PaintLayerFlags paintFlags = 0; 1600 RenderLayer::PaintLayerFlags paintFlags = 0;
1596 if (paintingPhase & GraphicsLayerPaintBackground) 1601 if (paintingPhase & GraphicsLayerPaintBackground)
1597 paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase; 1602 paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase;
1598 if (paintingPhase & GraphicsLayerPaintForeground) 1603 if (paintingPhase & GraphicsLayerPaintForeground)
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1950 info.addMember(m_childContainmentLayer, "childContainmentLayer"); 1955 info.addMember(m_childContainmentLayer, "childContainmentLayer");
1951 info.addMember(m_maskLayer, "maskLayer"); 1956 info.addMember(m_maskLayer, "maskLayer");
1952 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ; 1957 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ;
1953 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); 1958 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar");
1954 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 1959 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
1955 info.addMember(m_scrollingLayer, "scrollingLayer"); 1960 info.addMember(m_scrollingLayer, "scrollingLayer");
1956 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); 1961 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer");
1957 } 1962 }
1958 1963
1959 } // namespace WebCore 1964 } // namespace WebCore
OLDNEW
« 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