| 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 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1515 // Note: This is only for output rect, so there's no need to expand the
dirty source rect. | 1515 // Note: This is only for output rect, so there's no need to expand the
dirty source rect. |
| 1516 rectForRepaint.unite(calculateLayerBounds(this)); | 1516 rectForRepaint.unite(calculateLayerBounds(this)); |
| 1517 } | 1517 } |
| 1518 | 1518 |
| 1519 RenderLayer* parentLayer = enclosingFilterRepaintLayer(); | 1519 RenderLayer* parentLayer = enclosingFilterRepaintLayer(); |
| 1520 ASSERT(parentLayer); | 1520 ASSERT(parentLayer); |
| 1521 FloatQuad repaintQuad(rectForRepaint); | 1521 FloatQuad repaintQuad(rectForRepaint); |
| 1522 LayoutRect parentLayerRect = renderer()->localToContainerQuad(repaintQuad, p
arentLayer->renderer()).enclosingBoundingBox(); | 1522 LayoutRect parentLayerRect = renderer()->localToContainerQuad(repaintQuad, p
arentLayer->renderer()).enclosingBoundingBox(); |
| 1523 | 1523 |
| 1524 if (parentLayer->isComposited()) { | 1524 if (parentLayer->isComposited()) { |
| 1525 parentLayer->setBackingNeedsRepaintInRect(parentLayerRect); | 1525 if (!parentLayer->backing()->paintsIntoWindow()) { |
| 1526 return; | 1526 parentLayer->setBackingNeedsRepaintInRect(parentLayerRect); |
| 1527 return; |
| 1528 } |
| 1529 // If the painting goes to window, redirect the painting to the parent R
enderView. |
| 1530 parentLayer = renderer()->view()->layer(); |
| 1531 parentLayerRect = renderer()->localToContainerQuad(repaintQuad, parentLa
yer->renderer()).enclosingBoundingBox(); |
| 1527 } | 1532 } |
| 1528 | 1533 |
| 1529 if (parentLayer->paintsWithFilters()) { | 1534 if (parentLayer->paintsWithFilters()) { |
| 1530 parentLayer->setFilterBackendNeedsRepaintingInRect(parentLayerRect); | 1535 parentLayer->setFilterBackendNeedsRepaintingInRect(parentLayerRect); |
| 1531 return; | 1536 return; |
| 1532 } | 1537 } |
| 1533 | 1538 |
| 1534 if (parentLayer->isRootLayer()) { | 1539 if (parentLayer->isRootLayer()) { |
| 1535 RenderView* view = toRenderView(parentLayer->renderer()); | 1540 RenderView* view = toRenderView(parentLayer->renderer()); |
| 1536 view->repaintViewRectangle(parentLayerRect); | 1541 view->repaintViewRectangle(parentLayerRect); |
| (...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3585 return false; | 3590 return false; |
| 3586 } | 3591 } |
| 3587 | 3592 |
| 3588 void RenderLayer::paintLayer(GraphicsContext* context, const LayerPaintingInfo&
paintingInfo, PaintLayerFlags paintFlags) | 3593 void RenderLayer::paintLayer(GraphicsContext* context, const LayerPaintingInfo&
paintingInfo, PaintLayerFlags paintFlags) |
| 3589 { | 3594 { |
| 3590 if (isComposited()) { | 3595 if (isComposited()) { |
| 3591 // The updatingControlTints() painting pass goes through compositing lay
ers, | 3596 // The updatingControlTints() painting pass goes through compositing lay
ers, |
| 3592 // but we need to ensure that we don't cache clip rects computed with th
e wrong root in this case. | 3597 // but we need to ensure that we don't cache clip rects computed with th
e wrong root in this case. |
| 3593 if (context->updatingControlTints() || (paintingInfo.paintBehavior & Pai
ntBehaviorFlattenCompositingLayers)) | 3598 if (context->updatingControlTints() || (paintingInfo.paintBehavior & Pai
ntBehaviorFlattenCompositingLayers)) |
| 3594 paintFlags |= PaintLayerTemporaryClipRects; | 3599 paintFlags |= PaintLayerTemporaryClipRects; |
| 3595 else if (!backing()->paintsIntoCompositedAncestor() | 3600 else if (!backing()->paintsIntoWindow() |
| 3601 && !backing()->paintsIntoCompositedAncestor() |
| 3596 && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingRefle
ction)) { | 3602 && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingRefle
ction)) { |
| 3597 // If this RenderLayer should paint into its backing, that will be d
one via RenderLayerBacking::paintIntoLayer(). | 3603 // If this RenderLayer should paint into its backing, that will be d
one via RenderLayerBacking::paintIntoLayer(). |
| 3598 return; | 3604 return; |
| 3599 } | 3605 } |
| 3600 } else if (viewportConstrainedNotCompositedReason() == NotCompositedForBound
sOutOfView) { | 3606 } else if (viewportConstrainedNotCompositedReason() == NotCompositedForBound
sOutOfView) { |
| 3601 // Don't paint out-of-view viewport constrained layers (when doing prepa
inting) because they will never be visible | 3607 // Don't paint out-of-view viewport constrained layers (when doing prepa
inting) because they will never be visible |
| 3602 // unless their position or viewport size is changed. | 3608 // unless their position or viewport size is changed. |
| 3603 return; | 3609 return; |
| 3604 } | 3610 } |
| 3605 | 3611 |
| (...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5497 return m_backing ? m_backing->layerForVerticalScrollbar() : 0; | 5503 return m_backing ? m_backing->layerForVerticalScrollbar() : 0; |
| 5498 } | 5504 } |
| 5499 | 5505 |
| 5500 GraphicsLayer* RenderLayer::layerForScrollCorner() const | 5506 GraphicsLayer* RenderLayer::layerForScrollCorner() const |
| 5501 { | 5507 { |
| 5502 return m_backing ? m_backing->layerForScrollCorner() : 0; | 5508 return m_backing ? m_backing->layerForScrollCorner() : 0; |
| 5503 } | 5509 } |
| 5504 | 5510 |
| 5505 bool RenderLayer::paintsWithTransform(PaintBehavior paintBehavior) const | 5511 bool RenderLayer::paintsWithTransform(PaintBehavior paintBehavior) const |
| 5506 { | 5512 { |
| 5507 return transform() && ((paintBehavior & PaintBehaviorFlattenCompositingLayer
s) || !isComposited()); | 5513 bool paintsToWindow = !isComposited() || backing()->paintsIntoWindow(); |
| 5514 return transform() && ((paintBehavior & PaintBehaviorFlattenCompositingLayer
s) || paintsToWindow); |
| 5508 } | 5515 } |
| 5509 | 5516 |
| 5510 bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect)
const | 5517 bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect)
const |
| 5511 { | 5518 { |
| 5512 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) | 5519 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
| 5513 return false; | 5520 return false; |
| 5514 | 5521 |
| 5515 if (paintsWithTransparency(PaintBehaviorNormal)) | 5522 if (paintsWithTransparency(PaintBehaviorNormal)) |
| 5516 return false; | 5523 return false; |
| 5517 | 5524 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5753 void RenderLayer::repaintIncludingDescendants() | 5760 void RenderLayer::repaintIncludingDescendants() |
| 5754 { | 5761 { |
| 5755 renderer()->repaint(); | 5762 renderer()->repaint(); |
| 5756 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) | 5763 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) |
| 5757 curr->repaintIncludingDescendants(); | 5764 curr->repaintIncludingDescendants(); |
| 5758 } | 5765 } |
| 5759 | 5766 |
| 5760 void RenderLayer::setBackingNeedsRepaint() | 5767 void RenderLayer::setBackingNeedsRepaint() |
| 5761 { | 5768 { |
| 5762 ASSERT(isComposited()); | 5769 ASSERT(isComposited()); |
| 5763 backing()->setContentsNeedDisplay(); | 5770 if (backing()->paintsIntoWindow()) { |
| 5771 // If we're trying to repaint the placeholder document layer, propagate
the |
| 5772 // repaint to the native view system. |
| 5773 RenderView* view = renderer()->view(); |
| 5774 if (view) |
| 5775 view->repaintViewRectangle(absoluteBoundingBox()); |
| 5776 } else |
| 5777 backing()->setContentsNeedDisplay(); |
| 5764 } | 5778 } |
| 5765 | 5779 |
| 5766 void RenderLayer::setBackingNeedsRepaintInRect(const LayoutRect& r) | 5780 void RenderLayer::setBackingNeedsRepaintInRect(const LayoutRect& r) |
| 5767 { | 5781 { |
| 5768 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, | 5782 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, |
| 5769 // so assert but check that the layer is composited. | 5783 // so assert but check that the layer is composited. |
| 5770 ASSERT(isComposited()); | 5784 ASSERT(isComposited()); |
| 5771 if (!isComposited()) { | 5785 if (!isComposited() || backing()->paintsIntoWindow()) { |
| 5772 // If we're trying to repaint the placeholder document layer, propagate
the | 5786 // If we're trying to repaint the placeholder document layer, propagate
the |
| 5773 // repaint to the native view system. | 5787 // repaint to the native view system. |
| 5774 LayoutRect absRect(r); | 5788 LayoutRect absRect(r); |
| 5775 LayoutPoint delta; | 5789 LayoutPoint delta; |
| 5776 convertToLayerCoords(root(), delta); | 5790 convertToLayerCoords(root(), delta); |
| 5777 absRect.moveBy(delta); | 5791 absRect.moveBy(delta); |
| 5778 | 5792 |
| 5779 RenderView* view = renderer()->view(); | 5793 RenderView* view = renderer()->view(); |
| 5780 if (view) | 5794 if (view) |
| 5781 view->repaintViewRectangle(absRect); | 5795 view->repaintViewRectangle(absRect); |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6442 } | 6456 } |
| 6443 } | 6457 } |
| 6444 | 6458 |
| 6445 void showLayerTree(const WebCore::RenderObject* renderer) | 6459 void showLayerTree(const WebCore::RenderObject* renderer) |
| 6446 { | 6460 { |
| 6447 if (!renderer) | 6461 if (!renderer) |
| 6448 return; | 6462 return; |
| 6449 showLayerTree(renderer->enclosingLayer()); | 6463 showLayerTree(renderer->enclosingLayer()); |
| 6450 } | 6464 } |
| 6451 #endif | 6465 #endif |
| OLD | NEW |