Changeset 152161 in webkit
- Timestamp:
- Jun 28, 2013 4:14:18 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r152157 r152161 1 2013-06-28 Sanghyup Lee <sh53.lee@samsung.com> 2 3 Avoid duplicating hostWindow() call in ScrollView.cpp 4 https://bugs.webkit.org/show_bug.cgi?id=118168 5 6 Reviewed by Christophe Dumez. 7 8 Remove redundant hostWindow() calls in ScrollView.cpp. 9 10 * platform/ScrollView.cpp: 11 (WebCore::ScrollView::scrollContents): 12 (WebCore::ScrollView::contentsToScreen): 13 (WebCore::ScrollView::screenToContents): 14 (WebCore::ScrollView::repaintContentRectangle): 15 (WebCore::ScrollView::updateOverhangAreas): 16 (WebCore::ScrollView::addPanScrollIcon): 17 (WebCore::ScrollView::removePanScrollIcon): 18 1 19 2013-06-28 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 20 -
trunk/Source/WebCore/platform/ScrollView.cpp
r151356 r152161 659 659 void ScrollView::scrollContents(const IntSize& scrollDelta) 660 660 { 661 if (!hostWindow()) 661 HostWindow* window = hostWindow(); 662 if (!window) 662 663 return; 663 664 … … 670 671 671 672 // Invalidate the root view (not the backing store). 672 hostWindow()->invalidateRootView(updateRect, false /*immediate*/);673 window->invalidateRootView(updateRect, false /*immediate*/); 673 674 674 675 if (m_drawPanScrollIcon) { … … 679 680 IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation, IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength)); 680 681 panScrollIconDirtyRect.intersect(clipRect); 681 hostWindow()->invalidateContentsAndRootView(panScrollIconDirtyRect, false /*immediate*/);682 window->invalidateContentsAndRootView(panScrollIconDirtyRect, false /*immediate*/); 682 683 } 683 684 … … 699 700 700 701 // Now blit the backingstore into the window which should be very fast. 701 hostWindow()->invalidateRootView(IntRect(), true);702 window->invalidateRootView(IntRect(), true); 702 703 } 703 704 … … 785 786 IntRect ScrollView::contentsToScreen(const IntRect& rect) const 786 787 { 788 HostWindow* window = hostWindow(); 787 789 if (platformWidget()) 788 790 return platformContentsToScreen(rect); 789 if (! hostWindow())791 if (!window) 790 792 return IntRect(); 791 return hostWindow()->rootViewToScreen(contentsToRootView(rect));793 return window->rootViewToScreen(contentsToRootView(rect)); 792 794 } 793 795 794 796 IntPoint ScrollView::screenToContents(const IntPoint& point) const 795 797 { 798 HostWindow* window = hostWindow(); 796 799 if (platformWidget()) 797 800 return platformScreenToContents(point); 798 if (! hostWindow())801 if (!window) 799 802 return IntPoint(); 800 return rootViewToContents( hostWindow()->screenToRootView(point));803 return rootViewToContents(window->screenToRootView(point)); 801 804 } 802 805 … … 968 971 } 969 972 970 if ( hostWindow())971 hostWindow()->invalidateContentsAndRootView(contentsToWindow(paintRect), now /*immediate*/);973 if (HostWindow* window = hostWindow()) 974 window->invalidateContentsAndRootView(contentsToWindow(paintRect), now /*immediate*/); 972 975 } 973 976 … … 1162 1165 void ScrollView::updateOverhangAreas() 1163 1166 { 1164 if (!hostWindow()) 1167 HostWindow* window = hostWindow(); 1168 if (!window) 1165 1169 return; 1166 1170 … … 1169 1173 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect); 1170 1174 if (!horizontalOverhangRect.isEmpty()) 1171 hostWindow()->invalidateContentsAndRootView(horizontalOverhangRect, false /*immediate*/);1175 window->invalidateContentsAndRootView(horizontalOverhangRect, false /*immediate*/); 1172 1176 if (!verticalOverhangRect.isEmpty()) 1173 hostWindow()->invalidateContentsAndRootView(verticalOverhangRect, false /*immediate*/);1177 window->invalidateContentsAndRootView(verticalOverhangRect, false /*immediate*/); 1174 1178 } 1175 1179 … … 1309 1313 void ScrollView::addPanScrollIcon(const IntPoint& iconPosition) 1310 1314 { 1311 if (!hostWindow()) 1315 HostWindow* window = hostWindow(); 1316 if (!window) 1312 1317 return; 1313 1318 m_drawPanScrollIcon = true; 1314 1319 m_panScrollIconPoint = IntPoint(iconPosition.x() - panIconSizeLength / 2 , iconPosition.y() - panIconSizeLength / 2) ; 1315 hostWindow()->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);1320 window->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/); 1316 1321 } 1317 1322 1318 1323 void ScrollView::removePanScrollIcon() 1319 1324 { 1320 if (!hostWindow()) 1325 HostWindow* window = hostWindow(); 1326 if (!window) 1321 1327 return; 1322 1328 m_drawPanScrollIcon = false; 1323 hostWindow()->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);1329 window->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/); 1324 1330 } 1325 1331
Note: See TracChangeset
for help on using the changeset viewer.