This patch makes drawHighlightForText a completely cross-platform method
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 May 2006 21:56:29 +0000 (21:56 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 May 2006 21:56:29 +0000 (21:56 +0000)
commit44f3d5c4e0b7feeb8a23c43c3551dccc0a8accf7
tree5b6082de151152b25c746c8f562c164f6e23b0a4
parent1a66fb427b84312d15a0b04b2779c6c63ea9d82c
    This patch makes drawHighlightForText a completely cross-platform method
        implemented by the GraphicsContext.  The platform-specific implementations
        of the method in the Font class have been eliminated.

        Reviewed by andersca

        * platform/Font.h:
        * platform/FontData.h:
        Remove the drawHighlight methods.  Change the selectionRect method in
        Font to return a FloatRect so that the GraphicsContext can do an accurate
        fill.

        * platform/GraphicsContext.cpp:
        (WebCore::GraphicsContext::drawHighlightForText):
        Implement the drawHighlightFunction in terms of the cross-platform
        Font selectionRect functions and a new float-based fillRect graphics context
        function.

        * platform/GraphicsContext.h:
        * platform/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::fillRect):
        * platform/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::fillRect):
        Add the new float-based fillRect function for Cairo and CG.

        * platform/mac/FontData.mm:
        (WebCore::CG_draw):
        (WebCore::ATSU_draw):
        Removed the CG and ATSU drawHighlight methods.  Remove the drawing of
        the background from the deprecated draw methods (they'll be removed
        soon).

        * platform/mac/FontMac.mm:
        (WebCore::Font::selectionRectForText):
        * platform/win/FontWin.cpp:
        (WebCore::Font::selectionRectForText):
        Change selectionRectForText to return a FloatRect instead of an IntRect,
        so that the GraphicsContext can do a precise fill.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::selectionRect):
        (WebCore::InlineTextBox::positionForOffset):
        Modify the callers who expect an int-based selection rect so that they call
        enclosingIntRect.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/platform/Font.h
WebCore/platform/FontData.h
WebCore/platform/GraphicsContext.cpp
WebCore/platform/GraphicsContext.h
WebCore/platform/cairo/GraphicsContextCairo.cpp
WebCore/platform/cg/GraphicsContextCG.cpp
WebCore/platform/mac/FontData.mm
WebCore/platform/mac/FontMac.mm
WebCore/platform/win/FontWin.cpp
WebCore/rendering/InlineTextBox.cpp