| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 282 } |
| 283 | 283 |
| 284 repainter().repaintAfterLayout(geometryMap, flags & CheckForRepaint); | 284 repainter().repaintAfterLayout(geometryMap, flags & CheckForRepaint); |
| 285 | 285 |
| 286 // Go ahead and update the reflection's position and size. | 286 // Go ahead and update the reflection's position and size. |
| 287 if (m_reflectionInfo) | 287 if (m_reflectionInfo) |
| 288 m_reflectionInfo->reflection()->layout(); | 288 m_reflectionInfo->reflection()->layout(); |
| 289 | 289 |
| 290 // Clear the IsCompositingUpdateRoot flag once we've found the first composi
ting layer in this update. | 290 // Clear the IsCompositingUpdateRoot flag once we've found the first composi
ting layer in this update. |
| 291 bool isUpdateRoot = (flags & IsCompositingUpdateRoot); | 291 bool isUpdateRoot = (flags & IsCompositingUpdateRoot); |
| 292 if (compositedLayerMapping()) | 292 if (hasCompositedLayerMapping()) |
| 293 flags &= ~IsCompositingUpdateRoot; | 293 flags &= ~IsCompositingUpdateRoot; |
| 294 | 294 |
| 295 if (useRegionBasedColumns() && renderer()->isInFlowRenderFlowThread()) { | 295 if (useRegionBasedColumns() && renderer()->isInFlowRenderFlowThread()) { |
| 296 updatePagination(); | 296 updatePagination(); |
| 297 flags |= UpdatePagination; | 297 flags |= UpdatePagination; |
| 298 } | 298 } |
| 299 | 299 |
| 300 if (renderer()->hasColumns()) | 300 if (renderer()->hasColumns()) |
| 301 flags |= UpdatePagination; | 301 flags |= UpdatePagination; |
| 302 | 302 |
| 303 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) | 303 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
| 304 child->updateLayerPositions(geometryMap, flags); | 304 child->updateLayerPositions(geometryMap, flags); |
| 305 | 305 |
| 306 if ((flags & UpdateCompositingLayers) && compositedLayerMapping()) { | 306 if ((flags & UpdateCompositingLayers) && hasCompositedLayerMapping()) { |
| 307 CompositedLayerMapping::UpdateAfterLayoutFlags updateFlags = CompositedL
ayerMapping::CompositingChildrenOnly; | 307 CompositedLayerMapping::UpdateAfterLayoutFlags updateFlags = CompositedL
ayerMapping::CompositingChildrenOnly; |
| 308 if (flags & NeedsFullRepaintInBacking) | 308 if (flags & NeedsFullRepaintInBacking) |
| 309 updateFlags |= CompositedLayerMapping::NeedsFullRepaint; | 309 updateFlags |= CompositedLayerMapping::NeedsFullRepaint; |
| 310 if (isUpdateRoot) | 310 if (isUpdateRoot) |
| 311 updateFlags |= CompositedLayerMapping::IsUpdateRoot; | 311 updateFlags |= CompositedLayerMapping::IsUpdateRoot; |
| 312 compositedLayerMapping()->updateAfterLayout(updateFlags); | 312 compositedLayerMapping()->updateAfterLayout(updateFlags); |
| 313 } | 313 } |
| 314 | 314 |
| 315 if (geometryMap) | 315 if (geometryMap) |
| 316 geometryMap->popMappingsToAncestor(parent()); | 316 geometryMap->popMappingsToAncestor(parent()); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 528 |
| 529 bool hadBlendMode = m_blendMode != BlendModeNormal; | 529 bool hadBlendMode = m_blendMode != BlendModeNormal; |
| 530 BlendMode newBlendMode = renderer()->style()->blendMode(); | 530 BlendMode newBlendMode = renderer()->style()->blendMode(); |
| 531 if (newBlendMode != m_blendMode) { | 531 if (newBlendMode != m_blendMode) { |
| 532 m_blendMode = newBlendMode; | 532 m_blendMode = newBlendMode; |
| 533 | 533 |
| 534 // Only update the flag if a blend mode is set or unset. | 534 // Only update the flag if a blend mode is set or unset. |
| 535 if (!hadBlendMode || !hasBlendMode()) | 535 if (!hadBlendMode || !hasBlendMode()) |
| 536 dirtyAncestorChainBlendedDescendantStatus(); | 536 dirtyAncestorChainBlendedDescendantStatus(); |
| 537 | 537 |
| 538 if (compositedLayerMapping()) | 538 if (hasCompositedLayerMapping()) |
| 539 compositedLayerMapping()->setBlendMode(newBlendMode); | 539 compositedLayerMapping()->setBlendMode(newBlendMode); |
| 540 } | 540 } |
| 541 } | 541 } |
| 542 | 542 |
| 543 void RenderLayer::updateTransform() | 543 void RenderLayer::updateTransform() |
| 544 { | 544 { |
| 545 // hasTransform() on the renderer is also true when there is transform-style
: preserve-3d or perspective set, | 545 // hasTransform() on the renderer is also true when there is transform-style
: preserve-3d or perspective set, |
| 546 // so check style too. | 546 // so check style too. |
| 547 bool hasTransform = renderer()->hasTransform() && renderer()->style()->hasTr
ansform(); | 547 bool hasTransform = renderer()->hasTransform() && renderer()->style()->hasTr
ansform(); |
| 548 bool had3DTransform = has3DTransform(); | 548 bool had3DTransform = has3DTransform(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 { | 635 { |
| 636 const Settings* settings = renderer()->document().settings(); | 636 const Settings* settings = renderer()->document().settings(); |
| 637 return settings && settings->regionBasedColumnsEnabled(); | 637 return settings && settings->regionBasedColumnsEnabled(); |
| 638 } | 638 } |
| 639 | 639 |
| 640 void RenderLayer::updatePagination() | 640 void RenderLayer::updatePagination() |
| 641 { | 641 { |
| 642 m_isPaginated = false; | 642 m_isPaginated = false; |
| 643 m_enclosingPaginationLayer = 0; | 643 m_enclosingPaginationLayer = 0; |
| 644 | 644 |
| 645 if (compositedLayerMapping() || !parent()) | 645 if (hasCompositedLayerMapping() || !parent()) |
| 646 return; // FIXME: We will have to deal with paginated compositing layers
someday. | 646 return; // FIXME: We will have to deal with paginated compositing layers
someday. |
| 647 // FIXME: For now the RenderView can't be paginated. Eventually
printing will move to a model where it is though. | 647 // FIXME: For now the RenderView can't be paginated. Eventually
printing will move to a model where it is though. |
| 648 | 648 |
| 649 // The main difference between the paginated booleans for the old column cod
e and the new column code | 649 // The main difference between the paginated booleans for the old column cod
e and the new column code |
| 650 // is that each paginated layer has to paint on its own with the new code. T
here is no | 650 // is that each paginated layer has to paint on its own with the new code. T
here is no |
| 651 // recurring into child layers. This means that the m_isPaginated bits for t
he new column code can't just be set on | 651 // recurring into child layers. This means that the m_isPaginated bits for t
he new column code can't just be set on |
| 652 // "roots" that get split and paint all their descendants. Instead each laye
r has to be checked individually and | 652 // "roots" that get split and paint all their descendants. Instead each laye
r has to be checked individually and |
| 653 // genuinely know if it is going to have to split itself up when painting on
ly its contents (and not any other descendant | 653 // genuinely know if it is going to have to split itself up when painting on
ly its contents (and not any other descendant |
| 654 // layers). We track an enclosingPaginationLayer instead of using a simple b
it, since we want to be able to get back | 654 // layers). We track an enclosingPaginationLayer instead of using a simple b
it, since we want to be able to get back |
| 655 // to that layer easily. | 655 // to that layer easily. |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 if (positionedParent->renderer()->hasOverflowClip()) { | 986 if (positionedParent->renderer()->hasOverflowClip()) { |
| 987 LayoutSize offset = positionedParent->renderBox()->scrolledContentOf
fset(); | 987 LayoutSize offset = positionedParent->renderBox()->scrolledContentOf
fset(); |
| 988 localPoint -= offset; | 988 localPoint -= offset; |
| 989 } | 989 } |
| 990 | 990 |
| 991 if (renderer()->isOutOfFlowPositioned() && positionedParent->renderer()-
>isInFlowPositioned() && positionedParent->renderer()->isRenderInline()) { | 991 if (renderer()->isOutOfFlowPositioned() && positionedParent->renderer()-
>isInFlowPositioned() && positionedParent->renderer()->isRenderInline()) { |
| 992 LayoutSize offset = toRenderInline(positionedParent->renderer())->of
fsetForInFlowPositionedInline(toRenderBox(renderer())); | 992 LayoutSize offset = toRenderInline(positionedParent->renderer())->of
fsetForInFlowPositionedInline(toRenderBox(renderer())); |
| 993 localPoint += offset; | 993 localPoint += offset; |
| 994 } | 994 } |
| 995 } else if (parent()) { | 995 } else if (parent()) { |
| 996 if (compositedLayerMapping()) { | 996 if (hasCompositedLayerMapping()) { |
| 997 // FIXME: Composited layers ignore pagination, so about the best we
can do is make sure they're offset into the appropriate column. | 997 // FIXME: Composited layers ignore pagination, so about the best we
can do is make sure they're offset into the appropriate column. |
| 998 // They won't split across columns properly. | 998 // They won't split across columns properly. |
| 999 LayoutSize columnOffset; | 999 LayoutSize columnOffset; |
| 1000 if (!parent()->renderer()->hasColumns() && parent()->renderer()->isR
oot() && renderer()->view()->hasColumns()) | 1000 if (!parent()->renderer()->hasColumns() && parent()->renderer()->isR
oot() && renderer()->view()->hasColumns()) |
| 1001 renderer()->view()->adjustForColumns(columnOffset, localPoint); | 1001 renderer()->view()->adjustForColumns(columnOffset, localPoint); |
| 1002 else | 1002 else |
| 1003 parent()->renderer()->adjustForColumns(columnOffset, localPoint)
; | 1003 parent()->renderer()->adjustForColumns(columnOffset, localPoint)
; |
| 1004 | 1004 |
| 1005 localPoint += columnOffset; | 1005 localPoint += columnOffset; |
| 1006 } | 1006 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 { | 1106 { |
| 1107 return layer->stackingNode()->isNormalFlowOnly() ? layer->parent() : (layer-
>stackingNode()->ancestorStackingContainerNode() ? layer->stackingNode()->ancest
orStackingContainerNode()->layer() : 0); | 1107 return layer->stackingNode()->isNormalFlowOnly() ? layer->parent() : (layer-
>stackingNode()->ancestorStackingContainerNode() ? layer->stackingNode()->ancest
orStackingContainerNode()->layer() : 0); |
| 1108 } | 1108 } |
| 1109 | 1109 |
| 1110 // FIXME: having two different functions named enclosingCompositingLayer and enc
losingCompositingLayerForRepaint | 1110 // FIXME: having two different functions named enclosingCompositingLayer and enc
losingCompositingLayerForRepaint |
| 1111 // is error-prone and misleading for reading code that uses these functions - es
pecially compounded with | 1111 // is error-prone and misleading for reading code that uses these functions - es
pecially compounded with |
| 1112 // the includeSelf option. It is very likely that some call sites of this functi
on actually mean to use | 1112 // the includeSelf option. It is very likely that some call sites of this functi
on actually mean to use |
| 1113 // enclosingCompositingLayerForRepaint(). | 1113 // enclosingCompositingLayerForRepaint(). |
| 1114 RenderLayer* RenderLayer::enclosingCompositingLayer(bool includeSelf) const | 1114 RenderLayer* RenderLayer::enclosingCompositingLayer(bool includeSelf) const |
| 1115 { | 1115 { |
| 1116 if (includeSelf && compositedLayerMapping()) | 1116 if (includeSelf && hasCompositedLayerMapping()) |
| 1117 return const_cast<RenderLayer*>(this); | 1117 return const_cast<RenderLayer*>(this); |
| 1118 | 1118 |
| 1119 for (const RenderLayer* curr = compositingContainer(this); curr; curr = comp
ositingContainer(curr)) { | 1119 for (const RenderLayer* curr = compositingContainer(this); curr; curr = comp
ositingContainer(curr)) { |
| 1120 if (curr->compositedLayerMapping()) | 1120 if (curr->hasCompositedLayerMapping()) |
| 1121 return const_cast<RenderLayer*>(curr); | 1121 return const_cast<RenderLayer*>(curr); |
| 1122 } | 1122 } |
| 1123 | 1123 |
| 1124 return 0; | 1124 return 0; |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(bool includeSelf)
const | 1127 RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(bool includeSelf)
const |
| 1128 { | 1128 { |
| 1129 if (includeSelf && compositingState() == PaintsIntoOwnBacking) | 1129 if (includeSelf && compositingState() == PaintsIntoOwnBacking) |
| 1130 return const_cast<RenderLayer*>(this); | 1130 return const_cast<RenderLayer*>(this); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 for (const RenderLayer* curr = this; curr; curr = curr->parent()) { | 1184 for (const RenderLayer* curr = this; curr; curr = curr->parent()) { |
| 1185 RenderLayerModelObject* renderer = curr->renderer(); | 1185 RenderLayerModelObject* renderer = curr->renderer(); |
| 1186 if (renderer->style()->hasFilterOutsets()) | 1186 if (renderer->style()->hasFilterOutsets()) |
| 1187 return true; | 1187 return true; |
| 1188 } | 1188 } |
| 1189 return false; | 1189 return false; |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 RenderLayer* RenderLayer::clippingRootForPainting() const | 1192 RenderLayer* RenderLayer::clippingRootForPainting() const |
| 1193 { | 1193 { |
| 1194 if (compositedLayerMapping()) | 1194 if (hasCompositedLayerMapping()) |
| 1195 return const_cast<RenderLayer*>(this); | 1195 return const_cast<RenderLayer*>(this); |
| 1196 | 1196 |
| 1197 const RenderLayer* current = this; | 1197 const RenderLayer* current = this; |
| 1198 while (current) { | 1198 while (current) { |
| 1199 if (current->isRootLayer()) | 1199 if (current->isRootLayer()) |
| 1200 return const_cast<RenderLayer*>(current); | 1200 return const_cast<RenderLayer*>(current); |
| 1201 | 1201 |
| 1202 current = compositingContainer(current); | 1202 current = compositingContainer(current); |
| 1203 ASSERT(current); | 1203 ASSERT(current); |
| 1204 if (current->transform() | 1204 if (current->transform() |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1223 bool RenderLayer::isTransparent() const | 1223 bool RenderLayer::isTransparent() const |
| 1224 { | 1224 { |
| 1225 if (renderer()->node() && renderer()->node()->isSVGElement()) | 1225 if (renderer()->node() && renderer()->node()->isSVGElement()) |
| 1226 return false; | 1226 return false; |
| 1227 | 1227 |
| 1228 return renderer()->isTransparent() || renderer()->hasMask(); | 1228 return renderer()->isTransparent() || renderer()->hasMask(); |
| 1229 } | 1229 } |
| 1230 | 1230 |
| 1231 RenderLayer* RenderLayer::transparentPaintingAncestor() | 1231 RenderLayer* RenderLayer::transparentPaintingAncestor() |
| 1232 { | 1232 { |
| 1233 if (compositedLayerMapping()) | 1233 if (hasCompositedLayerMapping()) |
| 1234 return 0; | 1234 return 0; |
| 1235 | 1235 |
| 1236 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { | 1236 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { |
| 1237 if (curr->compositedLayerMapping()) | 1237 if (curr->hasCompositedLayerMapping()) |
| 1238 return 0; | 1238 return 0; |
| 1239 if (curr->isTransparent()) | 1239 if (curr->isTransparent()) |
| 1240 return curr; | 1240 return curr; |
| 1241 } | 1241 } |
| 1242 return 0; | 1242 return 0; |
| 1243 } | 1243 } |
| 1244 | 1244 |
| 1245 enum TransparencyClipBoxBehavior { | 1245 enum TransparencyClipBoxBehavior { |
| 1246 PaintingTransparencyClipBox, | 1246 PaintingTransparencyClipBox, |
| 1247 HitTestingTransparencyClipBox | 1247 HitTestingTransparencyClipBox |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1763 void RenderLayer::updateScrollableArea() | 1763 void RenderLayer::updateScrollableArea() |
| 1764 { | 1764 { |
| 1765 if (requiresScrollableArea()) | 1765 if (requiresScrollableArea()) |
| 1766 m_scrollableArea = adoptPtr(new RenderLayerScrollableArea(renderBox())); | 1766 m_scrollableArea = adoptPtr(new RenderLayerScrollableArea(renderBox())); |
| 1767 else | 1767 else |
| 1768 m_scrollableArea = nullptr; | 1768 m_scrollableArea = nullptr; |
| 1769 } | 1769 } |
| 1770 | 1770 |
| 1771 PassOwnPtr<Vector<FloatRect> > RenderLayer::collectTrackedRepaintRects() const | 1771 PassOwnPtr<Vector<FloatRect> > RenderLayer::collectTrackedRepaintRects() const |
| 1772 { | 1772 { |
| 1773 if (CompositedLayerMapping* mapping = compositedLayerMapping()) | 1773 if (hasCompositedLayerMapping()) |
| 1774 return mapping->collectTrackedRepaintRects(); | 1774 compositedLayerMapping()->collectTrackedRepaintRects(); |
| 1775 return nullptr; | 1775 return nullptr; |
| 1776 } | 1776 } |
| 1777 | 1777 |
| 1778 bool RenderLayer::hasOverflowControls() const | 1778 bool RenderLayer::hasOverflowControls() const |
| 1779 { | 1779 { |
| 1780 return m_scrollableArea && (m_scrollableArea->hasScrollbar() || m_scrollable
Area->hasScrollCorner() || renderer()->style()->resize() != RESIZE_NONE); | 1780 return m_scrollableArea && (m_scrollableArea->hasScrollbar() || m_scrollable
Area->hasScrollCorner() || renderer()->style()->resize() != RESIZE_NONE); |
| 1781 } | 1781 } |
| 1782 | 1782 |
| 1783 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect,
PaintBehavior paintBehavior, RenderObject* paintingRoot, RenderRegion* region, P
aintLayerFlags paintFlags) | 1783 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect,
PaintBehavior paintBehavior, RenderObject* paintingRoot, RenderRegion* region, P
aintLayerFlags paintFlags) |
| 1784 { | 1784 { |
| (...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3582 } | 3582 } |
| 3583 } | 3583 } |
| 3584 | 3584 |
| 3585 // FIXME: should probably just pass 'flags' down to descendants. | 3585 // FIXME: should probably just pass 'flags' down to descendants. |
| 3586 CalculateLayerBoundsFlags descendantFlags = DefaultCalculateLayerBoundsFlags
| (flags & ExcludeHiddenDescendants) | (flags & IncludeCompositedDescendants); | 3586 CalculateLayerBoundsFlags descendantFlags = DefaultCalculateLayerBoundsFlags
| (flags & ExcludeHiddenDescendants) | (flags & IncludeCompositedDescendants); |
| 3587 | 3587 |
| 3588 const_cast<RenderLayer*>(this)->stackingNode()->updateLayerListsIfNeeded(); | 3588 const_cast<RenderLayer*>(this)->stackingNode()->updateLayerListsIfNeeded(); |
| 3589 | 3589 |
| 3590 if (m_reflectionInfo) { | 3590 if (m_reflectionInfo) { |
| 3591 RenderLayer* reflectionLayer = m_reflectionInfo->reflectionLayer(); | 3591 RenderLayer* reflectionLayer = m_reflectionInfo->reflectionLayer(); |
| 3592 if (!reflectionLayer->compositedLayerMapping()) { | 3592 if (!reflectionLayer->hasCompositedLayerMapping()) { |
| 3593 IntRect childUnionBounds = reflectionLayer->calculateLayerBounds(thi
s, 0, descendantFlags); | 3593 IntRect childUnionBounds = reflectionLayer->calculateLayerBounds(thi
s, 0, descendantFlags); |
| 3594 unionBounds.unite(childUnionBounds); | 3594 unionBounds.unite(childUnionBounds); |
| 3595 } | 3595 } |
| 3596 } | 3596 } |
| 3597 | 3597 |
| 3598 ASSERT(m_stackingNode->isStackingContainer() || (!m_stackingNode->posZOrderL
ist() || !m_stackingNode->posZOrderList()->size())); | 3598 ASSERT(m_stackingNode->isStackingContainer() || (!m_stackingNode->posZOrderL
ist() || !m_stackingNode->posZOrderList()->size())); |
| 3599 | 3599 |
| 3600 #if !ASSERT_DISABLED | 3600 #if !ASSERT_DISABLED |
| 3601 LayerListMutationDetector mutationChecker(const_cast<RenderLayer*>(this)->st
ackingNode()); | 3601 LayerListMutationDetector mutationChecker(const_cast<RenderLayer*>(this)->st
ackingNode()); |
| 3602 #endif | 3602 #endif |
| 3603 | 3603 |
| 3604 // FIXME: Descendants that are composited should not necessarily be skipped,
if they don't paint into their own | 3604 // FIXME: Descendants that are composited should not necessarily be skipped,
if they don't paint into their own |
| 3605 // separate backing. Instead, they ought to contribute to the bounds of the
layer we're trying to compute. | 3605 // separate backing. Instead, they ought to contribute to the bounds of the
layer we're trying to compute. |
| 3606 // This applies to all z-order lists below. | 3606 // This applies to all z-order lists below. |
| 3607 RenderLayerStackingNodeIterator iterator(*m_stackingNode.get(), AllChildren)
; | 3607 RenderLayerStackingNodeIterator iterator(*m_stackingNode.get(), AllChildren)
; |
| 3608 while (RenderLayerStackingNode* node = iterator.next()) { | 3608 while (RenderLayerStackingNode* node = iterator.next()) { |
| 3609 if (flags & IncludeCompositedDescendants || !node->layer()->compositedLa
yerMapping()) { | 3609 if (flags & IncludeCompositedDescendants || !node->layer()->hasComposite
dLayerMapping()) { |
| 3610 IntRect childUnionBounds = node->layer()->calculateLayerBounds(this,
0, descendantFlags); | 3610 IntRect childUnionBounds = node->layer()->calculateLayerBounds(this,
0, descendantFlags); |
| 3611 unionBounds.unite(childUnionBounds); | 3611 unionBounds.unite(childUnionBounds); |
| 3612 } | 3612 } |
| 3613 } | 3613 } |
| 3614 | 3614 |
| 3615 // FIXME: We can optimize the size of the composited layers, by not enlargin
g | 3615 // FIXME: We can optimize the size of the composited layers, by not enlargin
g |
| 3616 // filtered areas with the outsets if we know that the filter is going to re
nder in hardware. | 3616 // filtered areas with the outsets if we know that the filter is going to re
nder in hardware. |
| 3617 // https://bugs.webkit.org/show_bug.cgi?id=81239 | 3617 // https://bugs.webkit.org/show_bug.cgi?id=81239 |
| 3618 if (flags & IncludeLayerFilterOutsets) | 3618 if (flags & IncludeLayerFilterOutsets) |
| 3619 renderer->style()->filterOutsets().expandRect(unionBounds); | 3619 renderer->style()->filterOutsets().expandRect(unionBounds); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3729 || listBackgroundIsKnownToBeOpaqueInRect(m_stackingNode->normalFlowList(
), localRect); | 3729 || listBackgroundIsKnownToBeOpaqueInRect(m_stackingNode->normalFlowList(
), localRect); |
| 3730 } | 3730 } |
| 3731 | 3731 |
| 3732 bool RenderLayer::listBackgroundIsKnownToBeOpaqueInRect(const Vector<RenderLayer
StackingNode*>* list, const LayoutRect& localRect) const | 3732 bool RenderLayer::listBackgroundIsKnownToBeOpaqueInRect(const Vector<RenderLayer
StackingNode*>* list, const LayoutRect& localRect) const |
| 3733 { | 3733 { |
| 3734 if (!list || list->isEmpty()) | 3734 if (!list || list->isEmpty()) |
| 3735 return false; | 3735 return false; |
| 3736 | 3736 |
| 3737 for (Vector<RenderLayerStackingNode*>::const_reverse_iterator iter = list->r
begin(); iter != list->rend(); ++iter) { | 3737 for (Vector<RenderLayerStackingNode*>::const_reverse_iterator iter = list->r
begin(); iter != list->rend(); ++iter) { |
| 3738 const RenderLayer* childLayer = (*iter)->layer(); | 3738 const RenderLayer* childLayer = (*iter)->layer(); |
| 3739 if (childLayer->compositedLayerMapping()) | 3739 if (childLayer->hasCompositedLayerMapping()) |
| 3740 continue; | 3740 continue; |
| 3741 | 3741 |
| 3742 if (!childLayer->canUseConvertToLayerCoords()) | 3742 if (!childLayer->canUseConvertToLayerCoords()) |
| 3743 continue; | 3743 continue; |
| 3744 | 3744 |
| 3745 LayoutPoint childOffset; | 3745 LayoutPoint childOffset; |
| 3746 LayoutRect childLocalRect(localRect); | 3746 LayoutRect childLocalRect(localRect); |
| 3747 childLayer->convertToLayerCoords(this, childOffset); | 3747 childLayer->convertToLayerCoords(this, childOffset); |
| 3748 childLocalRect.moveBy(-childOffset); | 3748 childLocalRect.moveBy(-childOffset); |
| 3749 | 3749 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3902 | 3902 |
| 3903 inline bool RenderLayer::needsCompositingLayersRebuiltForClip(const RenderStyle*
oldStyle, const RenderStyle* newStyle) const | 3903 inline bool RenderLayer::needsCompositingLayersRebuiltForClip(const RenderStyle*
oldStyle, const RenderStyle* newStyle) const |
| 3904 { | 3904 { |
| 3905 ASSERT(newStyle); | 3905 ASSERT(newStyle); |
| 3906 return oldStyle && (oldStyle->clip() != newStyle->clip() || oldStyle->hasCli
p() != newStyle->hasClip()); | 3906 return oldStyle && (oldStyle->clip() != newStyle->clip() || oldStyle->hasCli
p() != newStyle->hasClip()); |
| 3907 } | 3907 } |
| 3908 | 3908 |
| 3909 inline bool RenderLayer::needsCompositingLayersRebuiltForOverflow(const RenderSt
yle* oldStyle, const RenderStyle* newStyle) const | 3909 inline bool RenderLayer::needsCompositingLayersRebuiltForOverflow(const RenderSt
yle* oldStyle, const RenderStyle* newStyle) const |
| 3910 { | 3910 { |
| 3911 ASSERT(newStyle); | 3911 ASSERT(newStyle); |
| 3912 return !compositedLayerMapping() && oldStyle && (oldStyle->overflowX() != ne
wStyle->overflowX()) && m_stackingNode->ancestorStackingContainerNode()->layer()
->hasCompositingDescendant(); | 3912 return !hasCompositedLayerMapping() && oldStyle && (oldStyle->overflowX() !=
newStyle->overflowX()) && m_stackingNode->ancestorStackingContainerNode()->laye
r()->hasCompositingDescendant(); |
| 3913 } | 3913 } |
| 3914 | 3914 |
| 3915 inline bool RenderLayer::needsCompositingLayersRebuiltForFilters(const RenderSty
le* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const | 3915 inline bool RenderLayer::needsCompositingLayersRebuiltForFilters(const RenderSty
le* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const |
| 3916 { | 3916 { |
| 3917 if (!hasOrHadFilters(oldStyle, newStyle)) | 3917 if (!hasOrHadFilters(oldStyle, newStyle)) |
| 3918 return false; | 3918 return false; |
| 3919 | 3919 |
| 3920 if (renderer()->animation().isRunningAcceleratedAnimationOnRenderer(renderer
(), CSSPropertyWebkitFilter)) { | 3920 if (renderer()->animation().isRunningAcceleratedAnimationOnRenderer(renderer
(), CSSPropertyWebkitFilter)) { |
| 3921 // When the compositor is performing the filter animation, we shouldn't
touch the compositing layers. | 3921 // When the compositor is performing the filter animation, we shouldn't
touch the compositing layers. |
| 3922 // All of the layers above us should have been promoted to compositing l
ayers already. | 3922 // All of the layers above us should have been promoted to compositing l
ayers already. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 3946 } | 3946 } |
| 3947 | 3947 |
| 3948 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle*
newStyle) | 3948 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle*
newStyle) |
| 3949 { | 3949 { |
| 3950 if (!hasOrHadFilters(oldStyle, newStyle)) | 3950 if (!hasOrHadFilters(oldStyle, newStyle)) |
| 3951 return; | 3951 return; |
| 3952 | 3952 |
| 3953 updateOrRemoveFilterClients(); | 3953 updateOrRemoveFilterClients(); |
| 3954 // During an accelerated animation, both WebKit and the compositor animate p
roperties. | 3954 // During an accelerated animation, both WebKit and the compositor animate p
roperties. |
| 3955 // However, WebKit shouldn't ask the compositor to update its filters if the
compositor is performing the animation. | 3955 // However, WebKit shouldn't ask the compositor to update its filters if the
compositor is performing the animation. |
| 3956 bool shouldUpdateFilters = compositedLayerMapping() && !renderer()->animatio
n().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyWebkitFilter)
; | 3956 bool shouldUpdateFilters = hasCompositedLayerMapping() && !renderer()->anima
tion().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyWebkitFilt
er); |
| 3957 if (shouldUpdateFilters) | 3957 if (shouldUpdateFilters) |
| 3958 compositedLayerMapping()->updateFilters(renderer()->style()); | 3958 compositedLayerMapping()->updateFilters(renderer()->style()); |
| 3959 updateOrRemoveFilterEffectRenderer(); | 3959 updateOrRemoveFilterEffectRenderer(); |
| 3960 } | 3960 } |
| 3961 | 3961 |
| 3962 void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle) | 3962 void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle) |
| 3963 { | 3963 { |
| 3964 m_stackingNode->updateIsNormalFlowOnly(); | 3964 m_stackingNode->updateIsNormalFlowOnly(); |
| 3965 | 3965 |
| 3966 if (m_scrollableArea) | 3966 if (m_scrollableArea) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 3985 if (paintsWithFilters()) | 3985 if (paintsWithFilters()) |
| 3986 didPaintWithFilters = true; | 3986 didPaintWithFilters = true; |
| 3987 updateFilters(oldStyle, renderer()->style()); | 3987 updateFilters(oldStyle, renderer()->style()); |
| 3988 | 3988 |
| 3989 const RenderStyle* newStyle = renderer()->style(); | 3989 const RenderStyle* newStyle = renderer()->style(); |
| 3990 if (compositor()->updateLayerCompositingState(this) | 3990 if (compositor()->updateLayerCompositingState(this) |
| 3991 || needsCompositingLayersRebuiltForClip(oldStyle, newStyle) | 3991 || needsCompositingLayersRebuiltForClip(oldStyle, newStyle) |
| 3992 || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle) | 3992 || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle) |
| 3993 || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintW
ithFilters)) | 3993 || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintW
ithFilters)) |
| 3994 compositor()->setCompositingLayersNeedRebuild(); | 3994 compositor()->setCompositingLayersNeedRebuild(); |
| 3995 else if (compositedLayerMapping()) | 3995 else if (hasCompositedLayerMapping()) |
| 3996 compositedLayerMapping()->updateGraphicsLayerGeometry(); | 3996 compositedLayerMapping()->updateGraphicsLayerGeometry(); |
| 3997 } | 3997 } |
| 3998 | 3998 |
| 3999 bool RenderLayer::scrollsOverflow() const | 3999 bool RenderLayer::scrollsOverflow() const |
| 4000 { | 4000 { |
| 4001 if (RenderLayerScrollableArea* scrollableArea = this->scrollableArea()) | 4001 if (RenderLayerScrollableArea* scrollableArea = this->scrollableArea()) |
| 4002 return scrollableArea->scrollsOverflow(); | 4002 return scrollableArea->scrollsOverflow(); |
| 4003 | 4003 |
| 4004 return false; | 4004 return false; |
| 4005 } | 4005 } |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4163 } | 4163 } |
| 4164 } | 4164 } |
| 4165 | 4165 |
| 4166 void showLayerTree(const WebCore::RenderObject* renderer) | 4166 void showLayerTree(const WebCore::RenderObject* renderer) |
| 4167 { | 4167 { |
| 4168 if (!renderer) | 4168 if (!renderer) |
| 4169 return; | 4169 return; |
| 4170 showLayerTree(renderer->enclosingLayer()); | 4170 showLayerTree(renderer->enclosingLayer()); |
| 4171 } | 4171 } |
| 4172 #endif | 4172 #endif |
| OLD | NEW |