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

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

Issue 2833883003: Skip paint chunks with effectively invisible opacity. (Closed)
Patch Set: Sync to head. Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 if (ShouldSuppressPaintingLayer(paint_layer_)) 128 if (ShouldSuppressPaintingLayer(paint_layer_))
129 return kFullyPainted; 129 return kFullyPainted;
130 130
131 if (paint_layer_.GetLayoutObject().View()->GetFrame() && 131 if (paint_layer_.GetLayoutObject().View()->GetFrame() &&
132 paint_layer_.GetLayoutObject() 132 paint_layer_.GetLayoutObject()
133 .View() 133 .View()
134 ->GetFrame() 134 ->GetFrame()
135 ->ShouldThrottleRendering()) 135 ->ShouldThrottleRendering())
136 return kFullyPainted; 136 return kFullyPainted;
137 137
138 // If this layer is totally invisible then there is nothing to paint. 138 // If this layer is totally invisible then there is nothing to paint. In SPv2
139 if (PaintedOutputInvisible(painting_info)) 139 // we simplify this optimization by painting even when effectively invisible
140 // but skipping the painted content during layerization in
141 // PaintArtifactCompositor.
142 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
143 PaintedOutputInvisible(painting_info)) {
140 return kFullyPainted; 144 return kFullyPainted;
145 }
141 146
142 if (paint_layer_.PaintsWithTransparency(painting_info.GetGlobalPaintFlags())) 147 if (paint_layer_.PaintsWithTransparency(painting_info.GetGlobalPaintFlags()))
143 paint_flags |= kPaintLayerHaveTransparency; 148 paint_flags |= kPaintLayerHaveTransparency;
144 149
145 if (paint_layer_.PaintsWithTransform(painting_info.GetGlobalPaintFlags()) && 150 if (paint_layer_.PaintsWithTransform(painting_info.GetGlobalPaintFlags()) &&
146 !(paint_flags & kPaintLayerAppliedTransform)) 151 !(paint_flags & kPaintLayerAppliedTransform))
147 return PaintLayerWithTransform(context, painting_info, paint_flags); 152 return PaintLayerWithTransform(context, painting_info, paint_flags);
148 153
149 return PaintLayerContentsCompositingAllPhases(context, painting_info, 154 return PaintLayerContentsCompositingAllPhases(context, painting_info,
150 paint_flags); 155 paint_flags);
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 context, layout_object, kPaintPhaseClippingMask)) 1256 context, layout_object, kPaintPhaseClippingMask))
1252 return; 1257 return;
1253 1258
1254 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect()); 1259 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect());
1255 LayoutObjectDrawingRecorder drawing_recorder( 1260 LayoutObjectDrawingRecorder drawing_recorder(
1256 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect); 1261 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect);
1257 context.FillRect(snapped_clip_rect, Color::kBlack); 1262 context.FillRect(snapped_clip_rect, Color::kBlack);
1258 } 1263 }
1259 1264
1260 } // namespace blink 1265 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698