| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| 197 | 201 |
| 198 updateOpacity(renderer()->style()); | 202 updateOpacity(renderer()->style()); |
| 199 updateTransform(renderer()->style()); | 203 updateTransform(renderer()->style()); |
| 200 updateFilters(renderer()->style()); | 204 updateFilters(renderer()->style()); |
| 201 | 205 |
| 202 if (RuntimeEnabledFeatures::cssCompositingEnabled()) | 206 if (RuntimeEnabledFeatures::cssCompositingEnabled()) |
| 203 updateLayerBlendMode(renderer()->style()); | 207 updateLayerBlendMode(renderer()->style()); |
| 204 } | 208 } |
| 205 | 209 |
| 206 void RenderLayerBacking::destroyGraphicsLayers() | 210 void RenderLayerBacking::destroyGraphicsLayers() |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 366 |
| 363 if (flags & IsUpdateRoot) { | 367 if (flags & IsUpdateRoot) { |
| 364 updateGraphicsLayerGeometry(); | 368 updateGraphicsLayerGeometry(); |
| 365 layerCompositor->updateRootLayerPosition(); | 369 layerCompositor->updateRootLayerPosition(); |
| 366 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon
tainer(); | 370 RenderLayer* stackingContainer = m_owningLayer->enclosingStackingCon
tainer(); |
| 367 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont
ainer && (stackingContainer != m_owningLayer)) | 371 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont
ainer && (stackingContainer != m_owningLayer)) |
| 368 layerCompositor->updateCompositingDescendantGeometry(stackingCon
tainer, stackingContainer, flags & CompositingChildrenOnly); | 372 layerCompositor->updateCompositingDescendantGeometry(stackingCon
tainer, stackingContainer, flags & CompositingChildrenOnly); |
| 369 } | 373 } |
| 370 } | 374 } |
| 371 | 375 |
| 372 if (flags & NeedsFullRepaint && !paintsIntoWindow() && !paintsIntoComposited
Ancestor()) | 376 if (flags & NeedsFullRepaint && !paintsIntoCompositedAncestor()) |
| 373 setContentsNeedDisplay(); | 377 setContentsNeedDisplay(); |
| 374 } | 378 } |
| 375 | 379 |
| 376 bool RenderLayerBacking::updateGraphicsLayerConfiguration() | 380 bool RenderLayerBacking::updateGraphicsLayerConfiguration() |
| 377 { | 381 { |
| 378 RenderLayerCompositor* compositor = this->compositor(); | 382 RenderLayerCompositor* compositor = this->compositor(); |
| 379 RenderObject* renderer = this->renderer(); | 383 RenderObject* renderer = this->renderer(); |
| 380 | 384 |
| 381 m_owningLayer->updateDescendantDependentFlags(); | 385 m_owningLayer->updateDescendantDependentFlags(); |
| 382 m_owningLayer->updateZOrderLists(); | 386 m_owningLayer->updateZOrderLists(); |
| (...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 } | 1315 } |
| 1312 | 1316 |
| 1313 // Conservative test for having no rendered children. | 1317 // Conservative test for having no rendered children. |
| 1314 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const | 1318 bool RenderLayerBacking::hasVisibleNonCompositingDescendantLayers() const |
| 1315 { | 1319 { |
| 1316 return hasVisibleNonCompositingDescendant(m_owningLayer); | 1320 return hasVisibleNonCompositingDescendant(m_owningLayer); |
| 1317 } | 1321 } |
| 1318 | 1322 |
| 1319 bool RenderLayerBacking::containsPaintedContent() const | 1323 bool RenderLayerBacking::containsPaintedContent() const |
| 1320 { | 1324 { |
| 1321 if (isSimpleContainerCompositingLayer() || paintsIntoWindow() || paintsIntoC
ompositedAncestor() || m_artificiallyInflatedBounds || m_owningLayer->isReflecti
on()) | 1325 if (isSimpleContainerCompositingLayer() || paintsIntoCompositedAncestor() ||
m_artificiallyInflatedBounds || m_owningLayer->isReflection()) |
| 1322 return false; | 1326 return false; |
| 1323 | 1327 |
| 1324 if (isDirectlyCompositedImage()) | 1328 if (isDirectlyCompositedImage()) |
| 1325 return false; | 1329 return false; |
| 1326 | 1330 |
| 1327 // FIXME: we could optimize cases where the image, video or canvas is known
to fill the border box entirely, | 1331 // FIXME: we could optimize cases where the image, video or canvas is known
to fill the border box entirely, |
| 1328 // and set background color on the layer in that case, instead of allocating
backing store and painting. | 1332 // and set background color on the layer in that case, instead of allocating
backing store and painting. |
| 1329 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo()
) | 1333 if (renderer()->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo()
) |
| 1330 return m_owningLayer->hasBoxDecorationsOrBackground(); | 1334 return m_owningLayer->hasBoxDecorationsOrBackground(); |
| 1331 | 1335 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1494 { | 1498 { |
| 1495 if (m_ancestorClippingLayer) | 1499 if (m_ancestorClippingLayer) |
| 1496 return m_ancestorClippingLayer.get(); | 1500 return m_ancestorClippingLayer.get(); |
| 1497 | 1501 |
| 1498 if (m_contentsContainmentLayer) | 1502 if (m_contentsContainmentLayer) |
| 1499 return m_contentsContainmentLayer.get(); | 1503 return m_contentsContainmentLayer.get(); |
| 1500 | 1504 |
| 1501 return m_graphicsLayer.get(); | 1505 return m_graphicsLayer.get(); |
| 1502 } | 1506 } |
| 1503 | 1507 |
| 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 | |
| 1513 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) | 1508 void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking) |
| 1514 { | 1509 { |
| 1515 if (requiresOwnBacking == m_requiresOwnBackingStore) | 1510 if (requiresOwnBacking == m_requiresOwnBackingStore) |
| 1516 return; | 1511 return; |
| 1517 | 1512 |
| 1518 m_requiresOwnBackingStore = requiresOwnBacking; | 1513 m_requiresOwnBackingStore = requiresOwnBacking; |
| 1519 | 1514 |
| 1520 // This affects the answer to paintsIntoCompositedAncestor(), which in turn
affects | 1515 // This affects the answer to paintsIntoCompositedAncestor(), which in turn
affects |
| 1521 // cached clip rects, so when it changes we have to clear clip rects on desc
endants. | 1516 // cached clip rects, so when it changes we have to clear clip rects on desc
endants. |
| 1522 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects); | 1517 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1583 IntRect layerDirtyRect = r; | 1578 IntRect layerDirtyRect = r; |
| 1584 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer()); | 1579 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer()); |
| 1585 m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect); | 1580 m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect); |
| 1586 } | 1581 } |
| 1587 } | 1582 } |
| 1588 | 1583 |
| 1589 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap
hicsContext* context, | 1584 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap
hicsContext* context, |
| 1590 const IntRect& paintDirtyRect, // In the coords of rootLayer
. | 1585 const IntRect& paintDirtyRect, // In the coords of rootLayer
. |
| 1591 PaintBehavior paintBehavior, GraphicsLayerPaintingPhase pain
tingPhase) | 1586 PaintBehavior paintBehavior, GraphicsLayerPaintingPhase pain
tingPhase) |
| 1592 { | 1587 { |
| 1593 if (paintsIntoWindow() || paintsIntoCompositedAncestor()) { | 1588 if (paintsIntoCompositedAncestor()) { |
| 1594 ASSERT_NOT_REACHED(); | 1589 ASSERT_NOT_REACHED(); |
| 1595 return; | 1590 return; |
| 1596 } | 1591 } |
| 1597 | 1592 |
| 1598 FontCachePurgePreventer fontCachePurgePreventer; | 1593 FontCachePurgePreventer fontCachePurgePreventer; |
| 1599 | 1594 |
| 1600 RenderLayer::PaintLayerFlags paintFlags = 0; | 1595 RenderLayer::PaintLayerFlags paintFlags = 0; |
| 1601 if (paintingPhase & GraphicsLayerPaintBackground) | 1596 if (paintingPhase & GraphicsLayerPaintBackground) |
| 1602 paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase; | 1597 paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase; |
| 1603 if (paintingPhase & GraphicsLayerPaintForeground) | 1598 if (paintingPhase & GraphicsLayerPaintForeground) |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1955 info.addMember(m_childContainmentLayer, "childContainmentLayer"); | 1950 info.addMember(m_childContainmentLayer, "childContainmentLayer"); |
| 1956 info.addMember(m_maskLayer, "maskLayer"); | 1951 info.addMember(m_maskLayer, "maskLayer"); |
| 1957 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar")
; | 1952 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar")
; |
| 1958 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); | 1953 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); |
| 1959 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); | 1954 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); |
| 1960 info.addMember(m_scrollingLayer, "scrollingLayer"); | 1955 info.addMember(m_scrollingLayer, "scrollingLayer"); |
| 1961 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); | 1956 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); |
| 1962 } | 1957 } |
| 1963 | 1958 |
| 1964 } // namespace WebCore | 1959 } // namespace WebCore |
| OLD | NEW |