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 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3507 { | 3507 { |
3508 if (!m_containsDirtyOverlayScrollbars) | 3508 if (!m_containsDirtyOverlayScrollbars) |
3509 return; | 3509 return; |
3510 | 3510 |
3511 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBeha
vior, LayoutSize(), paintingRoot); | 3511 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBeha
vior, LayoutSize(), paintingRoot); |
3512 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 3512 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
3513 | 3513 |
3514 m_containsDirtyOverlayScrollbars = false; | 3514 m_containsDirtyOverlayScrollbars = false; |
3515 } | 3515 } |
3516 | 3516 |
3517 #ifndef DISABLE_ROUNDED_CORNER_CLIPPING | |
3518 static bool inContainingBlockChain(RenderLayer* startLayer, RenderLayer* endLaye
r) | 3517 static bool inContainingBlockChain(RenderLayer* startLayer, RenderLayer* endLaye
r) |
3519 { | 3518 { |
3520 if (startLayer == endLayer) | 3519 if (startLayer == endLayer) |
3521 return true; | 3520 return true; |
3522 | 3521 |
3523 RenderView* view = startLayer->renderer()->view(); | 3522 RenderView* view = startLayer->renderer()->view(); |
3524 for (RenderBlock* currentBlock = startLayer->renderer()->containingBlock();
currentBlock && currentBlock != view; currentBlock = currentBlock->containingBlo
ck()) { | 3523 for (RenderBlock* currentBlock = startLayer->renderer()->containingBlock();
currentBlock && currentBlock != view; currentBlock = currentBlock->containingBlo
ck()) { |
3525 if (currentBlock->layer() == endLayer) | 3524 if (currentBlock->layer() == endLayer) |
3526 return true; | 3525 return true; |
3527 } | 3526 } |
3528 | 3527 |
3529 return false; | 3528 return false; |
3530 } | 3529 } |
3531 #endif | |
3532 | 3530 |
3533 void RenderLayer::clipToRect(RenderLayer* rootLayer, GraphicsContext* context, c
onst LayoutRect& paintDirtyRect, const ClipRect& clipRect, | 3531 void RenderLayer::clipToRect(RenderLayer* rootLayer, GraphicsContext* context, c
onst LayoutRect& paintDirtyRect, const ClipRect& clipRect, |
3534 BorderRadiusClippingRule rule) | 3532 BorderRadiusClippingRule rule) |
3535 { | 3533 { |
3536 if (clipRect.rect() == paintDirtyRect) | 3534 if (clipRect.rect() == paintDirtyRect) |
3537 return; | 3535 return; |
3538 context->save(); | 3536 context->save(); |
3539 context->clip(pixelSnappedIntRect(clipRect.rect())); | 3537 context->clip(pixelSnappedIntRect(clipRect.rect())); |
3540 | 3538 |
3541 if (!clipRect.hasRadius()) | 3539 if (!clipRect.hasRadius()) |
3542 return; | 3540 return; |
3543 | 3541 |
3544 #ifndef DISABLE_ROUNDED_CORNER_CLIPPING | |
3545 // If the clip rect has been tainted by a border radius, then we have to wal
k up our layer chain applying the clips from | 3542 // If the clip rect has been tainted by a border radius, then we have to wal
k up our layer chain applying the clips from |
3546 // any layers with overflow. The condition for being able to apply these cli
ps is that the overflow object be in our | 3543 // any layers with overflow. The condition for being able to apply these cli
ps is that the overflow object be in our |
3547 // containing block chain so we check that also. | 3544 // containing block chain so we check that also. |
3548 for (RenderLayer* layer = rule == IncludeSelfForBorderRadius ? this : parent
(); layer; layer = layer->parent()) { | 3545 for (RenderLayer* layer = rule == IncludeSelfForBorderRadius ? this : parent
(); layer; layer = layer->parent()) { |
3549 if (layer->renderer()->hasOverflowClip() && layer->renderer()->style()->
hasBorderRadius() && inContainingBlockChain(this, layer)) { | 3546 if (layer->renderer()->hasOverflowClip() && layer->renderer()->style()->
hasBorderRadius() && inContainingBlockChain(this, layer)) { |
3550 LayoutPoint delta; | 3547 LayoutPoint delta; |
3551 layer->convertToLayerCoords(rootLayer, delta); | 3548 layer->convertToLayerCoords(rootLayer, delta); |
3552 context->clipRoundedRect(layer->renderer()->style()->getRoundedI
nnerBorderFor(LayoutRect(delta, layer->size()))); | 3549 context->clipRoundedRect(layer->renderer()->style()->getRoundedI
nnerBorderFor(LayoutRect(delta, layer->size()))); |
3553 } | 3550 } |
3554 | 3551 |
3555 if (layer == rootLayer) | 3552 if (layer == rootLayer) |
3556 break; | 3553 break; |
3557 } | 3554 } |
3558 #endif | |
3559 } | 3555 } |
3560 | 3556 |
3561 void RenderLayer::restoreClip(GraphicsContext* context, const LayoutRect& paintD
irtyRect, const ClipRect& clipRect) | 3557 void RenderLayer::restoreClip(GraphicsContext* context, const LayoutRect& paintD
irtyRect, const ClipRect& clipRect) |
3562 { | 3558 { |
3563 if (clipRect.rect() == paintDirtyRect) | 3559 if (clipRect.rect() == paintDirtyRect) |
3564 return; | 3560 return; |
3565 context->restore(); | 3561 context->restore(); |
3566 } | 3562 } |
3567 | 3563 |
3568 static void performOverlapTests(OverlapTestRequestMap& overlapTestRequests, cons
t RenderLayer* rootLayer, const RenderLayer* layer) | 3564 static void performOverlapTests(OverlapTestRequestMap& overlapTestRequests, cons
t RenderLayer* rootLayer, const RenderLayer* layer) |
(...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6468 } | 6464 } |
6469 } | 6465 } |
6470 | 6466 |
6471 void showLayerTree(const WebCore::RenderObject* renderer) | 6467 void showLayerTree(const WebCore::RenderObject* renderer) |
6472 { | 6468 { |
6473 if (!renderer) | 6469 if (!renderer) |
6474 return; | 6470 return; |
6475 showLayerTree(renderer->enclosingLayer()); | 6471 showLayerTree(renderer->enclosingLayer()); |
6476 } | 6472 } |
6477 #endif | 6473 #endif |
OLD | NEW |