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

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

Issue 2833883003: Skip paint chunks with effectively invisible opacity. (Closed)
Patch Set: Tweak comment. 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/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 2d0b917413a35611db9079fff8995dca642b36f9..f1973e3f2da2bde979896f66abc627cf289269be 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -64,43 +64,6 @@ static ShouldRespectOverflowClipType ShouldRespectOverflowClip(
: kRespectOverflowClip;
}
-bool PaintLayerPainter::PaintedOutputInvisible(
- const PaintLayerPaintingInfo& painting_info) {
- const LayoutObject& layout_object = paint_layer_.GetLayoutObject();
- if (layout_object.HasBackdropFilter())
- return false;
-
- // Always paint when 'will-change: opacity' is present. Reduces jank for
- // common animation implementation approaches, for example, an element that
- // starts with opacity zero and later begins to animate.
- if (layout_object.StyleRef().HasWillChangeOpacityHint())
- return false;
-
- if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
- if (layout_object.StyleRef().Opacity())
- return false;
-
- const EffectPaintPropertyNode* effect =
- layout_object.PaintProperties()->Effect();
- if (effect && effect->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
- // less leads to a color output of less than 0.5 in all channels, hence
- // not visible.
- static const float kMinimumVisibleOpacity = 0.0004f;
- if (paint_layer_.PaintsWithTransparency(
- painting_info.GetGlobalPaintFlags())) {
- if (layout_object.StyleRef().Opacity() < kMinimumVisibleOpacity) {
- return true;
- }
- }
- return false;
-}
-
PaintResult PaintLayerPainter::Paint(
GraphicsContext& context,
const PaintLayerPaintingInfo& painting_info,
@@ -135,10 +98,6 @@ PaintResult PaintLayerPainter::Paint(
->ShouldThrottleRendering())
return kFullyPainted;
- // If this layer is totally invisible then there is nothing to paint.
- if (PaintedOutputInvisible(painting_info))
- return kFullyPainted;
-
if (paint_layer_.PaintsWithTransparency(painting_info.GetGlobalPaintFlags()))
paint_flags |= kPaintLayerHaveTransparency;

Powered by Google App Engine
This is Rietveld 408576698