Changeset 152161 in webkit


Ignore:
Timestamp:
Jun 28, 2013 4:14:18 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Avoid duplicating hostWindow() call in ScrollView.cpp
https://bugs.webkit.org/show_bug.cgi?id=118168

Patch by Sanghyup Lee <sh53.lee@samsung.com> on 2013-06-28
Reviewed by Christophe Dumez.

Remove redundant hostWindow() calls in ScrollView.cpp.

  • platform/ScrollView.cpp:

(WebCore::ScrollView::scrollContents):
(WebCore::ScrollView::contentsToScreen):
(WebCore::ScrollView::screenToContents):
(WebCore::ScrollView::repaintContentRectangle):
(WebCore::ScrollView::updateOverhangAreas):
(WebCore::ScrollView::addPanScrollIcon):
(WebCore::ScrollView::removePanScrollIcon):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r152157 r152161  
     12013-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
    1192013-06-28  Christophe Dumez  <ch.dumez@sisa.samsung.com>
    220
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r151356 r152161  
    659659void ScrollView::scrollContents(const IntSize& scrollDelta)
    660660{
    661     if (!hostWindow())
     661    HostWindow* window = hostWindow();
     662    if (!window)
    662663        return;
    663664
     
    670671
    671672    // Invalidate the root view (not the backing store).
    672     hostWindow()->invalidateRootView(updateRect, false /*immediate*/);
     673    window->invalidateRootView(updateRect, false /*immediate*/);
    673674
    674675    if (m_drawPanScrollIcon) {
     
    679680        IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation, IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
    680681        panScrollIconDirtyRect.intersect(clipRect);
    681         hostWindow()->invalidateContentsAndRootView(panScrollIconDirtyRect, false /*immediate*/);
     682        window->invalidateContentsAndRootView(panScrollIconDirtyRect, false /*immediate*/);
    682683    }
    683684
     
    699700
    700701    // Now blit the backingstore into the window which should be very fast.
    701     hostWindow()->invalidateRootView(IntRect(), true);
     702    window->invalidateRootView(IntRect(), true);
    702703}
    703704
     
    785786IntRect ScrollView::contentsToScreen(const IntRect& rect) const
    786787{
     788    HostWindow* window = hostWindow();
    787789    if (platformWidget())
    788790        return platformContentsToScreen(rect);
    789     if (!hostWindow())
     791    if (!window)
    790792        return IntRect();
    791     return hostWindow()->rootViewToScreen(contentsToRootView(rect));
     793    return window->rootViewToScreen(contentsToRootView(rect));
    792794}
    793795
    794796IntPoint ScrollView::screenToContents(const IntPoint& point) const
    795797{
     798    HostWindow* window = hostWindow();
    796799    if (platformWidget())
    797800        return platformScreenToContents(point);
    798     if (!hostWindow())
     801    if (!window)
    799802        return IntPoint();
    800     return rootViewToContents(hostWindow()->screenToRootView(point));
     803    return rootViewToContents(window->screenToRootView(point));
    801804}
    802805
     
    968971    }
    969972
    970     if (hostWindow())
    971         hostWindow()->invalidateContentsAndRootView(contentsToWindow(paintRect), now /*immediate*/);
     973    if (HostWindow* window = hostWindow())
     974        window->invalidateContentsAndRootView(contentsToWindow(paintRect), now /*immediate*/);
    972975}
    973976
     
    11621165void ScrollView::updateOverhangAreas()
    11631166{
    1164     if (!hostWindow())
     1167    HostWindow* window = hostWindow();
     1168    if (!window)
    11651169        return;
    11661170
     
    11691173    calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
    11701174    if (!horizontalOverhangRect.isEmpty())
    1171         hostWindow()->invalidateContentsAndRootView(horizontalOverhangRect, false /*immediate*/);
     1175        window->invalidateContentsAndRootView(horizontalOverhangRect, false /*immediate*/);
    11721176    if (!verticalOverhangRect.isEmpty())
    1173         hostWindow()->invalidateContentsAndRootView(verticalOverhangRect, false /*immediate*/);
     1177        window->invalidateContentsAndRootView(verticalOverhangRect, false /*immediate*/);
    11741178}
    11751179
     
    13091313void ScrollView::addPanScrollIcon(const IntPoint& iconPosition)
    13101314{
    1311     if (!hostWindow())
     1315    HostWindow* window = hostWindow();
     1316    if (!window)
    13121317        return;
    13131318    m_drawPanScrollIcon = true;   
    13141319    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*/);
    13161321}
    13171322
    13181323void ScrollView::removePanScrollIcon()
    13191324{
    1320     if (!hostWindow())
     1325    HostWindow* window = hostWindow();
     1326    if (!window)
    13211327        return;
    13221328    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*/);
    13241330}
    13251331
Note: See TracChangeset for help on using the changeset viewer.