Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2833883003: Skip paint chunks with effectively invisible opacity. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698