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

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

Issue 2893803002: Fix DCHECK failure when PaintLayerContents() paints layer in throttled frame (Closed)
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 93a7f66d944274b4b8b90ae60a1ca830143f2724..05fc565f04bfc5cc77cfeccef5166c84a748d180 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -4,7 +4,7 @@
#include "core/paint/PaintLayerPainter.h"
-#include "core/frame/LocalFrame.h"
+#include "core/frame/FrameView.h"
#include "core/layout/LayoutView.h"
#include "core/paint/ClipPathClipper.h"
#include "core/paint/FilterPainter.h"
@@ -105,6 +105,9 @@ PaintResult PaintLayerPainter::Paint(
GraphicsContext& context,
const PaintLayerPaintingInfo& painting_info,
PaintLayerFlags paint_flags) {
+ if (paint_layer_.GetLayoutObject().GetFrameView()->ShouldThrottleRendering())
+ return kFullyPainted;
+
// https://code.google.com/p/chromium/issues/detail?id=343772
DisableCompositingQueryAsserts disabler;
@@ -128,13 +131,6 @@ PaintResult PaintLayerPainter::Paint(
if (ShouldSuppressPaintingLayer(paint_layer_))
return kFullyPainted;
- if (paint_layer_.GetLayoutObject().View()->GetFrame() &&
- paint_layer_.GetLayoutObject()
- .View()
- ->GetFrame()
- ->ShouldThrottleRendering())
- return kFullyPainted;
-
// If this layer is totally invisible then there is nothing to paint. In SPv2
// we simplify this optimization by painting even when effectively invisible
// but skipping the painted content during layerization in
@@ -272,6 +268,11 @@ PaintResult PaintLayerPainter::PaintLayerContents(
const PaintLayerPaintingInfo& painting_info_arg,
PaintLayerFlags paint_flags,
FragmentPolicy fragment_policy) {
+ PaintResult result = kFullyPainted;
+
+ if (paint_layer_.GetLayoutObject().GetFrameView()->ShouldThrottleRendering())
+ return result;
+
Optional<ScopedPaintChunkProperties> scoped_paint_chunk_properties;
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
RuntimeEnabledFeatures::rootLayerScrollingEnabled() &&
@@ -313,19 +314,10 @@ PaintResult PaintLayerPainter::PaintLayerContents(
(is_painting_composited_decoration || !is_painting_scrolling_content) &&
paint_layer_.GetLayoutObject().StyleRef().HasOutline();
- PaintResult result = kFullyPainted;
-
if (paint_flags & kPaintLayerPaintingRootBackgroundOnly &&
!paint_layer_.GetLayoutObject().IsLayoutView())
return result;
- if (paint_layer_.GetLayoutObject().View()->GetFrame() &&
- paint_layer_.GetLayoutObject()
- .View()
- ->GetFrame()
- ->ShouldThrottleRendering())
- return result;
-
// Ensure our lists are up to date.
paint_layer_.StackingNode()->UpdateLayerListsIfNeeded();
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698