⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 107366 in webkit


Ignore:
Timestamp:
Feb 9, 2012, 11:07:21 PM (15 years ago)
Author:
eae@chromium.org
Message:

Convert Frame/FrameView to LayoutUnits in preparation for turning on subpixel layout
https://bugs.webkit.org/show_bug.cgi?id=78311

Reviewed by Eric Seidel.

No new tests, no new functionality.

  • page/Frame.cpp:

(WebCore::Frame::nodeImage):
Pixel snap painting rect for image to ensure that it is painted aligned
to device pixels. This avoids avoid unwanted anti-aliasing.

  • page/FrameView.cpp:

(WebCore::FrameView::windowClipRectForLayer):
Pixel snap clip rects as all window coordinates and sizes are exposed as
integers.

  • page/GestureTapHighlighter.cpp:
  • page/Page.cpp:

(WebCore::Page::addRelevantRepaintedObject):
As the painting is done aligned on pixel boundaries we need to pixel snap
the view rect when checking if it intersects the objects paint rect.

  • page/mac/FrameMac.mm:

(WebCore::Frame::snapshotDragImage):
(WebCore::Frame::nodeImage):
Pixel snap painting rect for image to ensure that it is painted aligned
to device pixels. This avoids avoid unwanted anti-aliasing.

  • page/win/FrameCGWin.cpp:

(WebCore::Frame::nodeImage):
Pixel snap painting rect for image to ensure that it is painted aligned
to device pixels. This avoids avoid unwanted anti-aliasing.

  • rendering/LayoutTypes.h:

