| 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 2429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2440 LayoutRect childLocalRect(localRect); | 2440 LayoutRect childLocalRect(localRect); |
| 2441 childLayer->convertToLayerCoords(this, childOffset); | 2441 childLayer->convertToLayerCoords(this, childOffset); |
| 2442 childLocalRect.moveBy(-childOffset); | 2442 childLocalRect.moveBy(-childOffset); |
| 2443 | 2443 |
| 2444 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect)) | 2444 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect)) |
| 2445 return true; | 2445 return true; |
| 2446 } | 2446 } |
| 2447 return false; | 2447 return false; |
| 2448 } | 2448 } |
| 2449 | 2449 |
| 2450 bool PaintLayer::isSelfPaintingLayerForIntrinsicOrScrollingReasons() const |
| 2451 { |
| 2452 return layoutObject()->layerTypeRequired() == NormalPaintLayer |
| 2453 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) |
| 2454 || needsCompositedScrolling(); |
| 2455 } |
| 2456 |
| 2450 bool PaintLayer::shouldBeSelfPaintingLayer() const | 2457 bool PaintLayer::shouldBeSelfPaintingLayer() const |
| 2451 { | 2458 { |
| 2452 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires
AcceleratedCompositing()) | 2459 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires
AcceleratedCompositing()) |
| 2453 return true; | 2460 return true; |
| 2454 return layoutObject()->layerTypeRequired() == NormalPaintLayer | 2461 return isSelfPaintingLayerForIntrinsicOrScrollingReasons(); |
| 2455 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) | 2462 } |
| 2456 || needsCompositedScrolling(); | 2463 |
| 2464 bool PaintLayer::isSelfPaintingOnlyBecauseIsCompositedPart() const |
| 2465 { |
| 2466 return shouldBeSelfPaintingLayer() && !isSelfPaintingLayerForIntrinsicOrScro
llingReasons(); |
| 2457 } | 2467 } |
| 2458 | 2468 |
| 2459 void PaintLayer::updateSelfPaintingLayer() | 2469 void PaintLayer::updateSelfPaintingLayer() |
| 2460 { | 2470 { |
| 2461 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer(); | 2471 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer(); |
| 2462 if (this->isSelfPaintingLayer() == isSelfPaintingLayer) | 2472 if (this->isSelfPaintingLayer() == isSelfPaintingLayer) |
| 2463 return; | 2473 return; |
| 2464 | 2474 |
| 2465 m_isSelfPaintingLayer = isSelfPaintingLayer; | 2475 m_isSelfPaintingLayer = isSelfPaintingLayer; |
| 2466 | 2476 |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2911 | 2921 |
| 2912 void showLayerTree(const blink::LayoutObject* layoutObject) | 2922 void showLayerTree(const blink::LayoutObject* layoutObject) |
| 2913 { | 2923 { |
| 2914 if (!layoutObject) { | 2924 if (!layoutObject) { |
| 2915 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2925 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
| 2916 return; | 2926 return; |
| 2917 } | 2927 } |
| 2918 showLayerTree(layoutObject->enclosingLayer()); | 2928 showLayerTree(layoutObject->enclosingLayer()); |
| 2919 } | 2929 } |
| 2920 #endif | 2930 #endif |
| OLD | NEW |