| 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 5532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5543 } | 5543 } |
| 5544 | 5544 |
| 5545 bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect)
const | 5545 bool RenderLayer::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect)
const |
| 5546 { | 5546 { |
| 5547 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) | 5547 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
| 5548 return false; | 5548 return false; |
| 5549 | 5549 |
| 5550 if (paintsWithTransparency(PaintBehaviorNormal)) | 5550 if (paintsWithTransparency(PaintBehaviorNormal)) |
| 5551 return false; | 5551 return false; |
| 5552 | 5552 |
| 5553 // We can't use hasVisibleContent(), because that will be true if our render
er is hidden, but some child |
| 5554 // is visible and that child doesn't cover the entire rect. |
| 5555 if (renderer()->style()->visibility() != VISIBLE) |
| 5556 return false; |
| 5557 |
| 5553 if (paintsWithFilters() && renderer()->style()->filter().hasFilterThatAffect
sOpacity()) | 5558 if (paintsWithFilters() && renderer()->style()->filter().hasFilterThatAffect
sOpacity()) |
| 5554 return false; | 5559 return false; |
| 5555 | 5560 |
| 5556 // FIXME: Handle simple transforms. | 5561 // FIXME: Handle simple transforms. |
| 5557 if (paintsWithTransform(PaintBehaviorNormal)) | 5562 if (paintsWithTransform(PaintBehaviorNormal)) |
| 5558 return false; | 5563 return false; |
| 5559 | 5564 |
| 5560 // FIXME: Remove this check. | 5565 // FIXME: Remove this check. |
| 5561 // This function should not be called when layer-lists are dirty. | 5566 // This function should not be called when layer-lists are dirty. |
| 5562 // It is somehow getting triggered during style update. | 5567 // It is somehow getting triggered during style update. |
| 5563 if (m_zOrderListsDirty || m_normalFlowListDirty) | 5568 if (m_zOrderListsDirty || m_normalFlowListDirty) |
| 5564 return false; | 5569 return false; |
| 5565 | 5570 |
| 5566 // FIXME: We currently only check the immediate renderer, | 5571 // FIXME: We currently only check the immediate renderer, |
| 5567 // which will miss many cases. | 5572 // which will miss many cases. |
| 5568 return renderer()->backgroundIsKnownToBeOpaqueInRect(localRect) | 5573 if (renderer()->backgroundIsKnownToBeOpaqueInRect(localRect)) |
| 5569 || listBackgroundIsKnownToBeOpaqueInRect(posZOrderList(), localRect) | 5574 return true; |
| 5575 |
| 5576 // We can't consult child layers if we clip, since they might cover |
| 5577 // parts of the rect that are clipped out. |
| 5578 if (renderer()->hasOverflowClip()) |
| 5579 return false; |
| 5580 |
| 5581 return listBackgroundIsKnownToBeOpaqueInRect(posZOrderList(), localRect) |
| 5570 || listBackgroundIsKnownToBeOpaqueInRect(negZOrderList(), localRect) | 5582 || listBackgroundIsKnownToBeOpaqueInRect(negZOrderList(), localRect) |
| 5571 || listBackgroundIsKnownToBeOpaqueInRect(normalFlowList(), localRect); | 5583 || listBackgroundIsKnownToBeOpaqueInRect(normalFlowList(), localRect); |
| 5572 } | 5584 } |
| 5573 | 5585 |
| 5574 bool RenderLayer::listBackgroundIsKnownToBeOpaqueInRect(const Vector<RenderLayer
*>* list, const LayoutRect& localRect) const | 5586 bool RenderLayer::listBackgroundIsKnownToBeOpaqueInRect(const Vector<RenderLayer
*>* list, const LayoutRect& localRect) const |
| 5575 { | 5587 { |
| 5576 if (!list || list->isEmpty()) | 5588 if (!list || list->isEmpty()) |
| 5577 return false; | 5589 return false; |
| 5578 | 5590 |
| 5579 for (Vector<RenderLayer*>::const_reverse_iterator iter = list->rbegin(); ite
r != list->rend(); ++iter) { | 5591 for (Vector<RenderLayer*>::const_reverse_iterator iter = list->rbegin(); ite
r != list->rend(); ++iter) { |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6452 } | 6464 } |
| 6453 } | 6465 } |
| 6454 | 6466 |
| 6455 void showLayerTree(const WebCore::RenderObject* renderer) | 6467 void showLayerTree(const WebCore::RenderObject* renderer) |
| 6456 { | 6468 { |
| 6457 if (!renderer) | 6469 if (!renderer) |
| 6458 return; | 6470 return; |
| 6459 showLayerTree(renderer->enclosingLayer()); | 6471 showLayerTree(renderer->enclosingLayer()); |
| 6460 } | 6472 } |
| 6461 #endif | 6473 #endif |
| OLD | NEW |