| 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 2425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2436 LayoutRect childLocalRect(localRect); | 2436 LayoutRect childLocalRect(localRect); |
| 2437 childLayer->convertToLayerCoords(this, childOffset); | 2437 childLayer->convertToLayerCoords(this, childOffset); |
| 2438 childLocalRect.moveBy(-childOffset); | 2438 childLocalRect.moveBy(-childOffset); |
| 2439 | 2439 |
| 2440 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect)) | 2440 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect)) |
| 2441 return true; | 2441 return true; |
| 2442 } | 2442 } |
| 2443 return false; | 2443 return false; |
| 2444 } | 2444 } |
| 2445 | 2445 |
| 2446 bool PaintLayer::isSelfPaintingLayerForIntrinsicOrScrollingReasons() const |
| 2447 { |
| 2448 return layoutObject()->layerTypeRequired() == NormalPaintLayer |
| 2449 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) |
| 2450 || needsCompositedScrolling(); |
| 2451 } |
| 2452 |
| 2446 bool PaintLayer::shouldBeSelfPaintingLayer() const | 2453 bool PaintLayer::shouldBeSelfPaintingLayer() const |
| 2447 { | 2454 { |
| 2448 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires
AcceleratedCompositing()) | 2455 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires
AcceleratedCompositing()) |
| 2449 return true; | 2456 return true; |
| 2450 return layoutObject()->layerTypeRequired() == NormalPaintLayer | 2457 return isSelfPaintingLayerForIntrinsicOrScrollingReasons(); |
| 2451 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) | 2458 } |
| 2452 || needsCompositedScrolling(); | 2459 |
| 2460 bool PaintLayer::isSelfPaintingOnlyBecauseIsCompositedPart() const |
| 2461 { |
| 2462 return shouldBeSelfPaintingLayer() && !isSelfPaintingLayerForIntrinsicOrScro
llingReasons(); |
| 2453 } | 2463 } |
| 2454 | 2464 |
| 2455 void PaintLayer::updateSelfPaintingLayer() | 2465 void PaintLayer::updateSelfPaintingLayer() |
| 2456 { | 2466 { |
| 2457 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer(); | 2467 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer(); |
| 2458 if (this->isSelfPaintingLayer() == isSelfPaintingLayer) | 2468 if (this->isSelfPaintingLayer() == isSelfPaintingLayer) |
| 2459 return; | 2469 return; |
| 2460 | 2470 |
| 2461 m_isSelfPaintingLayer = isSelfPaintingLayer; | 2471 m_isSelfPaintingLayer = isSelfPaintingLayer; |
| 2462 | 2472 |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2924 | 2934 |
| 2925 void showLayerTree(const blink::LayoutObject* layoutObject) | 2935 void showLayerTree(const blink::LayoutObject* layoutObject) |
| 2926 { | 2936 { |
| 2927 if (!layoutObject) { | 2937 if (!layoutObject) { |
| 2928 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2938 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
| 2929 return; | 2939 return; |
| 2930 } | 2940 } |
| 2931 showLayerTree(layoutObject->enclosingLayer()); | 2941 showLayerTree(layoutObject->enclosingLayer()); |
| 2932 } | 2942 } |
| 2933 #endif | 2943 #endif |
| OLD | NEW |