| 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 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1503 // Note: This is only for output rect, so there's no need to expand the
dirty source rect. | 1503 // Note: This is only for output rect, so there's no need to expand the
dirty source rect. |
| 1504 rectForRepaint.unite(calculateLayerBounds(this)); | 1504 rectForRepaint.unite(calculateLayerBounds(this)); |
| 1505 } | 1505 } |
| 1506 | 1506 |
| 1507 RenderLayer* parentLayer = enclosingFilterRepaintLayer(); | 1507 RenderLayer* parentLayer = enclosingFilterRepaintLayer(); |
| 1508 ASSERT(parentLayer); | 1508 ASSERT(parentLayer); |
| 1509 FloatQuad repaintQuad(rectForRepaint); | 1509 FloatQuad repaintQuad(rectForRepaint); |
| 1510 LayoutRect parentLayerRect = renderer()->localToContainerQuad(repaintQuad, p
arentLayer->renderer()).enclosingBoundingBox(); | 1510 LayoutRect parentLayerRect = renderer()->localToContainerQuad(repaintQuad, p
arentLayer->renderer()).enclosingBoundingBox(); |
| 1511 | 1511 |
| 1512 if (parentLayer->isComposited()) { | 1512 if (parentLayer->isComposited()) { |
| 1513 if (!parentLayer->backing()->paintsIntoWindow()) { | 1513 parentLayer->setBackingNeedsRepaintInRect(parentLayerRect); |
| 1514 parentLayer->setBackingNeedsRepaintInRect(parentLayerRect); | 1514 return; |
| 1515 return; | |
| 1516 } | |
| 1517 // If the painting goes to window, redirect the painting to the parent R
enderView. | |
| 1518 parentLayer = renderer()->view()->layer(); | |
| 1519 parentLayerRect = renderer()->localToContainerQuad(repaintQuad, parentLa
yer->renderer()).enclosingBoundingBox(); | |
| 1520 } | 1515 } |
| 1521 | 1516 |
| 1522 if (parentLayer->paintsWithFilters()) { | 1517 if (parentLayer->paintsWithFilters()) { |
| 1523 parentLayer->setFilterBackendNeedsRepaintingInRect(parentLayerRect); | 1518 parentLayer->setFilterBackendNeedsRepaintingInRect(parentLayerRect); |
| 1524 return; | 1519 return; |
| 1525 } | 1520 } |
| 1526 | 1521 |
| 1527 if (parentLayer->isRootLayer()) { | 1522 if (parentLayer->isRootLayer()) { |
| 1528 RenderView* view = toRenderView(parentLayer->renderer()); | 1523 RenderView* view = toRenderView(parentLayer->renderer()); |
| 1529 view->repaintViewRectangle(parentLayerRect); | 1524 view->repaintViewRectangle(parentLayerRect); |
| (...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3578 return false; | 3573 return false; |
| 3579 } | 3574 } |
| 3580 | 3575 |
| 3581 void RenderLayer::paintLayer(GraphicsContext* context, const LayerPaintingInfo&
paintingInfo, PaintLayerFlags paintFlags) | 3576 void RenderLayer::paintLayer(GraphicsContext* context, const LayerPaintingInfo&
paintingInfo, PaintLayerFlags paintFlags) |
| 3582 { | 3577 { |
| 3583 if (isComposited()) { | 3578 if (isComposited()) { |
| 3584 // The updatingControlTints() painting pass goes through compositing lay
ers, | 3579 // The updatingControlTints() painting pass goes through compositing lay
ers, |
| 3585 // but we need to ensure that we don't cache clip rects computed with th
e wrong root in this case. | 3580 // but we need to ensure that we don't cache clip rects computed with th
e wrong root in this case. |
| 3586 if (context->updatingControlTints() || (paintingInfo.paintBehavior & Pai
ntBehaviorFlattenCompositingLayers)) | 3581 if (context->updatingControlTints() || (paintingInfo.paintBehavior & Pai
ntBehaviorFlattenCompositingLayers)) |
| 3587 paintFlags |= PaintLayerTemporaryClipRects; | 3582 paintFlags |= PaintLayerTemporaryClipRects; |
| 3588 else if (!backing()->paintsIntoWindow() | 3583 else if (!backing()->paintsIntoCompositedAncestor() |
| 3589 && !backing()->paintsIntoCompositedAncestor() | |
| 3590 && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingRefle
ction)) { | 3584 && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingRefle
ction)) { |
| 3591 // If this RenderLayer should paint into its backing, that will be d
one via RenderLayerBacking::paintIntoLayer(). | 3585 // If this RenderLayer should paint into its backing, that will be d
one via RenderLayerBacking::paintIntoLayer(). |
| 3592 return; | 3586 return; |
| 3593 } | 3587 } |
| 3594 } else if (viewportConstrainedNotCompositedReason() == NotCompositedForBound
sOutOfView) { | 3588 } else if (viewportConstrainedNotCompositedReason() == NotCompositedForBound
sOutOfView) { |
| 3595 // Don't paint out-of-view viewport constrained layers (when doing prepa
inting) because they will never be visible | 3589 // Don't paint out-of-view viewport constrained layers (when doing prepa
inting) because they will never be visible |
| 3596 // unless their position or viewport size is changed. | 3590 // unless their position or viewport size is changed. |
| 3597 return; | 3591 return; |
| 3598 } | 3592 } |
| 3599 | 3593 |
| (...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5491 return m_backing ? m_backing->layerForVerticalScrollbar() : 0; | 5485 return m_backing ? m_backing->layerForVerticalScrollbar() : 0; |
| 5492 } | 5486 } |
| 5493 | 5487 |
| 5494 GraphicsLayer* RenderLayer::layerForScrollCorner() const | 5488 GraphicsLayer* RenderLayer::layerForScrollCorner() const |
| 5495 { | 5489 { |
| 5496 return m_backing ? m_backing->layerForScrollCorner() : 0; | 5490 return m_backing ? m_backing->layerForScrollCorner() : 0; |
| 5497 } | 5491 } |
| 5498 | 5492 |
| 5499 bool RenderLayer::paintsWithTransform(PaintBehavior paintBehavior) const | 5493 bool RenderLayer::paintsWithTransform(PaintBehavior paintBehavior) const |
| 5500 { | 5494 { |
| 5501 bool paintsToWindow = !isComposited() || backing()->paintsIntoWindow(); | 5495 return transform() && ((paintBehavior & PaintBehaviorFlattenCompositingLayer
s) || !isComposited()); |
| 5502 return transform() && ((paintBehavior & PaintBehaviorFlattenCompositingLayer
s) || paintsToWindow); | |
| 5503 } | 5496 } |
| 5504 | 5497 |
| 5505 bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect)
const | 5498 bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect)
const |
| 5506 { | 5499 { |
| 5507 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) | 5500 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
| 5508 return false; | 5501 return false; |
| 5509 | 5502 |
| 5510 if (paintsWithTransparency(PaintBehaviorNormal)) | 5503 if (paintsWithTransparency(PaintBehaviorNormal)) |
| 5511 return false; | 5504 return false; |
| 5512 | 5505 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5748 void RenderLayer::repaintIncludingDescendants() | 5741 void RenderLayer::repaintIncludingDescendants() |
| 5749 { | 5742 { |
| 5750 renderer()->repaint(); | 5743 renderer()->repaint(); |
| 5751 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) | 5744 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) |
| 5752 curr->repaintIncludingDescendants(); | 5745 curr->repaintIncludingDescendants(); |
| 5753 } | 5746 } |
| 5754 | 5747 |
| 5755 void RenderLayer::setBackingNeedsRepaint() | 5748 void RenderLayer::setBackingNeedsRepaint() |
| 5756 { | 5749 { |
| 5757 ASSERT(isComposited()); | 5750 ASSERT(isComposited()); |
| 5758 if (backing()->paintsIntoWindow()) { | 5751 backing()->setContentsNeedDisplay(); |
| 5759 // If we're trying to repaint the placeholder document layer, propagate
the | |
| 5760 // repaint to the native view system. | |
| 5761 RenderView* view = renderer()->view(); | |
| 5762 if (view) | |
| 5763 view->repaintViewRectangle(absoluteBoundingBox()); | |
| 5764 } else | |
| 5765 backing()->setContentsNeedDisplay(); | |
| 5766 } | 5752 } |
| 5767 | 5753 |
| 5768 void RenderLayer::setBackingNeedsRepaintInRect(const LayoutRect& r) | 5754 void RenderLayer::setBackingNeedsRepaintInRect(const LayoutRect& r) |
| 5769 { | 5755 { |
| 5770 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, | 5756 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, |
| 5771 // so assert but check that the layer is composited. | 5757 // so assert but check that the layer is composited. |
| 5772 ASSERT(isComposited()); | 5758 ASSERT(isComposited()); |
| 5773 if (!isComposited() || backing()->paintsIntoWindow()) { | 5759 if (!isComposited()) { |
| 5774 // If we're trying to repaint the placeholder document layer, propagate
the | 5760 // If we're trying to repaint the placeholder document layer, propagate
the |
| 5775 // repaint to the native view system. | 5761 // repaint to the native view system. |
| 5776 LayoutRect absRect(r); | 5762 LayoutRect absRect(r); |
| 5777 LayoutPoint delta; | 5763 LayoutPoint delta; |
| 5778 convertToLayerCoords(root(), delta); | 5764 convertToLayerCoords(root(), delta); |
| 5779 absRect.moveBy(delta); | 5765 absRect.moveBy(delta); |
| 5780 | 5766 |
| 5781 RenderView* view = renderer()->view(); | 5767 RenderView* view = renderer()->view(); |
| 5782 if (view) | 5768 if (view) |
| 5783 view->repaintViewRectangle(absRect); | 5769 view->repaintViewRectangle(absRect); |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6444 } | 6430 } |
| 6445 } | 6431 } |
| 6446 | 6432 |
| 6447 void showLayerTree(const WebCore::RenderObject* renderer) | 6433 void showLayerTree(const WebCore::RenderObject* renderer) |
| 6448 { | 6434 { |
| 6449 if (!renderer) | 6435 if (!renderer) |
| 6450 return; | 6436 return; |
| 6451 showLayerTree(renderer->enclosingLayer()); | 6437 showLayerTree(renderer->enclosingLayer()); |
| 6452 } | 6438 } |
| 6453 #endif | 6439 #endif |
| OLD | NEW |