Reviewed by Mitz.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Feb 2007 16:32:35 +0000 (16:32 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Feb 2007 16:32:35 +0000 (16:32 +0000)
commit510d2c38c345d7393e2a879677079a394eed8605
treed84197ec2042cb937ea37e70eb0d4fd561d2dde4
parentbacb6851dc2c16cc68055e67f95aab7c32360c5f
    Reviewed by Mitz.

        - 12.5% speedup on BenchJS test 6

        It turns out that calling documentVisibleRect on an NSScrollView is pretty expensive,
        and calling visibleRect even more so. Take measures to call them less often.

        * platform/mac/ScrollViewMac.mm:
        (WebCore::ScrollView::visibleContentRect): Use documentVisibleRect when possible.
        (WebCore::ScrollView::updateContents): Use visibleContentRect to be able to use
        documentVisibleRect when possible.
        * rendering/RenderView.cpp:
        (WebCore::RenderView::repaintViewRectangle): Don't get or intersect with viewRect
        if we don't have a parent frame, since the ScrollView will do that anyway. Also,
        don't get contentX and contentY separately since they are in the viewRect already.
        (WebCore::RenderView::viewRect): Use visibleContentRect instead of getting each
        coordinate individually, to avoid calling documentVisibleRect repeatedly.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/platform/mac/ScrollViewMac.mm
WebCore/rendering/RenderView.cpp