Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
| index 7100c617d45d4d9dd7ab901aaf3503bd6d934b02..738fdab1f6dd4cd203fb33efd7d26b34d9d891a8 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
| @@ -2766,6 +2766,33 @@ bool PaintLayer::SupportsSubsequenceCaching() const { |
| return true; |
| } |
| +bool PaintLayer::IsComposited() const { |
|
wkorman
2017/04/20 22:23:56
There is other logic in PaintLayer that checks Get
|
| + if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| + // In SPv2 paint layers always have a compositing state of |
| + // kNotComposited. We instead determine compositing state by checking for a |
| + // direct compositing reason on either the transform or effect node. |
| + const ObjectPaintProperties* properties = |
| + GetLayoutObject().PaintProperties(); |
| + if (!properties) |
| + return false; |
| + const TransformPaintPropertyNode* transform = properties->Transform(); |
| + if (transform && transform->HasDirectCompositingReasons()) |
| + return true; |
| + const EffectPaintPropertyNode* effect = properties->Effect(); |
| + if (effect && effect->HasDirectCompositingReasons()) |
| + return true; |
| + return false; |
| + } |
| + return GetCompositingState() == kPaintsIntoOwnBacking; |
| +} |
| + |
| +bool PaintLayer::PaintsWithTransparency( |
| + GlobalPaintFlags global_paint_flags) const { |
| + return IsTransparent() && |
| + ((global_paint_flags & kGlobalPaintFlattenCompositingLayers) || |
| + !IsComposited()); |
| +} |
| + |
| ScrollingCoordinator* PaintLayer::GetScrollingCoordinator() { |
| Page* page = GetLayoutObject().GetFrame()->GetPage(); |
| return (!page) ? nullptr : page->GetScrollingCoordinator(); |