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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.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/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 2d0b917413a35611db9079fff8995dca642b36f9..1e25408ed4879f9f413b4354bf79d3a3c5ea9586 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -77,11 +77,9 @@ bool PaintLayerPainter::PaintedOutputInvisible(
return false;
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
- if (layout_object.StyleRef().Opacity())
- return false;
-
+ const ObjectPaintProperties* properties = layout_object.PaintProperties();
const EffectPaintPropertyNode* effect =
- layout_object.PaintProperties()->Effect();
+ properties ? properties->Effect() : nullptr;
if (effect && effect->RequiresCompositingForAnimation()) {
return false;
}
@@ -93,11 +91,9 @@ bool PaintLayerPainter::PaintedOutputInvisible(
// not visible.
static const float kMinimumVisibleOpacity = 0.0004f;
if (paint_layer_.PaintsWithTransparency(
- painting_info.GetGlobalPaintFlags())) {
- if (layout_object.StyleRef().Opacity() < kMinimumVisibleOpacity) {
- return true;
- }
- }
+ painting_info.GetGlobalPaintFlags()) &&
+ layout_object.StyleRef().Opacity() < kMinimumVisibleOpacity)
+ return true;
return false;
}

Powered by Google App Engine
This is Rietveld 408576698