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

Side by Side Diff: Source/core/rendering/RenderLayerScrollableArea.cpp

Issue 58543002: Use a boolean hasCompositedLayerMapping() accessor instead of the pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update comment for hasCompositedLayerMapping Created 7 years, 1 month 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 if (RenderBox* enclosingScrollableBox = m_box->enclosingScrollableBox()) 143 if (RenderBox* enclosingScrollableBox = m_box->enclosingScrollableBox())
144 return enclosingScrollableBox->layer()->scrollableArea(); 144 return enclosingScrollableBox->layer()->scrollableArea();
145 145
146 // FIXME: We should return the frame view here (or possibly an ancestor fram e view, 146 // FIXME: We should return the frame view here (or possibly an ancestor fram e view,
147 // if the frame view isn't scrollable. 147 // if the frame view isn't scrollable.
148 return 0; 148 return 0;
149 } 149 }
150 150
151 GraphicsLayer* RenderLayerScrollableArea::layerForScrolling() const 151 GraphicsLayer* RenderLayerScrollableArea::layerForScrolling() const
152 { 152 {
153 return m_box->compositedLayerMapping() ? m_box->compositedLayerMapping()->sc rollingContentsLayer() : 0; 153 return m_box->hasCompositedLayerMapping() ? m_box->compositedLayerMapping()- >scrollingContentsLayer() : 0;
154 } 154 }
155 155
156 GraphicsLayer* RenderLayerScrollableArea::layerForHorizontalScrollbar() const 156 GraphicsLayer* RenderLayerScrollableArea::layerForHorizontalScrollbar() const
157 { 157 {
158 return m_box->compositedLayerMapping() ? m_box->compositedLayerMapping()->la yerForHorizontalScrollbar() : 0; 158 return m_box->hasCompositedLayerMapping() ? m_box->compositedLayerMapping()- >layerForHorizontalScrollbar() : 0;
159 } 159 }
160 160
161 GraphicsLayer* RenderLayerScrollableArea::layerForVerticalScrollbar() const 161 GraphicsLayer* RenderLayerScrollableArea::layerForVerticalScrollbar() const
162 { 162 {
163 return m_box->compositedLayerMapping() ? m_box->compositedLayerMapping()->la yerForVerticalScrollbar() : 0; 163 return m_box->hasCompositedLayerMapping() ? m_box->compositedLayerMapping()- >layerForVerticalScrollbar() : 0;
164 } 164 }
165 165
166 GraphicsLayer* RenderLayerScrollableArea::layerForScrollCorner() const 166 GraphicsLayer* RenderLayerScrollableArea::layerForScrollCorner() const
167 { 167 {
168 return m_box->compositedLayerMapping() ? m_box->compositedLayerMapping()->la yerForScrollCorner() : 0; 168 return m_box->hasCompositedLayerMapping() ? m_box->compositedLayerMapping()- >layerForScrollCorner() : 0;
169 } 169 }
170 170
171 void RenderLayerScrollableArea::invalidateScrollbarRect(Scrollbar* scrollbar, co nst IntRect& rect) 171 void RenderLayerScrollableArea::invalidateScrollbarRect(Scrollbar* scrollbar, co nst IntRect& rect)
172 { 172 {
173 if (scrollbar == m_vBar.get()) { 173 if (scrollbar == m_vBar.get()) {
174 if (GraphicsLayer* layer = layerForVerticalScrollbar()) { 174 if (GraphicsLayer* layer = layerForVerticalScrollbar()) {
175 layer->setNeedsDisplayInRect(rect); 175 layer->setNeedsDisplayInRect(rect);
176 return; 176 return;
177 } 177 }
178 } else { 178 } else {
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 const IntRect& scrollCorner = scrollCornerRect(); 880 const IntRect& scrollCorner = scrollCornerRect();
881 if (m_scrollCorner) 881 if (m_scrollCorner)
882 m_scrollCorner->setFrameRect(scrollCorner); 882 m_scrollCorner->setFrameRect(scrollCorner);
883 883
884 if (m_resizer) 884 if (m_resizer)
885 m_resizer->setFrameRect(resizerCornerRect(borderBox, ResizerForPointer)) ; 885 m_resizer->setFrameRect(resizerCornerRect(borderBox, ResizerForPointer)) ;
886 886
887 // FIXME, this should eventually be removed, once we are certain that compos ited 887 // FIXME, this should eventually be removed, once we are certain that compos ited
888 // controls get correctly positioned on a compositor update. For now, conser vatively 888 // controls get correctly positioned on a compositor update. For now, conser vatively
889 // leaving this unchanged. 889 // leaving this unchanged.
890 if (m_box->compositedLayerMapping()) 890 if (m_box->hasCompositedLayerMapping())
891 m_box->compositedLayerMapping()->positionOverflowControlsLayers(offsetFr omRoot); 891 m_box->compositedLayerMapping()->positionOverflowControlsLayers(offsetFr omRoot);
892 } 892 }
893 893
894 bool RenderLayerScrollableArea::scrollsOverflow() const 894 bool RenderLayerScrollableArea::scrollsOverflow() const
895 { 895 {
896 if (FrameView* frameView = m_box->view()->frameView()) 896 if (FrameView* frameView = m_box->view()->frameView())
897 return frameView->containsScrollableArea(this); 897 return frameView->containsScrollableArea(this);
898 898
899 return false; 899 return false;
900 } 900 }
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 compositor->updateCompositingLayers(CompositingUpdateOnScroll); 1432 compositor->updateCompositingLayers(CompositingUpdateOnScroll);
1433 } 1433 }
1434 } 1434 }
1435 1435
1436 bool RenderLayerScrollableArea::usesCompositedScrolling() const 1436 bool RenderLayerScrollableArea::usesCompositedScrolling() const
1437 { 1437 {
1438 // Scroll form controls on the main thread so they exhibit correct touch scr oll event bubbling 1438 // Scroll form controls on the main thread so they exhibit correct touch scr oll event bubbling
1439 if (m_box && (m_box->isIntristicallyScrollable(VerticalScrollbar) || m_box-> isIntristicallyScrollable(HorizontalScrollbar))) 1439 if (m_box && (m_box->isIntristicallyScrollable(VerticalScrollbar) || m_box-> isIntristicallyScrollable(HorizontalScrollbar)))
1440 return false; 1440 return false;
1441 1441
1442 return m_box->compositedLayerMapping() && m_box->compositedLayerMapping()->s crollingLayer(); 1442 return m_box->hasCompositedLayerMapping() && m_box->compositedLayerMapping() ->scrollingLayer();
1443 } 1443 }
1444 1444
1445 bool RenderLayerScrollableArea::adjustForForceCompositedScrollingMode(bool value ) const 1445 bool RenderLayerScrollableArea::adjustForForceCompositedScrollingMode(bool value ) const
1446 { 1446 {
1447 switch (m_forceNeedsCompositedScrolling) { 1447 switch (m_forceNeedsCompositedScrolling) {
1448 case DoNotForceCompositedScrolling: 1448 case DoNotForceCompositedScrolling:
1449 return value; 1449 return value;
1450 case CompositedScrollingAlwaysOn: 1450 case CompositedScrollingAlwaysOn:
1451 return true; 1451 return true;
1452 case CompositedScrollingAlwaysOff: 1452 case CompositedScrollingAlwaysOff:
(...skipping 12 matching lines...) Expand all
1465 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode) 1465 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode)
1466 { 1466 {
1467 if (m_forceNeedsCompositedScrolling == mode) 1467 if (m_forceNeedsCompositedScrolling == mode)
1468 return; 1468 return;
1469 1469
1470 m_forceNeedsCompositedScrolling = mode; 1470 m_forceNeedsCompositedScrolling = mode;
1471 layer()->didUpdateNeedsCompositedScrolling(); 1471 layer()->didUpdateNeedsCompositedScrolling();
1472 } 1472 }
1473 1473
1474 } // Namespace WebCore 1474 } // Namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerRepainter.cpp ('k') | Source/core/rendering/RenderTreeAsText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698