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

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

Issue 59063003: Don't coerce pointers to compositor layer mappings to booleans. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaaaase 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->compositingState() == PaintsIntoOwnBacking ? m_box->composited LayerMapping()->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->compositingState() == PaintsIntoOwnBacking ? m_box->composited LayerMapping()->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->compositingState() == PaintsIntoOwnBacking ? m_box->composited LayerMapping()->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->compositingState() == PaintsIntoOwnBacking ? m_box->composited LayerMapping()->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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 const IntRect& scrollCorner = scrollCornerRect(); 884 const IntRect& scrollCorner = scrollCornerRect();
885 if (m_scrollCorner) 885 if (m_scrollCorner)
886 m_scrollCorner->setFrameRect(scrollCorner); 886 m_scrollCorner->setFrameRect(scrollCorner);
887 887
888 if (m_resizer) 888 if (m_resizer)
889 m_resizer->setFrameRect(resizerCornerRect(borderBox, ResizerForPointer)) ; 889 m_resizer->setFrameRect(resizerCornerRect(borderBox, ResizerForPointer)) ;
890 890
891 // FIXME, this should eventually be removed, once we are certain that compos ited 891 // FIXME, this should eventually be removed, once we are certain that compos ited
892 // controls get correctly positioned on a compositor update. For now, conser vatively 892 // controls get correctly positioned on a compositor update. For now, conser vatively
893 // leaving this unchanged. 893 // leaving this unchanged.
894 if (m_box->compositedLayerMapping()) 894 if (m_box->compositingState() == PaintsIntoOwnBacking)
895 m_box->compositedLayerMapping()->positionOverflowControlsLayers(offsetFr omRoot); 895 m_box->compositedLayerMapping()->positionOverflowControlsLayers(offsetFr omRoot);
896 } 896 }
897 897
898 bool RenderLayerScrollableArea::scrollsOverflow() const 898 bool RenderLayerScrollableArea::scrollsOverflow() const
899 { 899 {
900 if (FrameView* frameView = m_box->view()->frameView()) 900 if (FrameView* frameView = m_box->view()->frameView())
901 return frameView->containsScrollableArea(this); 901 return frameView->containsScrollableArea(this);
902 902
903 return false; 903 return false;
904 } 904 }
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 compositor->updateCompositingLayers(CompositingUpdateOnScroll); 1436 compositor->updateCompositingLayers(CompositingUpdateOnScroll);
1437 } 1437 }
1438 } 1438 }
1439 1439
1440 bool RenderLayerScrollableArea::usesCompositedScrolling() const 1440 bool RenderLayerScrollableArea::usesCompositedScrolling() const
1441 { 1441 {
1442 // Scroll form controls on the main thread so they exhibit correct touch scr oll event bubbling 1442 // Scroll form controls on the main thread so they exhibit correct touch scr oll event bubbling
1443 if (m_box && (m_box->isIntristicallyScrollable(VerticalScrollbar) || m_box-> isIntristicallyScrollable(HorizontalScrollbar))) 1443 if (m_box && (m_box->isIntristicallyScrollable(VerticalScrollbar) || m_box-> isIntristicallyScrollable(HorizontalScrollbar)))
1444 return false; 1444 return false;
1445 1445
1446 return m_box->compositedLayerMapping() && m_box->compositedLayerMapping()->s crollingLayer(); 1446 return m_box->compositingState() == PaintsIntoOwnBacking && m_box->composite dLayerMapping()->scrollingLayer();
1447 } 1447 }
1448 1448
1449 bool RenderLayerScrollableArea::adjustForForceCompositedScrollingMode(bool value ) const 1449 bool RenderLayerScrollableArea::adjustForForceCompositedScrollingMode(bool value ) const
1450 { 1450 {
1451 switch (m_forceNeedsCompositedScrolling) { 1451 switch (m_forceNeedsCompositedScrolling) {
1452 case DoNotForceCompositedScrolling: 1452 case DoNotForceCompositedScrolling:
1453 return value; 1453 return value;
1454 case CompositedScrollingAlwaysOn: 1454 case CompositedScrollingAlwaysOn:
1455 return true; 1455 return true;
1456 case CompositedScrollingAlwaysOff: 1456 case CompositedScrollingAlwaysOff:
(...skipping 12 matching lines...) Expand all
1469 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode) 1469 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode)
1470 { 1470 {
1471 if (m_forceNeedsCompositedScrolling == mode) 1471 if (m_forceNeedsCompositedScrolling == mode)
1472 return; 1472 return;
1473 1473
1474 m_forceNeedsCompositedScrolling = mode; 1474 m_forceNeedsCompositedScrolling = mode;
1475 layer()->didUpdateNeedsCompositedScrolling(); 1475 layer()->didUpdateNeedsCompositedScrolling();
1476 } 1476 }
1477 1477
1478 } // Namespace WebCore 1478 } // Namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698