(WebCore::pixelSnappedIntRect):
(WebCore):
No-op implementation of pixelSnappedIntRect for now.

Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r107365 r107366  
     12012-02-09  Emil A Eklund  <eae@chromium.org>
     2
     3        Convert Frame/FrameView to LayoutUnits in preparation for turning on subpixel layout
     4        https://bugs.webkit.org/show_bug.cgi?id=78311
     5
     6        Reviewed by Eric Seidel.
     7
     8        No new tests, no new functionality.
     9
     10        * page/Frame.cpp:
     11        (WebCore::Frame::nodeImage):
     12        Pixel snap painting rect for image to ensure that it is painted aligned
     13        to device pixels. This avoids avoid unwanted anti-aliasing.
     14
     15        * page/FrameView.cpp:
     16        (WebCore::FrameView::windowClipRectForLayer):
     17        Pixel snap clip rects as all window coordinates and sizes are exposed as
     18        integers.
     19
     20        * page/GestureTapHighlighter.cpp:
     21        * page/Page.cpp:
     22        (WebCore::Page::addRelevantRepaintedObject):
     23        As the painting is done aligned on pixel boundaries we need to pixel snap
     24        the view rect when checking if it intersects the objects paint rect.
     25
     26        * page/mac/FrameMac.mm:
     27        (WebCore::Frame::snapshotDragImage):
     28        (WebCore::Frame::nodeImage):
     29        Pixel snap painting rect for image to ensure that it is painted aligned
     30        to device pixels. This avoids avoid unwanted anti-aliasing.
     31
     32        * page/win/FrameCGWin.cpp:
     33        (WebCore::Frame::nodeImage):
     34        Pixel snap painting rect for image to ensure that it is painted aligned
     35        to device pixels. This avoids avoid unwanted anti-aliasing.
     36
     37        * rendering/LayoutTypes.h:
     38        (WebCore::pixelSnappedIntRect):
     39        (WebCore):
     40        No-op implementation of pixelSnappedIntRect for now.
     41
    1422012-02-09  Kenichi Ishibashi  <bashi@chromium.org>
    243
  • trunk/Source/WebCore/page/Frame.cpp

    r106899 r107366  
    10731073
    10741074    LayoutRect topLevelRect;
    1075     IntRect paintingRect = renderer->paintingRootRect(topLevelRect);
     1075    IntRect paintingRect = pixelSnappedIntRect(renderer->paintingRootRect(topLevelRect));
    10761076
    10771077    OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size()));
  • trunk/Source/WebCore/page/FrameView.cpp

    r107335 r107366  
    24842484    IntRect clipRect;
    24852485    if (clipToLayerContents)
    2486         clipRect = layer->childrenClipRect();
     2486        clipRect = pixelSnappedIntRect(layer->childrenClipRect());
    24872487    else
    2488         clipRect = layer->selfClipRect();
     2488        clipRect = pixelSnappedIntRect(layer->selfClipRect());
    24892489    clipRect = contentsToWindow(clipRect);
    24902490    return intersection(clipRect, windowClipRect());
  • trunk/Source/WebCore/page/GestureTapHighlighter.cpp

    r106547 r107366  
    5656    Frame* mainFrame = containingFrame->page()->mainFrame();
    5757
    58     LayoutPoint mainFramePoint = mainFrame->view()->rootViewToContents(containingFrame->view()->contentsToRootView(LayoutPoint()));
     58    LayoutPoint mainFramePoint = mainFrame->view()->rootViewToContents(containingFrame->view()->contentsToRootView(IntPoint()));
    5959    return mainFramePoint;
    6060}
     
    9696inline void shiftXEdgesToContainIfStrikes(LayoutRect& rect, const LayoutRect& other)
    9797{
    98     int leftSide = rect.x();
    99     int rightSide = rect.maxX();
     98    LayoutUnit leftSide = rect.x();
     99    LayoutUnit rightSide = rect.maxX();
    100100
    101101    if (!other.isEmpty() && strikes(rect, other)) {
  • trunk/Source/WebCore/page/Page.cpp

    r106977 r107366  
    10771077    // The objects are only relevant if they are being painted within the viewRect().
    10781078    if (RenderView* view = object->view()) {
    1079         if (!objectPaintRect.intersects(view->viewRect()))
     1079        if (!objectPaintRect.intersects(pixelSnappedIntRect(view->viewRect())))
    10801080            return;
    10811081    }
  • trunk/Source/WebCore/page/mac/FrameMac.mm

    r104530 r107366  
    159159                                        // imply new styles, plus JS could have changed other things
    160160    LayoutRect topLevelRect;
    161     NSRect paintingRect = renderer->paintingRootRect(topLevelRect);
     161    NSRect paintingRect = pixelSnappedIntRect(renderer->paintingRootRect(topLevelRect));
    162162
    163163    m_view->setNodeToDraw(node);              // invoke special sub-tree drawing mode
     
    168168
    169169    if (elementRect)
    170         *elementRect = topLevelRect;
     170        *elementRect = pixelSnappedIntRect(topLevelRect);
    171171    if (imageRect)
    172172        *imageRect = paintingRect;
     
    183183
    184184    LayoutRect topLevelRect;
    185     NSRect paintingRect = renderer->paintingRootRect(topLevelRect);
     185    NSRect paintingRect = pixelSnappedIntRect(renderer->paintingRootRect(topLevelRect));
    186186
    187187    m_view->setNodeToDraw(node); // invoke special sub-tree drawing mode
  • trunk/Source/WebCore/page/win/FrameCGWin.cpp

    r106884 r107366  
    9999
    100100    LayoutRect topLevelRect;
    101     IntRect paintingRect = renderer->paintingRootRect(topLevelRect);
     101    IntRect paintingRect = pixelSnappedIntRect(renderer->paintingRootRect(topLevelRect));
    102102
    103103    document()->updateLayout();
  • trunk/Source/WebCore/rendering/LayoutTypes.h

    r107296 r107366  
    5050{
    5151    return enclosingIntRect(rect);
     52}
     53
     54inline IntRect pixelSnappedIntRect(const LayoutRect& rect)
     55{
     56    return rect;
    5257}
    5358
Note: See TracChangeset for help on using the changeset viewer.