| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 #endif | 192 #endif |
| 193 | 193 |
| 194 m_graphicsLayer = createGraphicsLayer(layerName); | 194 m_graphicsLayer = createGraphicsLayer(layerName); |
| 195 | 195 |
| 196 if (m_isMainFrameRenderViewLayer) | 196 if (m_isMainFrameRenderViewLayer) |
| 197 m_graphicsLayer->setContentsOpaque(true); | 197 m_graphicsLayer->setContentsOpaque(true); |
| 198 | 198 |
| 199 updateOpacity(renderer()->style()); | 199 updateOpacity(renderer()->style()); |
| 200 updateTransform(renderer()->style()); | 200 updateTransform(renderer()->style()); |
| 201 updateFilters(renderer()->style()); | 201 updateFilters(renderer()->style()); |
| 202 #if ENABLE(CSS_COMPOSITING) | 202 |
| 203 updateLayerBlendMode(renderer()->style()); | 203 if (RuntimeEnabledFeatures::cssCompositingEnabled()) |
| 204 #endif | 204 updateLayerBlendMode(renderer()->style()); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void RenderLayerBacking::destroyGraphicsLayers() | 207 void RenderLayerBacking::destroyGraphicsLayers() |
| 208 { | 208 { |
| 209 if (m_graphicsLayer) | 209 if (m_graphicsLayer) |
| 210 m_graphicsLayer->removeFromParent(); | 210 m_graphicsLayer->removeFromParent(); |
| 211 | 211 |
| 212 m_ancestorClippingLayer = nullptr; | 212 m_ancestorClippingLayer = nullptr; |
| 213 m_contentsContainmentLayer = nullptr; | 213 m_contentsContainmentLayer = nullptr; |
| 214 m_graphicsLayer = nullptr; | 214 m_graphicsLayer = nullptr; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // | 255 // |
| 256 // Similarly, if filters used to be painted in the compositor and are no
w painted in software, we need to: | 256 // Similarly, if filters used to be painted in the compositor and are no
w painted in software, we need to: |
| 257 // (1) Create a FilterEffectRenderer. | 257 // (1) Create a FilterEffectRenderer. |
| 258 // (2) Repaint the layer contents to apply a software filter because the
compositor won't apply it. | 258 // (2) Repaint the layer contents to apply a software filter because the
compositor won't apply it. |
| 259 // | 259 // |
| 260 m_owningLayer->updateOrRemoveFilterEffectRenderer(); | 260 m_owningLayer->updateOrRemoveFilterEffectRenderer(); |
| 261 setContentsNeedDisplay(); | 261 setContentsNeedDisplay(); |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 #if ENABLE(CSS_COMPOSITING) | |
| 266 void RenderLayerBacking::updateLayerBlendMode(const RenderStyle*) | 265 void RenderLayerBacking::updateLayerBlendMode(const RenderStyle*) |
| 267 { | 266 { |
| 268 } | 267 } |
| 269 #endif | |
| 270 | 268 |
| 271 static bool hasNonZeroTransformOrigin(const RenderObject* renderer) | 269 static bool hasNonZeroTransformOrigin(const RenderObject* renderer) |
| 272 { | 270 { |
| 273 RenderStyle* style = renderer->style(); | 271 RenderStyle* style = renderer->style(); |
| 274 return (style->transformOriginX().type() == Fixed && style->transformOriginX
().value()) | 272 return (style->transformOriginX().type() == Fixed && style->transformOriginX
().value()) |
| 275 || (style->transformOriginY().type() == Fixed && style->transformOriginY
().value()); | 273 || (style->transformOriginY().type() == Fixed && style->transformOriginY
().value()); |
| 276 } | 274 } |
| 277 | 275 |
| 278 static bool layerOrAncestorIsTransformedOrUsingCompositedScrolling(RenderLayer*
layer) | 276 static bool layerOrAncestorIsTransformedOrUsingCompositedScrolling(RenderLayer*
layer) |
| 279 { | 277 { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 465 |
| 468 // Set transform property, if it is not animating. We have to do this here b
ecause the transform | 466 // Set transform property, if it is not animating. We have to do this here b
ecause the transform |
| 469 // is affected by the layer dimensions. | 467 // is affected by the layer dimensions. |
| 470 if (!renderer()->animation()->isRunningAcceleratedAnimationOnRenderer(render
er(), CSSPropertyWebkitTransform)) | 468 if (!renderer()->animation()->isRunningAcceleratedAnimationOnRenderer(render
er(), CSSPropertyWebkitTransform)) |
| 471 updateTransform(renderer()->style()); | 469 updateTransform(renderer()->style()); |
| 472 | 470 |
| 473 // Set opacity, if it is not animating. | 471 // Set opacity, if it is not animating. |
| 474 if (!renderer()->animation()->isRunningAcceleratedAnimationOnRenderer(render
er(), CSSPropertyOpacity)) | 472 if (!renderer()->animation()->isRunningAcceleratedAnimationOnRenderer(render
er(), CSSPropertyOpacity)) |
| 475 updateOpacity(renderer()->style()); | 473 updateOpacity(renderer()->style()); |
| 476 | 474 |
| 477 #if ENABLE(CSS_COMPOSITING) | 475 if (RuntimeEnabledFeatures::cssCompositingEnabled()) |
| 478 updateLayerBlendMode(renderer()->style()); | 476 updateLayerBlendMode(renderer()->style()); |
| 479 #endif | |
| 480 | 477 |
| 481 bool isSimpleContainer = isSimpleContainerCompositingLayer(); | 478 bool isSimpleContainer = isSimpleContainerCompositingLayer(); |
| 482 | 479 |
| 483 m_owningLayer->updateDescendantDependentFlags(); | 480 m_owningLayer->updateDescendantDependentFlags(); |
| 484 | 481 |
| 485 // m_graphicsLayer is the corresponding GraphicsLayer for this RenderLayer a
nd its non-compositing | 482 // m_graphicsLayer is the corresponding GraphicsLayer for this RenderLayer a
nd its non-compositing |
| 486 // descendants. So, the visibility flag for m_graphicsLayer should be true i
f there are any | 483 // descendants. So, the visibility flag for m_graphicsLayer should be true i
f there are any |
| 487 // non-compositing visible layers. | 484 // non-compositing visible layers. |
| 488 m_graphicsLayer->setContentsVisible(m_owningLayer->hasVisibleContent() || ha
sVisibleNonCompositingDescendantLayers()); | 485 m_graphicsLayer->setContentsVisible(m_owningLayer->hasVisibleContent() || ha
sVisibleNonCompositingDescendantLayers()); |
| 489 | 486 |
| (...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1520 m_requiresOwnBackingStore = requiresOwnBacking; | 1517 m_requiresOwnBackingStore = requiresOwnBacking; |
| 1521 | 1518 |
| 1522 // This affects the answer to paintsIntoCompositedAncestor(), which in turn
affects | 1519 // This affects the answer to paintsIntoCompositedAncestor(), which in turn
affects |
| 1523 // cached clip rects, so when it changes we have to clear clip rects on desc
endants. | 1520 // cached clip rects, so when it changes we have to clear clip rects on desc
endants. |
| 1524 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects); | 1521 m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects); |
| 1525 m_owningLayer->computeRepaintRectsIncludingDescendants(); | 1522 m_owningLayer->computeRepaintRectsIncludingDescendants(); |
| 1526 | 1523 |
| 1527 compositor()->repaintInCompositedAncestor(m_owningLayer, compositedBounds())
; | 1524 compositor()->repaintInCompositedAncestor(m_owningLayer, compositedBounds())
; |
| 1528 } | 1525 } |
| 1529 | 1526 |
| 1530 #if ENABLE(CSS_COMPOSITING) | |
| 1531 void RenderLayerBacking::setBlendMode(BlendMode) | 1527 void RenderLayerBacking::setBlendMode(BlendMode) |
| 1532 { | 1528 { |
| 1533 } | 1529 } |
| 1534 #endif | |
| 1535 | 1530 |
| 1536 void RenderLayerBacking::setContentsNeedDisplay() | 1531 void RenderLayerBacking::setContentsNeedDisplay() |
| 1537 { | 1532 { |
| 1538 ASSERT(!paintsIntoCompositedAncestor()); | 1533 ASSERT(!paintsIntoCompositedAncestor()); |
| 1539 | 1534 |
| 1540 if (m_graphicsLayer && m_graphicsLayer->drawsContent()) | 1535 if (m_graphicsLayer && m_graphicsLayer->drawsContent()) |
| 1541 m_graphicsLayer->setNeedsDisplay(); | 1536 m_graphicsLayer->setNeedsDisplay(); |
| 1542 | 1537 |
| 1543 if (m_foregroundLayer && m_foregroundLayer->drawsContent()) | 1538 if (m_foregroundLayer && m_foregroundLayer->drawsContent()) |
| 1544 m_foregroundLayer->setNeedsDisplay(); | 1539 m_foregroundLayer->setNeedsDisplay(); |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1973 info.addMember(m_childContainmentLayer, "childContainmentLayer"); | 1968 info.addMember(m_childContainmentLayer, "childContainmentLayer"); |
| 1974 info.addMember(m_maskLayer, "maskLayer"); | 1969 info.addMember(m_maskLayer, "maskLayer"); |
| 1975 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar")
; | 1970 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar")
; |
| 1976 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); | 1971 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); |
| 1977 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); | 1972 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); |
| 1978 info.addMember(m_scrollingLayer, "scrollingLayer"); | 1973 info.addMember(m_scrollingLayer, "scrollingLayer"); |
| 1979 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); | 1974 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); |
| 1980 } | 1975 } |
| 1981 | 1976 |
| 1982 } // namespace WebCore | 1977 } // namespace WebCore |
| OLD | NEW |