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

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

Issue 2652273004: Paint invisible layer content in presence of composited animations. (Closed)
Patch Set: Add tests and sync to head. Created 3 years, 11 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/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 5063ae67f1e8ecc9aa18f669fb220b2f224ed429..71ca7ffce91824c526d46d28b7951f5b043bc3f2 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -66,12 +66,23 @@ static ShouldRespectOverflowClipType shouldRespectOverflowClip(
bool PaintLayerPainter::paintedOutputInvisible(
const PaintLayerPaintingInfo& paintingInfo) {
- if (m_paintLayer.layoutObject()->hasBackdropFilter())
+ const LayoutObject& layoutObject = *m_paintLayer.layoutObject();
+ if (layoutObject.hasBackdropFilter())
return false;
- if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
- m_paintLayer.layoutObject()->styleRef().opacity())
- return false;
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ if (layoutObject.styleRef().opacity())
+ return false;
+
+ const EffectPaintPropertyNode* effect =
+ layoutObject.paintProperties()->effect();
+ const TransformPaintPropertyNode* transform =
+ layoutObject.paintProperties()->transform();
+ if ((effect && effect->requiresCompositingForAnimation()) ||
+ (transform && transform->requiresCompositingForAnimation())) {
+ return false;
+ }
+ }
// 0.0004f < 1/2048. With 10-bit color channels (only available on the
// newest Macs; otherwise it's 8-bit), we see that an alpha of 1/2048 or
@@ -79,8 +90,7 @@ bool PaintLayerPainter::paintedOutputInvisible(
// not visible.
static const float kMinimumVisibleOpacity = 0.0004f;
if (m_paintLayer.paintsWithTransparency(paintingInfo.getGlobalPaintFlags())) {
- if (m_paintLayer.layoutObject()->styleRef().opacity() <
- kMinimumVisibleOpacity) {
+ if (layoutObject.styleRef().opacity() < kMinimumVisibleOpacity) {
return true;
}
}

Powered by Google App Engine
This is Rietveld 408576698