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 2748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2759 | 2759 |
2760 // The layer doesn't have children. Subsequence caching is not worth it, | 2760 // The layer doesn't have children. Subsequence caching is not worth it, |
2761 // because normally the actual painting will be cheap. | 2761 // because normally the actual painting will be cheap. |
2762 // SVG is also painted atomically. | 2762 // SVG is also painted atomically. |
2763 if (!PaintLayerStackingNodeIterator(*StackingNode(), kAllChildren).Next()) | 2763 if (!PaintLayerStackingNodeIterator(*StackingNode(), kAllChildren).Next()) |
2764 return false; | 2764 return false; |
2765 | 2765 |
2766 return true; | 2766 return true; |
2767 } | 2767 } |
2768 | 2768 |
2769 bool PaintLayer::IsComposited() const { | |
wkorman
2017/04/20 22:23:56
There is other logic in PaintLayer that checks Get
| |
2770 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | |
2771 // In SPv2 paint layers always have a compositing state of | |
2772 // kNotComposited. We instead determine compositing state by checking for a | |
2773 // direct compositing reason on either the transform or effect node. | |
2774 const ObjectPaintProperties* properties = | |
2775 GetLayoutObject().PaintProperties(); | |
2776 if (!properties) | |
2777 return false; | |
2778 const TransformPaintPropertyNode* transform = properties->Transform(); | |
2779 if (transform && transform->HasDirectCompositingReasons()) | |
2780 return true; | |
2781 const EffectPaintPropertyNode* effect = properties->Effect(); | |
2782 if (effect && effect->HasDirectCompositingReasons()) | |
2783 return true; | |
2784 return false; | |
2785 } | |
2786 return GetCompositingState() == kPaintsIntoOwnBacking; | |
2787 } | |
2788 | |
2789 bool PaintLayer::PaintsWithTransparency( | |
2790 GlobalPaintFlags global_paint_flags) const { | |
2791 return IsTransparent() && | |
2792 ((global_paint_flags & kGlobalPaintFlattenCompositingLayers) || | |
2793 !IsComposited()); | |
2794 } | |
2795 | |
2769 ScrollingCoordinator* PaintLayer::GetScrollingCoordinator() { | 2796 ScrollingCoordinator* PaintLayer::GetScrollingCoordinator() { |
2770 Page* page = GetLayoutObject().GetFrame()->GetPage(); | 2797 Page* page = GetLayoutObject().GetFrame()->GetPage(); |
2771 return (!page) ? nullptr : page->GetScrollingCoordinator(); | 2798 return (!page) ? nullptr : page->GetScrollingCoordinator(); |
2772 } | 2799 } |
2773 | 2800 |
2774 bool PaintLayer::CompositesWithTransform() const { | 2801 bool PaintLayer::CompositesWithTransform() const { |
2775 return TransformAncestor() || Transform(); | 2802 return TransformAncestor() || Transform(); |
2776 } | 2803 } |
2777 | 2804 |
2778 bool PaintLayer::CompositesWithOpacity() const { | 2805 bool PaintLayer::CompositesWithOpacity() const { |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3301 } | 3328 } |
3302 | 3329 |
3303 void showLayerTree(const blink::LayoutObject* layoutObject) { | 3330 void showLayerTree(const blink::LayoutObject* layoutObject) { |
3304 if (!layoutObject) { | 3331 if (!layoutObject) { |
3305 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; | 3332 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; |
3306 return; | 3333 return; |
3307 } | 3334 } |
3308 showLayerTree(layoutObject->EnclosingLayer()); | 3335 showLayerTree(layoutObject->EnclosingLayer()); |
3309 } | 3336 } |
3310 #endif | 3337 #endif |
OLD | NEW |