| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 RenderLayer::RenderLayer(RenderLayerModelObject* renderer) | 104 RenderLayer::RenderLayer(RenderLayerModelObject* renderer) |
| 105 : m_hasSelfPaintingLayerDescendant(false) | 105 : m_hasSelfPaintingLayerDescendant(false) |
| 106 , m_hasSelfPaintingLayerDescendantDirty(false) | 106 , m_hasSelfPaintingLayerDescendantDirty(false) |
| 107 , m_hasOutOfFlowPositionedDescendant(false) | 107 , m_hasOutOfFlowPositionedDescendant(false) |
| 108 , m_hasOutOfFlowPositionedDescendantDirty(true) | 108 , m_hasOutOfFlowPositionedDescendantDirty(true) |
| 109 , m_hasUnclippedDescendant(false) | 109 , m_hasUnclippedDescendant(false) |
| 110 , m_isUnclippedDescendant(false) | 110 , m_isUnclippedDescendant(false) |
| 111 , m_isRootLayer(renderer->isRenderView()) | 111 , m_isRootLayer(renderer->isRenderView()) |
| 112 , m_usedTransparency(false) | 112 , m_usedTransparency(false) |
| 113 , m_childLayerHasBlendMode(false) | |
| 114 , m_childLayerHasBlendModeStatusDirty(false) | |
| 115 , m_visibleContentStatusDirty(true) | 113 , m_visibleContentStatusDirty(true) |
| 116 , m_hasVisibleContent(false) | 114 , m_hasVisibleContent(false) |
| 117 , m_visibleDescendantStatusDirty(false) | 115 , m_visibleDescendantStatusDirty(false) |
| 118 , m_hasVisibleDescendant(false) | 116 , m_hasVisibleDescendant(false) |
| 119 , m_hasVisibleNonLayerContent(false) | 117 , m_hasVisibleNonLayerContent(false) |
| 120 , m_isPaginated(false) | 118 , m_isPaginated(false) |
| 121 , m_3DTransformedDescendantStatusDirty(true) | 119 , m_3DTransformedDescendantStatusDirty(true) |
| 122 , m_has3DTransformedDescendant(false) | 120 , m_has3DTransformedDescendant(false) |
| 123 , m_containsDirtyOverlayScrollbars(false) | 121 , m_containsDirtyOverlayScrollbars(false) |
| 124 , m_canSkipRepaintRectsUpdateOnScroll(renderer->isTableCell()) | 122 , m_canSkipRepaintRectsUpdateOnScroll(renderer->isTableCell()) |
| 125 , m_hasFilterInfo(false) | 123 , m_hasFilterInfo(false) |
| 126 , m_blendMode(blink::WebBlendModeNormal) | |
| 127 , m_renderer(renderer) | 124 , m_renderer(renderer) |
| 128 , m_parent(0) | 125 , m_parent(0) |
| 129 , m_previous(0) | 126 , m_previous(0) |
| 130 , m_next(0) | 127 , m_next(0) |
| 131 , m_first(0) | 128 , m_first(0) |
| 132 , m_last(0) | 129 , m_last(0) |
| 133 , m_staticInlinePosition(0) | 130 , m_staticInlinePosition(0) |
| 134 , m_staticBlockPosition(0) | 131 , m_staticBlockPosition(0) |
| 135 , m_enclosingPaginationLayer(0) | 132 , m_enclosingPaginationLayer(0) |
| 136 , m_groupedMapping(0) | 133 , m_groupedMapping(0) |
| 137 , m_repainter(renderer) | 134 , m_repainter(renderer) |
| 138 , m_clipper(renderer) | 135 , m_clipper(renderer) |
| 136 , m_blendInfo(renderer) |
| 139 { | 137 { |
| 140 updateStackingNode(); | 138 updateStackingNode(); |
| 141 | 139 |
| 142 m_isSelfPaintingLayer = shouldBeSelfPaintingLayer(); | 140 m_isSelfPaintingLayer = shouldBeSelfPaintingLayer(); |
| 143 | 141 |
| 144 if (!renderer->firstChild() && renderer->style()) { | 142 if (!renderer->firstChild() && renderer->style()) { |
| 145 m_visibleContentStatusDirty = false; | 143 m_visibleContentStatusDirty = false; |
| 146 m_hasVisibleContent = renderer->style()->visibility() == VISIBLE; | 144 m_hasVisibleContent = renderer->style()->visibility() == VISIBLE; |
| 147 } | 145 } |
| 148 | 146 |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 child->updateLayerPositionsAfterScroll(geometryMap, flags); | 506 child->updateLayerPositionsAfterScroll(geometryMap, flags); |
| 509 | 507 |
| 510 // We don't update our reflection as scrolling is a translation which does n
ot change the size() | 508 // We don't update our reflection as scrolling is a translation which does n
ot change the size() |
| 511 // of an object, thus RenderReplica will still repaint itself properly as th
e layer position was | 509 // of an object, thus RenderReplica will still repaint itself properly as th
e layer position was |
| 512 // updated above. | 510 // updated above. |
| 513 | 511 |
| 514 if (geometryMap) | 512 if (geometryMap) |
| 515 geometryMap->popMappingsToAncestor(parent()); | 513 geometryMap->popMappingsToAncestor(parent()); |
| 516 } | 514 } |
| 517 | 515 |
| 518 bool RenderLayer::hasBlendMode() const | |
| 519 { | |
| 520 return RuntimeEnabledFeatures::cssCompositingEnabled() && renderer()->hasBle
ndMode(); | |
| 521 } | |
| 522 | |
| 523 void RenderLayer::updateBlendMode() | |
| 524 { | |
| 525 if (!RuntimeEnabledFeatures::cssCompositingEnabled()) | |
| 526 return; | |
| 527 | |
| 528 bool hadBlendMode = m_blendMode != blink::WebBlendModeNormal; | |
| 529 blink::WebBlendMode newBlendMode = renderer()->style()->blendMode(); | |
| 530 if (newBlendMode != m_blendMode) { | |
| 531 m_blendMode = newBlendMode; | |
| 532 | |
| 533 // Only update the flag if a blend mode is set or unset. | |
| 534 if (parent() && (!hadBlendMode || !hasBlendMode())) | |
| 535 parent()->dirtyAncestorChainBlendedDescendantStatus(); | |
| 536 | |
| 537 if (hasCompositedLayerMapping()) | |
| 538 compositedLayerMapping()->setBlendMode(newBlendMode); | |
| 539 } | |
| 540 } | |
| 541 | |
| 542 void RenderLayer::updateTransform() | 516 void RenderLayer::updateTransform() |
| 543 { | 517 { |
| 544 // hasTransform() on the renderer is also true when there is transform-style
: preserve-3d or perspective set, | 518 // hasTransform() on the renderer is also true when there is transform-style
: preserve-3d or perspective set, |
| 545 // so check style too. | 519 // so check style too. |
| 546 bool hasTransform = renderer()->hasTransform() && renderer()->style()->hasTr
ansform(); | 520 bool hasTransform = renderer()->hasTransform() && renderer()->style()->hasTr
ansform(); |
| 547 bool had3DTransform = has3DTransform(); | 521 bool had3DTransform = has3DTransform(); |
| 548 | 522 |
| 549 bool hadTransform = m_transform; | 523 bool hadTransform = m_transform; |
| 550 if (hasTransform != hadTransform) { | 524 if (hasTransform != hadTransform) { |
| 551 if (hasTransform) | 525 if (hasTransform) |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 { | 725 { |
| 752 for (RenderLayer* layer = this; layer; layer = layer->parent()) { | 726 for (RenderLayer* layer = this; layer; layer = layer->parent()) { |
| 753 if (!layer->m_visibleDescendantStatusDirty && layer->hasVisibleDescendan
t()) | 727 if (!layer->m_visibleDescendantStatusDirty && layer->hasVisibleDescendan
t()) |
| 754 break; | 728 break; |
| 755 | 729 |
| 756 layer->m_hasVisibleDescendant = true; | 730 layer->m_hasVisibleDescendant = true; |
| 757 layer->m_visibleDescendantStatusDirty = false; | 731 layer->m_visibleDescendantStatusDirty = false; |
| 758 } | 732 } |
| 759 } | 733 } |
| 760 | 734 |
| 761 void RenderLayer::dirtyAncestorChainBlendedDescendantStatus() | |
| 762 { | |
| 763 for (RenderLayer* layer = this; layer; layer = layer->parent()) { | |
| 764 if (layer->m_childLayerHasBlendModeStatusDirty) | |
| 765 break; | |
| 766 | |
| 767 layer->m_childLayerHasBlendModeStatusDirty = true; | |
| 768 | |
| 769 if (layer->stackingNode()->isStackingContext()) | |
| 770 break; | |
| 771 } | |
| 772 } | |
| 773 | |
| 774 void RenderLayer::setAncestorChainBlendedDescendant() | |
| 775 { | |
| 776 for (RenderLayer* layer = this; layer; layer = layer->parent()) { | |
| 777 if (!layer->m_childLayerHasBlendModeStatusDirty && layer->childLayerHasB
lendMode()) | |
| 778 break; | |
| 779 | |
| 780 layer->m_childLayerHasBlendMode = true; | |
| 781 layer->m_childLayerHasBlendModeStatusDirty = false; | |
| 782 | |
| 783 if (layer->stackingNode()->isStackingContext()) | |
| 784 break; | |
| 785 } | |
| 786 } | |
| 787 | |
| 788 void RenderLayer::updateHasUnclippedDescendant() | 735 void RenderLayer::updateHasUnclippedDescendant() |
| 789 { | 736 { |
| 790 TRACE_EVENT0("blink_rendering", "RenderLayer::updateHasUnclippedDescendant")
; | 737 TRACE_EVENT0("blink_rendering", "RenderLayer::updateHasUnclippedDescendant")
; |
| 791 ASSERT(renderer()->isOutOfFlowPositioned()); | 738 ASSERT(renderer()->isOutOfFlowPositioned()); |
| 792 if (!m_hasVisibleContent && !m_hasVisibleDescendant) | 739 if (!m_hasVisibleContent && !m_hasVisibleDescendant) |
| 793 return; | 740 return; |
| 794 | 741 |
| 795 FrameView* frameView = renderer()->view()->frameView(); | 742 FrameView* frameView = renderer()->view()->frameView(); |
| 796 if (!frameView) | 743 if (!frameView) |
| 797 return; | 744 return; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 | 798 |
| 852 if (m_hasVisibleDescendant && m_hasSelfPaintingLayerDescendant && ha
sOutOfFlowPositionedDescendant) | 799 if (m_hasVisibleDescendant && m_hasSelfPaintingLayerDescendant && ha
sOutOfFlowPositionedDescendant) |
| 853 break; | 800 break; |
| 854 } | 801 } |
| 855 | 802 |
| 856 m_visibleDescendantStatusDirty = false; | 803 m_visibleDescendantStatusDirty = false; |
| 857 m_hasSelfPaintingLayerDescendantDirty = false; | 804 m_hasSelfPaintingLayerDescendantDirty = false; |
| 858 m_hasOutOfFlowPositionedDescendantDirty = false; | 805 m_hasOutOfFlowPositionedDescendantDirty = false; |
| 859 } | 806 } |
| 860 | 807 |
| 861 if (m_childLayerHasBlendModeStatusDirty) { | 808 if (m_blendInfo.childLayerHasBlendModeStatusDirty()) { |
| 862 m_childLayerHasBlendMode = false; | 809 m_blendInfo.setChildLayerHasBlendMode(false); |
| 863 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin
g()) { | 810 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin
g()) { |
| 864 if (!child->stackingNode()->isStackingContext()) | 811 if (!child->stackingNode()->isStackingContext()) |
| 865 child->updateDescendantDependentFlags(); | 812 child->updateDescendantDependentFlags(); |
| 866 | 813 |
| 867 bool childLayerHasBlendMode = child->paintsWithBlendMode() || (child
->m_childLayerHasBlendMode && !child->stackingNode()->isStackingContext()); | 814 bool childLayerHasBlendMode = child->blendInfo().childLayerHasBlendM
odeWhileDirty(); |
| 868 m_childLayerHasBlendMode |= childLayerHasBlendMode; | 815 childLayerHasBlendMode |= child->paintsWithBlendMode() |
| 816 || (childLayerHasBlendMode && !child->stackingNode()->isStacking
Context()); |
| 869 | 817 |
| 870 if (m_childLayerHasBlendMode) | 818 m_blendInfo.setChildLayerHasBlendMode(childLayerHasBlendMode); |
| 819 |
| 820 if (childLayerHasBlendMode) |
| 871 break; | 821 break; |
| 872 } | 822 } |
| 873 m_childLayerHasBlendModeStatusDirty = false; | 823 m_blendInfo.setChildLayerHasBlendModeStatusDirty(false); |
| 874 } | 824 } |
| 875 | 825 |
| 876 if (m_visibleContentStatusDirty) { | 826 if (m_visibleContentStatusDirty) { |
| 877 if (renderer()->style()->visibility() == VISIBLE) | 827 if (renderer()->style()->visibility() == VISIBLE) |
| 878 m_hasVisibleContent = true; | 828 m_hasVisibleContent = true; |
| 879 else { | 829 else { |
| 880 // layer may be hidden but still have some visible content, check fo
r this | 830 // layer may be hidden but still have some visible content, check fo
r this |
| 881 m_hasVisibleContent = false; | 831 m_hasVisibleContent = false; |
| 882 RenderObject* r = renderer()->firstChild(); | 832 RenderObject* r = renderer()->firstChild(); |
| 883 while (r) { | 833 while (r) { |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 return clipRect; | 1280 return clipRect; |
| 1331 } | 1281 } |
| 1332 | 1282 |
| 1333 LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const Layou
tRect& paintDirtyRect, PaintBehavior paintBehavior) | 1283 LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const Layou
tRect& paintDirtyRect, PaintBehavior paintBehavior) |
| 1334 { | 1284 { |
| 1335 return intersection(transparencyClipBox(this, rootLayer, PaintingTransparenc
yClipBox, RootOfTransparencyClipBox, paintBehavior), paintDirtyRect); | 1285 return intersection(transparencyClipBox(this, rootLayer, PaintingTransparenc
yClipBox, RootOfTransparencyClipBox, paintBehavior), paintDirtyRect); |
| 1336 } | 1286 } |
| 1337 | 1287 |
| 1338 void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const Render
Layer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior) | 1288 void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const Render
Layer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior) |
| 1339 { | 1289 { |
| 1340 bool createTransparencyLayerForBlendMode = m_stackingNode->isStackingContext
() && m_childLayerHasBlendMode; | 1290 bool createTransparencyLayerForBlendMode = m_stackingNode->isStackingContext
() && m_blendInfo.childLayerHasBlendMode(); |
| 1341 if (context->paintingDisabled() || ((paintsWithTransparency(paintBehavior) |
| paintsWithBlendMode() || createTransparencyLayerForBlendMode) && m_usedTranspa
rency)) | 1291 if (context->paintingDisabled() || ((paintsWithTransparency(paintBehavior) |
| paintsWithBlendMode() || createTransparencyLayerForBlendMode) && m_usedTranspa
rency)) |
| 1342 return; | 1292 return; |
| 1343 | 1293 |
| 1344 RenderLayer* ancestor = transparentPaintingAncestor(); | 1294 RenderLayer* ancestor = transparentPaintingAncestor(); |
| 1345 if (ancestor) | 1295 if (ancestor) |
| 1346 ancestor->beginTransparencyLayers(context, rootLayer, paintDirtyRect, pa
intBehavior); | 1296 ancestor->beginTransparencyLayers(context, rootLayer, paintDirtyRect, pa
intBehavior); |
| 1347 | 1297 |
| 1348 if (paintsWithTransparency(paintBehavior) || paintsWithBlendMode() || create
TransparencyLayerForBlendMode) { | 1298 if (paintsWithTransparency(paintBehavior) || paintsWithBlendMode() || create
TransparencyLayerForBlendMode) { |
| 1349 m_usedTransparency = true; | 1299 m_usedTransparency = true; |
| 1350 context->save(); | 1300 context->save(); |
| 1351 LayoutRect clipRect = paintingExtent(rootLayer, paintDirtyRect, paintBeh
avior); | 1301 LayoutRect clipRect = paintingExtent(rootLayer, paintDirtyRect, paintBeh
avior); |
| 1352 context->clip(clipRect); | 1302 context->clip(clipRect); |
| 1353 if (paintsWithBlendMode()) | 1303 if (paintsWithBlendMode()) |
| 1354 context->setCompositeOperation(context->compositeOperation(), m_blen
dMode); | 1304 context->setCompositeOperation(context->compositeOperation(), m_blen
dInfo.blendMode()); |
| 1355 | 1305 |
| 1356 context->beginTransparencyLayer(renderer()->opacity()); | 1306 context->beginTransparencyLayer(renderer()->opacity()); |
| 1357 #ifdef REVEAL_TRANSPARENCY_LAYERS | 1307 #ifdef REVEAL_TRANSPARENCY_LAYERS |
| 1358 context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f)); | 1308 context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f)); |
| 1359 context->fillRect(clipRect); | 1309 context->fillRect(clipRect); |
| 1360 #endif | 1310 #endif |
| 1361 } | 1311 } |
| 1362 } | 1312 } |
| 1363 | 1313 |
| 1364 void* RenderLayer::operator new(size_t sz) | 1314 void* RenderLayer::operator new(size_t sz) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 child->stackingNode()->dirtyStackingContainerZOrderLists(); | 1350 child->stackingNode()->dirtyStackingContainerZOrderLists(); |
| 1401 } | 1351 } |
| 1402 | 1352 |
| 1403 child->updateDescendantDependentFlags(); | 1353 child->updateDescendantDependentFlags(); |
| 1404 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) | 1354 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) |
| 1405 setAncestorChainHasVisibleDescendant(); | 1355 setAncestorChainHasVisibleDescendant(); |
| 1406 | 1356 |
| 1407 if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant()) | 1357 if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant()) |
| 1408 setAncestorChainHasSelfPaintingLayerDescendant(); | 1358 setAncestorChainHasSelfPaintingLayerDescendant(); |
| 1409 | 1359 |
| 1410 if (child->paintsWithBlendMode() || child->childLayerHasBlendMode()) | 1360 if (child->paintsWithBlendMode() || child->blendInfo().childLayerHasBlendMod
e()) |
| 1411 setAncestorChainBlendedDescendant(); | 1361 m_blendInfo.setAncestorChainBlendedDescendant(); |
| 1412 | 1362 |
| 1413 if (subtreeContainsOutOfFlowPositionedLayer(child)) { | 1363 if (subtreeContainsOutOfFlowPositionedLayer(child)) { |
| 1414 // Now that the out of flow positioned descendant is in the tree, we | 1364 // Now that the out of flow positioned descendant is in the tree, we |
| 1415 // need to tell the compositor to reevaluate the compositing | 1365 // need to tell the compositor to reevaluate the compositing |
| 1416 // requirements since we may be able to mark more layers as having | 1366 // requirements since we may be able to mark more layers as having |
| 1417 // an 'unclipped' descendant. | 1367 // an 'unclipped' descendant. |
| 1418 compositor()->setNeedsUpdateCompositingRequirementsState(); | 1368 compositor()->setNeedsUpdateCompositingRequirementsState(); |
| 1419 setAncestorChainHasOutOfFlowPositionedDescendant(); | 1369 setAncestorChainHasOutOfFlowPositionedDescendant(); |
| 1420 } | 1370 } |
| 1421 | 1371 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 // It may now be the case that a layer no longer has an unclipped | 1411 // It may now be the case that a layer no longer has an unclipped |
| 1462 // descendant. Let the compositor know that it needs to reevaluate | 1412 // descendant. Let the compositor know that it needs to reevaluate |
| 1463 // its compositing requirements to check this. | 1413 // its compositing requirements to check this. |
| 1464 compositor()->setNeedsUpdateCompositingRequirementsState(); | 1414 compositor()->setNeedsUpdateCompositingRequirementsState(); |
| 1465 dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); | 1415 dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); |
| 1466 } | 1416 } |
| 1467 | 1417 |
| 1468 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant) | 1418 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant) |
| 1469 dirtyAncestorChainVisibleDescendantStatus(); | 1419 dirtyAncestorChainVisibleDescendantStatus(); |
| 1470 | 1420 |
| 1471 if (oldChild->paintsWithBlendMode() || oldChild->childLayerHasBlendMode()) | 1421 if (oldChild->paintsWithBlendMode() || oldChild->blendInfo().childLayerHasBl
endMode()) |
| 1472 dirtyAncestorChainBlendedDescendantStatus(); | 1422 m_blendInfo.dirtyAncestorChainBlendedDescendantStatus(); |
| 1473 | 1423 |
| 1474 if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescend
ant()) | 1424 if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescend
ant()) |
| 1475 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 1425 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
| 1476 | 1426 |
| 1477 return oldChild; | 1427 return oldChild; |
| 1478 } | 1428 } |
| 1479 | 1429 |
| 1480 void RenderLayer::removeOnlyThisLayer() | 1430 void RenderLayer::removeOnlyThisLayer() |
| 1481 { | 1431 { |
| 1482 if (!m_parent) | 1432 if (!m_parent) |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2049 paintingInfo.paintDirtyRect, context, clipperContext)) { | 1999 paintingInfo.paintDirtyRect, context, clipperContext)) { |
| 2050 // No need to post-apply the clipper if this failed. | 2000 // No need to post-apply the clipper if this failed. |
| 2051 resourceClipper = 0; | 2001 resourceClipper = 0; |
| 2052 } | 2002 } |
| 2053 } | 2003 } |
| 2054 } | 2004 } |
| 2055 } | 2005 } |
| 2056 | 2006 |
| 2057 // Blending operations must be performed only with the nearest ancestor stac
king context. | 2007 // Blending operations must be performed only with the nearest ancestor stac
king context. |
| 2058 // Note that there is no need to create a transparency layer if we're painti
ng the root. | 2008 // Note that there is no need to create a transparency layer if we're painti
ng the root. |
| 2059 bool createTransparencyLayerForBlendMode = !renderer()->isRoot() && m_stacki
ngNode->isStackingContext() && m_childLayerHasBlendMode; | 2009 bool createTransparencyLayerForBlendMode = !renderer()->isRoot() && m_stacki
ngNode->isStackingContext() && m_blendInfo.childLayerHasBlendMode(); |
| 2060 | 2010 |
| 2061 if (createTransparencyLayerForBlendMode) | 2011 if (createTransparencyLayerForBlendMode) |
| 2062 beginTransparencyLayers(context, paintingInfo.rootLayer, paintingInfo.pa
intDirtyRect, paintingInfo.paintBehavior); | 2012 beginTransparencyLayers(context, paintingInfo.rootLayer, paintingInfo.pa
intDirtyRect, paintingInfo.paintBehavior); |
| 2063 | 2013 |
| 2064 LayerPaintingInfo localPaintingInfo(paintingInfo); | 2014 LayerPaintingInfo localPaintingInfo(paintingInfo); |
| 2065 FilterEffectRendererHelper filterPainter(filterRenderer() && paintsWithFilte
rs()); | 2015 FilterEffectRendererHelper filterPainter(filterRenderer() && paintsWithFilte
rs()); |
| 2066 if (filterPainter.haveFilterEffect() && !context->paintingDisabled()) { | 2016 if (filterPainter.haveFilterEffect() && !context->paintingDisabled()) { |
| 2067 RenderLayerFilterInfo* filterInfo = this->filterInfo(); | 2017 RenderLayerFilterInfo* filterInfo = this->filterInfo(); |
| 2068 ASSERT(filterInfo); | 2018 ASSERT(filterInfo); |
| 2069 LayoutRect filterRepaintRect = filterInfo->dirtySourceRect(); | 2019 LayoutRect filterRepaintRect = filterInfo->dirtySourceRect(); |
| (...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3659 } | 3609 } |
| 3660 | 3610 |
| 3661 CompositedLayerMappingPtr RenderLayer::ensureCompositedLayerMapping() | 3611 CompositedLayerMappingPtr RenderLayer::ensureCompositedLayerMapping() |
| 3662 { | 3612 { |
| 3663 if (!m_compositedLayerMapping) { | 3613 if (!m_compositedLayerMapping) { |
| 3664 m_compositedLayerMapping = adoptPtr(new CompositedLayerMapping(this)); | 3614 m_compositedLayerMapping = adoptPtr(new CompositedLayerMapping(this)); |
| 3665 | 3615 |
| 3666 updateOrRemoveFilterEffectRenderer(); | 3616 updateOrRemoveFilterEffectRenderer(); |
| 3667 | 3617 |
| 3668 if (RuntimeEnabledFeatures::cssCompositingEnabled()) | 3618 if (RuntimeEnabledFeatures::cssCompositingEnabled()) |
| 3669 compositedLayerMapping()->setBlendMode(m_blendMode); | 3619 compositedLayerMapping()->setBlendMode(m_blendInfo.blendMode()); |
| 3670 } | 3620 } |
| 3671 return m_compositedLayerMapping.get(); | 3621 return m_compositedLayerMapping.get(); |
| 3672 } | 3622 } |
| 3673 | 3623 |
| 3674 void RenderLayer::clearCompositedLayerMapping(bool layerBeingDestroyed) | 3624 void RenderLayer::clearCompositedLayerMapping(bool layerBeingDestroyed) |
| 3675 { | 3625 { |
| 3676 m_compositedLayerMapping.clear(); | 3626 m_compositedLayerMapping.clear(); |
| 3677 | 3627 |
| 3678 if (!layerBeingDestroyed) | 3628 if (!layerBeingDestroyed) |
| 3679 updateOrRemoveFilterEffectRenderer(); | 3629 updateOrRemoveFilterEffectRenderer(); |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3983 m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle); | 3933 m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle); |
| 3984 updateVisibilityAfterStyleChange(oldStyle); | 3934 updateVisibilityAfterStyleChange(oldStyle); |
| 3985 // Overlay scrollbars can make this layer self-painting so we need | 3935 // Overlay scrollbars can make this layer self-painting so we need |
| 3986 // to recompute the bit once scrollbars have been updated. | 3936 // to recompute the bit once scrollbars have been updated. |
| 3987 updateSelfPaintingLayer(); | 3937 updateSelfPaintingLayer(); |
| 3988 updateOutOfFlowPositioned(oldStyle); | 3938 updateOutOfFlowPositioned(oldStyle); |
| 3989 | 3939 |
| 3990 updateReflectionInfo(oldStyle); | 3940 updateReflectionInfo(oldStyle); |
| 3991 | 3941 |
| 3992 if (RuntimeEnabledFeatures::cssCompositingEnabled()) | 3942 if (RuntimeEnabledFeatures::cssCompositingEnabled()) |
| 3993 updateBlendMode(); | 3943 m_blendInfo.updateBlendMode(); |
| 3994 | 3944 |
| 3995 updateDescendantDependentFlags(); | 3945 updateDescendantDependentFlags(); |
| 3996 updateTransform(); | 3946 updateTransform(); |
| 3997 | 3947 |
| 3998 bool didPaintWithFilters = false; | 3948 bool didPaintWithFilters = false; |
| 3999 | 3949 |
| 4000 if (paintsWithFilters()) | 3950 if (paintsWithFilters()) |
| 4001 didPaintWithFilters = true; | 3951 didPaintWithFilters = true; |
| 4002 updateFilters(oldStyle, renderer()->style()); | 3952 updateFilters(oldStyle, renderer()->style()); |
| 4003 | 3953 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4188 } | 4138 } |
| 4189 } | 4139 } |
| 4190 | 4140 |
| 4191 void showLayerTree(const WebCore::RenderObject* renderer) | 4141 void showLayerTree(const WebCore::RenderObject* renderer) |
| 4192 { | 4142 { |
| 4193 if (!renderer) | 4143 if (!renderer) |
| 4194 return; | 4144 return; |
| 4195 showLayerTree(renderer->enclosingLayer()); | 4145 showLayerTree(renderer->enclosingLayer()); |
| 4196 } | 4146 } |
| 4197 #endif | 4147 #endif |
| OLD | NEW |