Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 | 188 |
| 189 void RenderLayerBacking::createPrimaryGraphicsLayer() | 189 void RenderLayerBacking::createPrimaryGraphicsLayer() |
| 190 { | 190 { |
| 191 String layerName; | 191 String layerName; |
| 192 #ifndef NDEBUG | 192 #ifndef NDEBUG |
| 193 layerName = m_owningLayer->debugName(); | 193 layerName = m_owningLayer->debugName(); |
| 194 #endif | 194 #endif |
| 195 | 195 |
| 196 m_graphicsLayer = createGraphicsLayer(layerName, m_owningLayer->compositingR easons()); | 196 m_graphicsLayer = createGraphicsLayer(layerName, m_owningLayer->compositingR easons()); |
| 197 | 197 |
| 198 if (m_isMainFrameRenderViewLayer) | 198 if (m_isMainFrameRenderViewLayer) { |
| 199 m_graphicsLayer->setContentsOpaque(true); | 199 m_graphicsLayer->setContentsOpaque(toRenderView(renderer())->frameView() ->hasOpaqueBackground()); |
|
jamesr
2013/05/28 18:27:50
what updates this bit if WebView::setIsTransparent
| |
| 200 #if !OS(ANDROID) | |
| 201 m_graphicsLayer->contentLayer()->setDrawCheckerboardForMissingTiles(true ); | |
| 202 #endif | |
| 203 } | |
| 200 | 204 |
| 201 updateOpacity(renderer()->style()); | 205 updateOpacity(renderer()->style()); |
| 202 updateTransform(renderer()->style()); | 206 updateTransform(renderer()->style()); |
| 203 updateFilters(renderer()->style()); | 207 updateFilters(renderer()->style()); |
| 204 | 208 |
| 205 if (RuntimeEnabledFeatures::cssCompositingEnabled()) | 209 if (RuntimeEnabledFeatures::cssCompositingEnabled()) |
| 206 updateLayerBlendMode(renderer()->style()); | 210 updateLayerBlendMode(renderer()->style()); |
| 207 } | 211 } |
| 208 | 212 |
| 209 void RenderLayerBacking::destroyGraphicsLayers() | 213 void RenderLayerBacking::destroyGraphicsLayers() |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 372 | 376 |
| 373 if (flags & IsUpdateRoot) { | 377 if (flags & IsUpdateRoot) { |
| 374 updateGraphicsLayerGeometry(); | 378 updateGraphicsLayerGeometry(); |
| 375 layerCompositor->updateRootLayerPosition(); | 379 layerCompositor->updateRootLayerPosition(); |
| 376 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon tainer(); | 380 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon tainer(); |
| 377 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont ainer && (stackingContainer != m_owningLayer)) | 381 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont ainer && (stackingContainer != m_owningLayer)) |
| 378 layerCompositor->updateCompositingDescendantGeometry(stackingCon tainer, stackingContainer, flags & CompositingChildrenOnly); | 382 layerCompositor->updateCompositingDescendantGeometry(stackingCon tainer, stackingContainer, flags & CompositingChildrenOnly); |
| 379 } | 383 } |
| 380 } | 384 } |
| 381 | 385 |
| 382 if (flags & NeedsFullRepaint && !paintsIntoWindow() && !paintsIntoComposited Ancestor()) | 386 if (flags & NeedsFullRepaint && !paintsIntoCompositedAncestor()) |
| 383 setContentsNeedDisplay(); | 387 setContentsNeedDisplay(); |
| 384 } | 388 } |
| 385 | 389 |
| 386 bool RenderLayerBacking::updateGraphicsLayerConfiguration() | 390 bool RenderLayerBacking::updateGraphicsLayerConfiguration() |
| 387 { | 391 { |
| 388 RenderLayerCompositor* compositor = this->compositor(); | 392 RenderLayerCompositor* compositor = this->compositor(); |
| 389 RenderObject* renderer = this->renderer(); | 393 RenderObject* renderer = this->renderer(); |
| 390 | 394 |
| 391 m_owningLayer->updateDescendantDependentFlags(); | 395 m_owningLayer->updateDescendantDependentFlags(); |
| 392 m_owningLayer->updateZOrderLists(); | 396 m_owningLayer->updateZOrderLists(); |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1323 } | 1327 } |
| 1324 | 1328 |
| 1325 // Conservative test for having no rendered children. | 1329 // Conservative test for having no rendered children. |
| 1326 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const | 1330 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const |
| 1327 { | 1331 { |
| 1328 return hasVisibleNonCompositingDescendant(m_owningLayer); | 1332 return hasVisibleNonCompositingDescendant(m_owningLayer); |
| 1329 } | 1333 } |
| 1330 | 1334 |
| 1331 bool RenderLayerBacking::containsPaintedContent() const | 1335 bool RenderLayerBacking::containsPaintedContent() const |
| 1332 { | 1336 { |
| 1333 if (isSimpleContainerCompositingLayer() || paintsIntoWindow() || paintsIntoC ompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflecti on()) | 1337 if (isSimpleContainerCompositingLayer() || paintsIntoCompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflection()) |
| 1334 return false; | 1338 return false; |
| 1335 | 1339 |
| 1336 if (isDirectlyCompositedImage()) | 1340 if (isDirectlyCompositedImage()) |
| 1337 return false; | 1341 return false; |
| 1338 | 1342 |
| 1339 // FIXME: we could optimize cases where the image, video or canvas is known to fill the border box entirely, | 1343 // FIXME: we could optimize cases where the image, video or canvas is known to fill the border box entirely, |
| 1340 // and set background color on the layer in that case, instead of allocating backing store and painting. | 1344 // and set background color on the layer in that case, instead of allocating backing store and painting. |
| 1341 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo() ) | 1345 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo() ) |
| 1342 return m_owningLayer->hasBoxDecorationsOrBackground(); | 1346 return m_owningLayer->hasBoxDecorationsOrBackground(); |
| 1343 | 1347 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1506 { | 1510 { |
| 1507 if (m_ancestorClippingLayer) | 1511 if (m_ancestorClippingLayer) |
| 1508 return m_ancestorClippingLayer.get(); | 1512 return m_ancestorClippingLayer.get(); |
| 1509 | 1513 |
| 1510 if (m_contentsContainmentLayer) | 1514 if (m_contentsContainmentLayer) |
| 1511 return m_contentsContainmentLayer.get(); | 1515 return m_contentsContainmentLayer.get(); |
| 1512 | 1516 |
| 1513 return m_graphicsLayer.get(); | 1517 return m_graphicsLayer.get(); |
| 1514 } | 1518 } |
| 1515 | 1519 |
| 1516 bool RenderLayerBacking::paintsIntoWindow() const | |
| 1517 { | |
| 1518 if (m_owningLayer->isRootLayer()) { | |
| 1519 return compositor()->rootLayerAttachment() != RenderLayerCompositor::Roo tLayerAttachedViaEnclosingFrame; | |
| 1520 } | |
| 1521 | |
| 1522 return false; | |
| 1523 } | |
| 1524 | |
| 1525 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) | 1520 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) |
| 1526 { | 1521 { |
| 1527 if (requiresOwnBacking == m_requiresOwnBackingStore) | 1522 if (requiresOwnBacking == m_requiresOwnBackingStore) |
| 1528 return; | 1523 return; |
| 1529 | 1524 |
| 1530 m_requiresOwnBackingStore = requiresOwnBacking; | 1525 m_requiresOwnBackingStore = requiresOwnBacking; |
| 1531 | 1526 |
| 1532 // This affects the answer to paintsIntoCompositedAncestor(), which in turn affects | 1527 // This affects the answer to paintsIntoCompositedAncestor(), which in turn affects |
| 1533 // cached clip rects, so when it changes we have to clear clip rects on desc endants. | 1528 // cached clip rects, so when it changes we have to clear clip rects on desc endants. |
| 1534 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects); | 1529 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1595 IntRect layerDirtyRect = r; | 1590 IntRect layerDirtyRect = r; |
| 1596 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer()); | 1591 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer()); |
| 1597 m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect); | 1592 m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect); |
| 1598 } | 1593 } |
| 1599 } | 1594 } |
| 1600 | 1595 |
| 1601 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap hicsContext* context, | 1596 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap hicsContext* context, |
| 1602 const IntRect& paintDirtyRect, // In the coords of rootLayer . | 1597 const IntRect& paintDirtyRect, // In the coords of rootLayer . |
| 1603 PaintBehavior paintBehavior, GraphicsLayerPaintingPhase pain tingPhase) | 1598 PaintBehavior paintBehavior, GraphicsLayerPaintingPhase pain tingPhase) |
| 1604 { | 1599 { |
| 1605 if (paintsIntoWindow() || paintsIntoCompositedAncestor()) { | 1600 if (paintsIntoCompositedAncestor()) { |
| 1606 ASSERT_NOT_REACHED(); | 1601 ASSERT_NOT_REACHED(); |
| 1607 return; | 1602 return; |
| 1608 } | 1603 } |
| 1609 | 1604 |
| 1610 FontCachePurgePreventer fontCachePurgePreventer; | 1605 FontCachePurgePreventer fontCachePurgePreventer; |
| 1611 | 1606 |
| 1612 RenderLayer::PaintLayerFlags paintFlags = 0; | 1607 RenderLayer::PaintLayerFlags paintFlags = 0; |
| 1613 if (paintingPhase & GraphicsLayerPaintBackground) | 1608 if (paintingPhase & GraphicsLayerPaintBackground) |
| 1614 paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase; | 1609 paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase; |
| 1615 if (paintingPhase & GraphicsLayerPaintForeground) | 1610 if (paintingPhase & GraphicsLayerPaintForeground) |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1967 info.addMember(m_childContainmentLayer, "childContainmentLayer"); | 1962 info.addMember(m_childContainmentLayer, "childContainmentLayer"); |
| 1968 info.addMember(m_maskLayer, "maskLayer"); | 1963 info.addMember(m_maskLayer, "maskLayer"); |
| 1969 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ; | 1964 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ; |
| 1970 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); | 1965 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); |
| 1971 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); | 1966 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); |
| 1972 info.addMember(m_scrollingLayer, "scrollingLayer"); | 1967 info.addMember(m_scrollingLayer, "scrollingLayer"); |
| 1973 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); | 1968 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); |
| 1974 } | 1969 } |
| 1975 | 1970 |
| 1976 } // namespace WebCore | 1971 } // namespace WebCore |
| OLD | NEW |