| 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 enum TransparencyClipBoxMode { | 467 enum TransparencyClipBoxMode { |
| 468 DescendantsOfTransparencyClipBox, | 468 DescendantsOfTransparencyClipBox, |
| 469 RootOfTransparencyClipBox | 469 RootOfTransparencyClipBox |
| 470 }; | 470 }; |
| 471 | 471 |
| 472 static LayoutRect transparencyClipBox(const RenderLayer*, const RenderLayer* roo
tLayer, TransparencyClipBoxBehavior, TransparencyClipBoxMode, const LayoutSize&
subPixelAccumulation); | 472 static LayoutRect transparencyClipBox(const RenderLayer*, const RenderLayer* roo
tLayer, TransparencyClipBoxBehavior, TransparencyClipBoxMode, const LayoutSize&
subPixelAccumulation); |
| 473 | 473 |
| 474 static void expandClipRectForDescendantsAndReflection(LayoutRect& clipRect, cons
t RenderLayer* layer, const RenderLayer* rootLayer, | 474 static void expandClipRectForDescendantsAndReflection(LayoutRect& clipRect, cons
t RenderLayer* layer, const RenderLayer* rootLayer, |
| 475 TransparencyClipBoxBehavior transparencyBehavior, const LayoutSize& subPixel
Accumulation) | 475 TransparencyClipBoxBehavior transparencyBehavior, const LayoutSize& subPixel
Accumulation) |
| 476 { | 476 { |
| 477 // If we have a mask, then the clip is limited to the border box area (and t
here is | 477 // Note: we don't have to walk z-order lists since transparent elements alwa
ys establish |
| 478 // no need to examine child layers). | 478 // a stacking container. This means we can just walk the layer tree directly
. |
| 479 if (!layer->renderer()->hasMask()) { | 479 for (RenderLayer* curr = layer->firstChild(); curr; curr = curr->nextSibling
()) |
| 480 // Note: we don't have to walk z-order lists since transparent elements
always establish | 480 clipRect.unite(transparencyClipBox(curr, rootLayer, transparencyBehavior
, DescendantsOfTransparencyClipBox, subPixelAccumulation)); |
| 481 // a stacking container. This means we can just walk the layer tree dire
ctly. | |
| 482 for (RenderLayer* curr = layer->firstChild(); curr; curr = curr->nextSib
ling()) | |
| 483 clipRect.unite(transparencyClipBox(curr, rootLayer, transparencyBeha
vior, DescendantsOfTransparencyClipBox, subPixelAccumulation)); | |
| 484 } | |
| 485 } | 481 } |
| 486 | 482 |
| 487 static LayoutRect transparencyClipBox(const RenderLayer* layer, const RenderLaye
r* rootLayer, TransparencyClipBoxBehavior transparencyBehavior, | 483 static LayoutRect transparencyClipBox(const RenderLayer* layer, const RenderLaye
r* rootLayer, TransparencyClipBoxBehavior transparencyBehavior, |
| 488 TransparencyClipBoxMode transparencyMode, const LayoutSize& subPixelAccumula
tion) | 484 TransparencyClipBoxMode transparencyMode, const LayoutSize& subPixelAccumula
tion) |
| 489 { | 485 { |
| 490 // FIXME: Although this function completely ignores CSS-imposed clipping, we
did already intersect with the | 486 // FIXME: Although this function completely ignores CSS-imposed clipping, we
did already intersect with the |
| 491 // paintDirtyRect, and that should cut down on the amount we have to paint.
Still it | 487 // paintDirtyRect, and that should cut down on the amount we have to paint.
Still it |
| 492 // would be better to respect clips. | 488 // would be better to respect clips. |
| 493 | 489 |
| 494 if (rootLayer != layer && ((transparencyBehavior == PaintingTransparencyClip
Box && layer->paintsWithTransform()) | 490 if (rootLayer != layer && ((transparencyBehavior == PaintingTransparencyClip
Box && layer->paintsWithTransform()) |
| (...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1573 bool RenderLayer::hasVisibleBoxDecorations() const | 1569 bool RenderLayer::hasVisibleBoxDecorations() const |
| 1574 { | 1570 { |
| 1575 return hasBoxDecorationsOrBackground(); | 1571 return hasBoxDecorationsOrBackground(); |
| 1576 } | 1572 } |
| 1577 | 1573 |
| 1578 bool RenderLayer::isVisuallyNonEmpty() const | 1574 bool RenderLayer::isVisuallyNonEmpty() const |
| 1579 { | 1575 { |
| 1580 if (hasNonEmptyChildRenderers()) | 1576 if (hasNonEmptyChildRenderers()) |
| 1581 return true; | 1577 return true; |
| 1582 | 1578 |
| 1583 if (renderer()->isReplaced() || renderer()->hasMask()) | 1579 if (renderer()->isReplaced()) |
| 1584 return true; | 1580 return true; |
| 1585 | 1581 |
| 1586 if (hasVisibleBoxDecorations()) | 1582 if (hasVisibleBoxDecorations()) |
| 1587 return true; | 1583 return true; |
| 1588 | 1584 |
| 1589 return false; | 1585 return false; |
| 1590 } | 1586 } |
| 1591 | 1587 |
| 1592 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle*
newStyle) | 1588 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle*
newStyle) |
| 1593 { | 1589 { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 } | 1668 } |
| 1673 } | 1669 } |
| 1674 | 1670 |
| 1675 void showLayerTree(const blink::RenderObject* renderer) | 1671 void showLayerTree(const blink::RenderObject* renderer) |
| 1676 { | 1672 { |
| 1677 if (!renderer) | 1673 if (!renderer) |
| 1678 return; | 1674 return; |
| 1679 showLayerTree(renderer->enclosingLayer()); | 1675 showLayerTree(renderer->enclosingLayer()); |
| 1680 } | 1676 } |
| 1681 #endif | 1677 #endif |
| OLD | NEW |