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 2338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2349 switch (compositingState()) { | 2349 switch (compositingState()) { |
2350 case NotComposited: | 2350 case NotComposited: |
2351 return 0; | 2351 return 0; |
2352 case PaintsIntoGroupedBacking: | 2352 case PaintsIntoGroupedBacking: |
2353 return groupedMapping()->squashingLayer(); | 2353 return groupedMapping()->squashingLayer(); |
2354 default: | 2354 default: |
2355 return compositedLayerMapping()->scrollingContentsLayer() ? compositedLa
yerMapping()->scrollingContentsLayer() : compositedLayerMapping()->mainGraphicsL
ayer(); | 2355 return compositedLayerMapping()->scrollingContentsLayer() ? compositedLa
yerMapping()->scrollingContentsLayer() : compositedLayerMapping()->mainGraphicsL
ayer(); |
2356 } | 2356 } |
2357 } | 2357 } |
2358 | 2358 |
| 2359 bool PaintLayer::shouldPaintBackgroundOntoScrollingContentsLayer() const |
| 2360 { |
| 2361 return !isRootLayer() |
| 2362 && scrollsOverflow() |
| 2363 && layoutObject()->style()->hasEntirelyLocalBackground() |
| 2364 && !stackingNode()->hasNegativeZOrderList(); |
| 2365 } |
| 2366 |
2359 void PaintLayer::ensureCompositedLayerMapping() | 2367 void PaintLayer::ensureCompositedLayerMapping() |
2360 { | 2368 { |
2361 if (m_rareData && m_rareData->compositedLayerMapping) | 2369 if (m_rareData && m_rareData->compositedLayerMapping) |
2362 return; | 2370 return; |
2363 | 2371 |
2364 ensureRareData().compositedLayerMapping = wrapUnique(new CompositedLayerMapp
ing(*this)); | 2372 ensureRareData().compositedLayerMapping = wrapUnique(new CompositedLayerMapp
ing(*this)); |
2365 m_rareData->compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLaye
rUpdateSubtree); | 2373 m_rareData->compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLaye
rUpdateSubtree); |
2366 | 2374 |
2367 updateOrRemoveFilterEffectBuilder(); | 2375 updateOrRemoveFilterEffectBuilder(); |
2368 } | 2376 } |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2456 // cover the given rect, but a unioning method would require children to com
pute and report | 2464 // cover the given rect, but a unioning method would require children to com
pute and report |
2457 // their rects. | 2465 // their rects. |
2458 return childBackgroundIsKnownToBeOpaqueInRect(localRect); | 2466 return childBackgroundIsKnownToBeOpaqueInRect(localRect); |
2459 } | 2467 } |
2460 | 2468 |
2461 bool PaintLayer::childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR
ect) const | 2469 bool PaintLayer::childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR
ect) const |
2462 { | 2470 { |
2463 PaintLayerStackingNodeReverseIterator reverseIterator(*m_stackingNode, Posit
iveZOrderChildren | NormalFlowChildren | NegativeZOrderChildren); | 2471 PaintLayerStackingNodeReverseIterator reverseIterator(*m_stackingNode, Posit
iveZOrderChildren | NormalFlowChildren | NegativeZOrderChildren); |
2464 while (PaintLayerStackingNode* child = reverseIterator.next()) { | 2472 while (PaintLayerStackingNode* child = reverseIterator.next()) { |
2465 const PaintLayer* childLayer = child->layer(); | 2473 const PaintLayer* childLayer = child->layer(); |
2466 // Stop at composited paint boundaries. | 2474 // Stop at composited paint boundaries and non-self-painting layers. |
2467 if (childLayer->isPaintInvalidationContainer()) | 2475 if (childLayer->isPaintInvalidationContainer()) |
2468 continue; | 2476 continue; |
2469 | 2477 |
2470 if (!childLayer->canUseConvertToLayerCoords()) | 2478 if (!childLayer->canUseConvertToLayerCoords()) |
2471 continue; | 2479 continue; |
2472 | 2480 |
2473 LayoutPoint childOffset; | 2481 LayoutPoint childOffset; |
2474 LayoutRect childLocalRect(localRect); | 2482 LayoutRect childLocalRect(localRect); |
2475 childLayer->convertToLayerCoords(this, childOffset); | 2483 childLayer->convertToLayerCoords(this, childOffset); |
2476 childLocalRect.moveBy(-childOffset); | 2484 childLocalRect.moveBy(-childOffset); |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2972 | 2980 |
2973 void showLayerTree(const blink::LayoutObject* layoutObject) | 2981 void showLayerTree(const blink::LayoutObject* layoutObject) |
2974 { | 2982 { |
2975 if (!layoutObject) { | 2983 if (!layoutObject) { |
2976 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2984 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2977 return; | 2985 return; |
2978 } | 2986 } |
2979 showLayerTree(layoutObject->enclosingLayer()); | 2987 showLayerTree(layoutObject->enclosingLayer()); |
2980 } | 2988 } |
2981 #endif | 2989 #endif |
OLD | NEW |