| 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 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2450 LayoutRect childLocalRect(localRect); | 2450 LayoutRect childLocalRect(localRect); |
| 2451 childLayer->convertToLayerCoords(this, childOffset); | 2451 childLayer->convertToLayerCoords(this, childOffset); |
| 2452 childLocalRect.moveBy(-childOffset); | 2452 childLocalRect.moveBy(-childOffset); |
| 2453 | 2453 |
| 2454 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect)) | 2454 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect)) |
| 2455 return true; | 2455 return true; |
| 2456 } | 2456 } |
| 2457 return false; | 2457 return false; |
| 2458 } | 2458 } |
| 2459 | 2459 |
| 2460 bool PaintLayer::isSelfPaintingLayerForIntrinsicOrScrollingReasons() const | |
| 2461 { | |
| 2462 return layoutObject()->layerTypeRequired() == NormalPaintLayer | |
| 2463 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) | |
| 2464 || needsCompositedScrolling(); | |
| 2465 } | |
| 2466 | |
| 2467 bool PaintLayer::shouldBeSelfPaintingLayer() const | 2460 bool PaintLayer::shouldBeSelfPaintingLayer() const |
| 2468 { | 2461 { |
| 2469 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires
AcceleratedCompositing()) | 2462 if (layoutObject()->isLayoutPart() && toLayoutPart(layoutObject())->requires
AcceleratedCompositing()) |
| 2470 return true; | 2463 return true; |
| 2471 return isSelfPaintingLayerForIntrinsicOrScrollingReasons(); | 2464 return layoutObject()->layerTypeRequired() == NormalPaintLayer |
| 2472 } | 2465 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) |
| 2473 | 2466 || needsCompositedScrolling(); |
| 2474 bool PaintLayer::isSelfPaintingOnlyBecauseIsCompositedPart() const | |
| 2475 { | |
| 2476 return shouldBeSelfPaintingLayer() && !isSelfPaintingLayerForIntrinsicOrScro
llingReasons(); | |
| 2477 } | 2467 } |
| 2478 | 2468 |
| 2479 void PaintLayer::updateSelfPaintingLayer() | 2469 void PaintLayer::updateSelfPaintingLayer() |
| 2480 { | 2470 { |
| 2481 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer(); | 2471 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer(); |
| 2482 if (this->isSelfPaintingLayer() == isSelfPaintingLayer) | 2472 if (this->isSelfPaintingLayer() == isSelfPaintingLayer) |
| 2483 return; | 2473 return; |
| 2484 | 2474 |
| 2485 m_isSelfPaintingLayer = isSelfPaintingLayer; | 2475 m_isSelfPaintingLayer = isSelfPaintingLayer; |
| 2486 | 2476 |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2948 | 2938 |
| 2949 void showLayerTree(const blink::LayoutObject* layoutObject) | 2939 void showLayerTree(const blink::LayoutObject* layoutObject) |
| 2950 { | 2940 { |
| 2951 if (!layoutObject) { | 2941 if (!layoutObject) { |
| 2952 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2942 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
| 2953 return; | 2943 return; |
| 2954 } | 2944 } |
| 2955 showLayerTree(layoutObject->enclosingLayer()); | 2945 showLayerTree(layoutObject->enclosingLayer()); |
| 2956 } | 2946 } |
| 2957 #endif | 2947 #endif |
| OLD | NEW |