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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp

Issue 1616183002: Don't composite layers with an invisible frameview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Run test script when test runner is not present. Created 4 years, 11 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/layout/compositing/PaintLayerCompositor.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
index 16650e0a8010342a0719e344c0d6a99757e6305b..c9f2a9ad6d3d62665438a106cfbc030d17c02cf0 100644
--- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
@@ -767,8 +767,13 @@ void PaintLayerCompositor::updateDirectCompositingReasons(PaintLayer* layer)
bool PaintLayerCompositor::canBeComposited(const PaintLayer* layer) const
{
- const bool hasCompositorAnimation = m_compositingReasonFinder.requiresCompositingForAnimation(*layer->layoutObject()->style());
- return m_hasAcceleratedCompositing && (hasCompositorAnimation || !layer->subtreeIsInvisible()) && layer->isSelfPaintingLayer() && !layer->layoutObject()->isLayoutFlowThread();
+ LayoutObject* layoutObject = layer->layoutObject();
+ FrameView* frameView = layoutObject->frameView();
chrishtr 2016/01/21 22:49:18 Just layer->layoutObject()->frameView() is ok.
wkorman 2016/01/22 00:19:56 Done. I pulled layoutObject into a local variable
+ if (frameView && !frameView->isVisible()) {
+ return false;
chrishtr 2016/01/21 22:49:18 Add a comment explaining this situation. e.g.: El
wkorman 2016/01/22 00:19:56 Done.
+ }
+ const bool hasCompositorAnimation = m_compositingReasonFinder.requiresCompositingForAnimation(*layoutObject->style());
+ return m_hasAcceleratedCompositing && (hasCompositorAnimation || !layer->subtreeIsInvisible()) && layer->isSelfPaintingLayer() && !layoutObject->isLayoutFlowThread();
}
// Return true if the given layer is a stacking context and has compositing child

Powered by Google App Engine
This is Rietveld 408576698