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

Side by Side Diff: Source/WebCore/rendering/RenderLayerCompositor.cpp

Issue 13828004: Avoid compositing fixed-position elements if they cannot scroll (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after
1969 return false; 1969 return false;
1970 } 1970 }
1971 1971
1972 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements. 1972 // Don't promote fixed position elements that are descendants of a non-view container, e.g. transformed elements.
1973 // They will stay fixed wrt the container rather than the enclosing frame. 1973 // They will stay fixed wrt the container rather than the enclosing frame.
1974 if (container != m_renderView) { 1974 if (container != m_renderView) {
1975 if (viewportConstrainedNotCompositedReason) 1975 if (viewportConstrainedNotCompositedReason)
1976 *viewportConstrainedNotCompositedReason = RenderLayer::NotComposited ForNonViewContainer; 1976 *viewportConstrainedNotCompositedReason = RenderLayer::NotComposited ForNonViewContainer;
1977 return false; 1977 return false;
1978 } 1978 }
1979 1979
1980 // If the fixed-position element does not have any scrollable ancestor betwe en it and its container,
1981 // then we do not need to spend compositor resources for it.
1982 if (container->isRenderView()) {
1983
1984 RenderLayer* ancestor = layer->parent();
1985 bool noScrollableAncestor = true;
1986
1987 if (m_renderView->frameView() && (m_renderView->frameView()->isScrollabl e()))
1988 noScrollableAncestor = false;
trchen 2013/04/10 01:24:03 I'm concerned about the platforms that use impl-si
1989
1990 while (ancestor && noScrollableAncestor) {
1991 if (ancestor->hasHorizontalScrollbar() || ancestor->hasVerticalScrol lbar())
1992 noScrollableAncestor = false;
1993 ancestor = ancestor->parent();
1994 }
1995
1996 if (noScrollableAncestor)
1997 return false;
1998 }
1999
1980 // Subsequent tests depend on layout. If we can't tell now, just keep things the way they are until layout is done. 2000 // Subsequent tests depend on layout. If we can't tell now, just keep things the way they are until layout is done.
1981 if (!m_inPostLayoutUpdate) { 2001 if (!m_inPostLayoutUpdate) {
1982 m_reevaluateCompositingAfterLayout = true; 2002 m_reevaluateCompositingAfterLayout = true;
1983 return layer->isComposited(); 2003 return layer->isComposited();
1984 } 2004 }
1985 2005
1986 bool paintsContent = layer->isVisuallyNonEmpty() || layer->hasVisibleDescend ant(); 2006 bool paintsContent = layer->isVisuallyNonEmpty() || layer->hasVisibleDescend ant();
1987 if (!paintsContent) { 2007 if (!paintsContent) {
1988 if (viewportConstrainedNotCompositedReason) 2008 if (viewportConstrainedNotCompositedReason)
1989 *viewportConstrainedNotCompositedReason = RenderLayer::NotComposited ForNoVisibleContent; 2009 *viewportConstrainedNotCompositedReason = RenderLayer::NotComposited ForNoVisibleContent;
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
2841 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); 2861 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas");
2842 info.addMember(m_contentShadowLayer, "contentShadowLayer"); 2862 info.addMember(m_contentShadowLayer, "contentShadowLayer");
2843 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); 2863 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea");
2844 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); 2864 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea");
2845 info.addMember(m_layerForHeader, "layerForHeader"); 2865 info.addMember(m_layerForHeader, "layerForHeader");
2846 info.addMember(m_layerForFooter, "layerForFooter"); 2866 info.addMember(m_layerForFooter, "layerForFooter");
2847 #endif 2867 #endif
2848 } 2868 }
2849 2869
2850 } // namespace WebCore 2870 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698