| 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 2773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2784 } | 2784 } |
| 2785 | 2785 |
| 2786 bool PaintLayer::CompositesWithTransform() const { | 2786 bool PaintLayer::CompositesWithTransform() const { |
| 2787 return TransformAncestor() || Transform(); | 2787 return TransformAncestor() || Transform(); |
| 2788 } | 2788 } |
| 2789 | 2789 |
| 2790 bool PaintLayer::CompositesWithOpacity() const { | 2790 bool PaintLayer::CompositesWithOpacity() const { |
| 2791 return OpacityAncestor() || GetLayoutObject().Style()->HasOpacity(); | 2791 return OpacityAncestor() || GetLayoutObject().Style()->HasOpacity(); |
| 2792 } | 2792 } |
| 2793 | 2793 |
| 2794 bool PaintLayer::BackgroundIsKnownToBeOpaqueInRect( | 2794 bool PaintLayer::BackgroundIsKnownToBeOpaqueInRect(const LayoutRect& local_rect, |
| 2795 const LayoutRect& local_rect) const { | 2795 uint32_t* reasons) const { |
| 2796 if (PaintsWithTransparency(kGlobalPaintNormalPhase)) | 2796 if (PaintsWithTransparency(kGlobalPaintNormalPhase)) |
| 2797 return false; | 2797 return false; |
| 2798 | 2798 |
| 2799 // We can't use hasVisibleContent(), because that will be true if our | 2799 // We can't use hasVisibleContent(), because that will be true if our |
| 2800 // layoutObject is hidden, but some child is visible and that child doesn't | 2800 // layoutObject is hidden, but some child is visible and that child doesn't |
| 2801 // cover the entire rect. | 2801 // cover the entire rect. |
| 2802 if (GetLayoutObject().Style()->Visibility() != EVisibility::kVisible) | 2802 if (GetLayoutObject().Style()->Visibility() != EVisibility::kVisible) |
| 2803 return false; | 2803 return false; |
| 2804 | 2804 |
| 2805 if (PaintsWithFilters() && | 2805 if (PaintsWithFilters() && |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2823 return false; | 2823 return false; |
| 2824 | 2824 |
| 2825 // FIXME: We currently only check the immediate layoutObject, | 2825 // FIXME: We currently only check the immediate layoutObject, |
| 2826 // which will miss many cases where additional layout objects paint | 2826 // which will miss many cases where additional layout objects paint |
| 2827 // into this layer. | 2827 // into this layer. |
| 2828 if (GetLayoutObject().BackgroundIsKnownToBeOpaqueInRect(local_rect)) | 2828 if (GetLayoutObject().BackgroundIsKnownToBeOpaqueInRect(local_rect)) |
| 2829 return true; | 2829 return true; |
| 2830 | 2830 |
| 2831 // We can't consult child layers if we clip, since they might cover | 2831 // We can't consult child layers if we clip, since they might cover |
| 2832 // parts of the rect that are clipped out. | 2832 // parts of the rect that are clipped out. |
| 2833 if (GetLayoutObject().HasClipRelatedProperty()) | 2833 if (GetLayoutObject().HasClipRelatedProperty()) { |
| 2834 if (reasons && GetLayoutObject().HasOverflowClip()) { |
| 2835 *reasons |= MainThreadScrollingReason:: |
| 2836 kHasOverflowClipAndLayoutObjectBackgroundNotOpaqueAndLCDText; |
| 2837 } |
| 2834 return false; | 2838 return false; |
| 2839 } |
| 2835 | 2840 |
| 2836 // TODO(schenney): This could be improved by unioning the opaque regions of | 2841 // TODO(schenney): This could be improved by unioning the opaque regions of |
| 2837 // all the children. That would require a refactoring because currently | 2842 // all the children. That would require a refactoring because currently |
| 2838 // children just check they at least cover the given rect, but a unioning | 2843 // children just check they at least cover the given rect, but a unioning |
| 2839 // method would require children to compute and report their rects. | 2844 // method would require children to compute and report their rects. |
| 2840 return ChildBackgroundIsKnownToBeOpaqueInRect(local_rect); | 2845 return ChildBackgroundIsKnownToBeOpaqueInRect(local_rect); |
| 2841 } | 2846 } |
| 2842 | 2847 |
| 2843 bool PaintLayer::ChildBackgroundIsKnownToBeOpaqueInRect( | 2848 bool PaintLayer::ChildBackgroundIsKnownToBeOpaqueInRect( |
| 2844 const LayoutRect& local_rect) const { | 2849 const LayoutRect& local_rect) const { |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3316 } | 3321 } |
| 3317 | 3322 |
| 3318 void showLayerTree(const blink::LayoutObject* layoutObject) { | 3323 void showLayerTree(const blink::LayoutObject* layoutObject) { |
| 3319 if (!layoutObject) { | 3324 if (!layoutObject) { |
| 3320 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; | 3325 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; |
| 3321 return; | 3326 return; |
| 3322 } | 3327 } |
| 3323 showLayerTree(layoutObject->EnclosingLayer()); | 3328 showLayerTree(layoutObject->EnclosingLayer()); |
| 3324 } | 3329 } |
| 3325 #endif | 3330 #endif |
| OLD | NEW |