OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
(...skipping 2761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 } | 2772 } |
2773 | 2773 |
2774 bool PaintLayer::CompositesWithTransform() const { | 2774 bool PaintLayer::CompositesWithTransform() const { |
2775 return TransformAncestor() || Transform(); | 2775 return TransformAncestor() || Transform(); |
2776 } | 2776 } |
2777 | 2777 |
2778 bool PaintLayer::CompositesWithOpacity() const { | 2778 bool PaintLayer::CompositesWithOpacity() const { |
2779 return OpacityAncestor() || GetLayoutObject().Style()->HasOpacity(); | 2779 return OpacityAncestor() || GetLayoutObject().Style()->HasOpacity(); |
2780 } | 2780 } |
2781 | 2781 |
2782 bool PaintLayer::BackgroundIsKnownToBeOpaqueInRect( | 2782 bool PaintLayer::BackgroundIsKnownToBeOpaqueInRect(const LayoutRect& local_rect, |
2783 const LayoutRect& local_rect) const { | 2783 uint32_t* reasons) const { |
2784 if (PaintsWithTransparency(kGlobalPaintNormalPhase)) | 2784 if (PaintsWithTransparency(kGlobalPaintNormalPhase)) |
2785 return false; | 2785 return false; |
2786 | 2786 |
2787 // We can't use hasVisibleContent(), because that will be true if our | 2787 // We can't use hasVisibleContent(), because that will be true if our |
2788 // layoutObject is hidden, but some child is visible and that child doesn't | 2788 // layoutObject is hidden, but some child is visible and that child doesn't |
2789 // cover the entire rect. | 2789 // cover the entire rect. |
2790 if (GetLayoutObject().Style()->Visibility() != EVisibility::kVisible) | 2790 if (GetLayoutObject().Style()->Visibility() != EVisibility::kVisible) |
2791 return false; | 2791 return false; |
2792 | 2792 |
2793 if (PaintsWithFilters() && | 2793 if (PaintsWithFilters() && |
(...skipping 17 matching lines...) Expand all Loading... |
2811 return false; | 2811 return false; |
2812 | 2812 |
2813 // FIXME: We currently only check the immediate layoutObject, | 2813 // FIXME: We currently only check the immediate layoutObject, |
2814 // which will miss many cases where additional layout objects paint | 2814 // which will miss many cases where additional layout objects paint |
2815 // into this layer. | 2815 // into this layer. |
2816 if (GetLayoutObject().BackgroundIsKnownToBeOpaqueInRect(local_rect)) | 2816 if (GetLayoutObject().BackgroundIsKnownToBeOpaqueInRect(local_rect)) |
2817 return true; | 2817 return true; |
2818 | 2818 |
2819 // We can't consult child layers if we clip, since they might cover | 2819 // We can't consult child layers if we clip, since they might cover |
2820 // parts of the rect that are clipped out. | 2820 // parts of the rect that are clipped out. |
2821 if (GetLayoutObject().HasClipRelatedProperty()) | 2821 if (GetLayoutObject().HasClipRelatedProperty()) { |
| 2822 if (reasons && GetLayoutObject().HasOverflowClip()) |
| 2823 *reasons |= MainThreadScrollingReason::kHasOverflowClipAndLCDText; |
2822 return false; | 2824 return false; |
| 2825 } |
2823 | 2826 |
2824 // TODO(schenney): This could be improved by unioning the opaque regions of | 2827 // TODO(schenney): This could be improved by unioning the opaque regions of |
2825 // all the children. That would require a refactoring because currently | 2828 // all the children. That would require a refactoring because currently |
2826 // children just check they at least cover the given rect, but a unioning | 2829 // children just check they at least cover the given rect, but a unioning |
2827 // method would require children to compute and report their rects. | 2830 // method would require children to compute and report their rects. |
2828 return ChildBackgroundIsKnownToBeOpaqueInRect(local_rect); | 2831 return ChildBackgroundIsKnownToBeOpaqueInRect(local_rect); |
2829 } | 2832 } |
2830 | 2833 |
2831 bool PaintLayer::ChildBackgroundIsKnownToBeOpaqueInRect( | 2834 bool PaintLayer::ChildBackgroundIsKnownToBeOpaqueInRect( |
2832 const LayoutRect& local_rect) const { | 2835 const LayoutRect& local_rect) const { |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3301 } | 3304 } |
3302 | 3305 |
3303 void showLayerTree(const blink::LayoutObject* layoutObject) { | 3306 void showLayerTree(const blink::LayoutObject* layoutObject) { |
3304 if (!layoutObject) { | 3307 if (!layoutObject) { |
3305 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; | 3308 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; |
3306 return; | 3309 return; |
3307 } | 3310 } |
3308 showLayerTree(layoutObject->EnclosingLayer()); | 3311 showLayerTree(layoutObject->EnclosingLayer()); |
3309 } | 3312 } |
3310 #endif | 3313 #endif |
OLD | NEW |