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

Side by Side Diff: Source/core/rendering/compositing/RenderLayerCompositor.cpp

Issue 329423002: Delete RenderLayerCompositor::requiresOverhangLayers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 FrameView* view = m_renderView.frameView(); 949 FrameView* view = m_renderView.frameView();
950 return shouldCompositeOverflowControls(view) && view->verticalScrollbar(); 950 return shouldCompositeOverflowControls(view) && view->verticalScrollbar();
951 } 951 }
952 952
953 bool RenderLayerCompositor::requiresScrollCornerLayer() const 953 bool RenderLayerCompositor::requiresScrollCornerLayer() const
954 { 954 {
955 FrameView* view = m_renderView.frameView(); 955 FrameView* view = m_renderView.frameView();
956 return shouldCompositeOverflowControls(view) && view->isScrollCornerVisible( ); 956 return shouldCompositeOverflowControls(view) && view->isScrollCornerVisible( );
957 } 957 }
958 958
959 #if USE(RUBBER_BANDING)
960 bool RenderLayerCompositor::requiresOverhangLayers() const
961 {
962 // We don't want a layer if this is a subframe.
963 if (!m_renderView.frame()->isMainFrame())
964 return false;
965
966 // We do want a layer if we have a scrolling coordinator and can scroll.
967 if (scrollingCoordinator() && m_renderView.frameView()->hasOpaqueBackground( ))
968 return true;
969
970 // Chromium always wants a layer.
971 return true;
972 }
973 #endif
974
975 void RenderLayerCompositor::updateOverflowControlsLayers() 959 void RenderLayerCompositor::updateOverflowControlsLayers()
976 { 960 {
977 #if USE(RUBBER_BANDING) 961 #if USE(RUBBER_BANDING)
978 if (requiresOverhangLayers()) { 962 if (m_renderView.frame()->isMainFrame()) {
979 if (!m_layerForOverhangShadow) { 963 if (!m_layerForOverhangShadow) {
980 m_layerForOverhangShadow = GraphicsLayer::create(graphicsLayerFactor y(), this); 964 m_layerForOverhangShadow = GraphicsLayer::create(graphicsLayerFactor y(), this);
981 OverscrollTheme::theme()->setUpOverhangShadowLayer(m_layerForOverhan gShadow.get()); 965 OverscrollTheme::theme()->setUpOverhangShadowLayer(m_layerForOverhan gShadow.get());
982 OverscrollTheme::theme()->updateOverhangShadowLayer(m_layerForOverha ngShadow.get(), m_rootContentLayer.get()); 966 OverscrollTheme::theme()->updateOverhangShadowLayer(m_layerForOverha ngShadow.get(), m_rootContentLayer.get());
983 m_scrollLayer->addChild(m_layerForOverhangShadow.get()); 967 m_scrollLayer->addChild(m_layerForOverhangShadow.get());
984 } 968 }
985 } else { 969 } else {
986 if (m_layerForOverhangShadow) { 970 ASSERT(!m_layerForOverhangShadow);
987 m_layerForOverhangShadow->removeFromParent();
988 m_layerForOverhangShadow = nullptr;
989 }
990 } 971 }
991 #endif 972 #endif
992 GraphicsLayer* controlsParent = m_rootTransformLayer.get() ? m_rootTransform Layer.get() : m_overflowControlsHostLayer.get(); 973 GraphicsLayer* controlsParent = m_rootTransformLayer.get() ? m_rootTransform Layer.get() : m_overflowControlsHostLayer.get();
993 974
994 if (requiresHorizontalScrollbarLayer()) { 975 if (requiresHorizontalScrollbarLayer()) {
995 if (!m_layerForHorizontalScrollbar) { 976 if (!m_layerForHorizontalScrollbar) {
996 m_layerForHorizontalScrollbar = GraphicsLayer::create(graphicsLayerF actory(), this); 977 m_layerForHorizontalScrollbar = GraphicsLayer::create(graphicsLayerF actory(), this);
997 } 978 }
998 979
999 if (m_layerForHorizontalScrollbar->parent() != controlsParent) { 980 if (m_layerForHorizontalScrollbar->parent() != controlsParent) {
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 } else if (graphicsLayer == m_scrollLayer.get()) { 1239 } else if (graphicsLayer == m_scrollLayer.get()) {
1259 name = "LocalFrame Scrolling Layer"; 1240 name = "LocalFrame Scrolling Layer";
1260 } else { 1241 } else {
1261 ASSERT_NOT_REACHED(); 1242 ASSERT_NOT_REACHED();
1262 } 1243 }
1263 1244
1264 return name; 1245 return name;
1265 } 1246 }
1266 1247
1267 } // namespace WebCore 1248 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698