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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2770763002: [SPv2] Don't paint invisible PaintLayers with transform animations. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintLayerPainter.h" 5 #include "core/paint/PaintLayerPainter.h"
6 6
7 #include "core/frame/LocalFrame.h" 7 #include "core/frame/LocalFrame.h"
8 #include "core/layout/LayoutView.h" 8 #include "core/layout/LayoutView.h"
9 #include "core/paint/ClipPathClipper.h" 9 #include "core/paint/ClipPathClipper.h"
10 #include "core/paint/FilterPainter.h" 10 #include "core/paint/FilterPainter.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 const LayoutObject& layoutObject = m_paintLayer.layoutObject(); 69 const LayoutObject& layoutObject = m_paintLayer.layoutObject();
70 if (layoutObject.hasBackdropFilter()) 70 if (layoutObject.hasBackdropFilter())
71 return false; 71 return false;
72 72
73 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 73 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
74 if (layoutObject.styleRef().opacity()) 74 if (layoutObject.styleRef().opacity())
75 return false; 75 return false;
76 76
77 const EffectPaintPropertyNode* effect = 77 const EffectPaintPropertyNode* effect =
78 layoutObject.paintProperties()->effect(); 78 layoutObject.paintProperties()->effect();
79 const TransformPaintPropertyNode* transform = 79 if (effect && effect->requiresCompositingForAnimation()) {
80 layoutObject.paintProperties()->transform();
81 if ((effect && effect->requiresCompositingForAnimation()) ||
82 (transform && transform->requiresCompositingForAnimation())) {
83 return false; 80 return false;
84 } 81 }
85 } 82 }
86 83
87 // 0.0004f < 1/2048. With 10-bit color channels (only available on the 84 // 0.0004f < 1/2048. With 10-bit color channels (only available on the
88 // newest Macs; otherwise it's 8-bit), we see that an alpha of 1/2048 or 85 // newest Macs; otherwise it's 8-bit), we see that an alpha of 1/2048 or
89 // less leads to a color output of less than 0.5 in all channels, hence 86 // less leads to a color output of less than 0.5 in all channels, hence
90 // not visible. 87 // not visible.
91 static const float kMinimumVisibleOpacity = 0.0004f; 88 static const float kMinimumVisibleOpacity = 0.0004f;
92 if (m_paintLayer.paintsWithTransparency(paintingInfo.getGlobalPaintFlags())) { 89 if (m_paintLayer.paintsWithTransparency(paintingInfo.getGlobalPaintFlags())) {
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 context, layoutObject, PaintPhaseClippingMask)) 1202 context, layoutObject, PaintPhaseClippingMask))
1206 return; 1203 return;
1207 1204
1208 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); 1205 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
1209 LayoutObjectDrawingRecorder drawingRecorder( 1206 LayoutObjectDrawingRecorder drawingRecorder(
1210 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); 1207 context, layoutObject, PaintPhaseClippingMask, snappedClipRect);
1211 context.fillRect(snappedClipRect, Color::black); 1208 context.fillRect(snappedClipRect, Color::black);
1212 } 1209 }
1213 1210
1214 } // namespace blink 1211 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698