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

Changeset 167562 in webkit


Ignore:
Timestamp:
Apr 19, 2014, 8:38:09 PM (12 years ago)
Author:
Alan Bujtas
Message:

Subpixel rendering: RenderLayer's clipping should snap to device pixel boundaries.
https://bugs.webkit.org/show_bug.cgi?id=131466

Reviewed by Simon Fraser.

Fractional pixel clipping can produce cruft on RenderLayers. Since RenderLayer
sizing and painting are snapped, painting clip rect needs to be snapped the same way.

Source/WebCore:
Test: fast/clip/clip-when-rect-has-fractional-pixel-value.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::clipToRect):

LayoutTests:

  • fast/clip/clip-when-rect-has-fractional-pixel-value-expected.html: Added.
  • fast/clip/clip-when-rect-has-fractional-pixel-value.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r167559 r167562  
     12014-04-19  Zalan Bujtas  <zalan@apple.com>
     2
     3        Subpixel rendering: RenderLayer's clipping should snap to device pixel boundaries.
     4        https://bugs.webkit.org/show_bug.cgi?id=131466
     5
     6        Reviewed by Simon Fraser.
     7
     8        Fractional pixel clipping can produce cruft on RenderLayers. Since RenderLayer
     9        sizing and painting are snapped, painting clip rect needs to be snapped the same way.
     10
     11        * fast/clip/clip-when-rect-has-fractional-pixel-value-expected.html: Added.
     12        * fast/clip/clip-when-rect-has-fractional-pixel-value.html: Added.
     13
    1142014-04-19  Chris Fleizach  <cfleizach@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r167560 r167562  
     12014-04-19  Zalan Bujtas  <zalan@apple.com>
     2
     3        Subpixel rendering: RenderLayer's clipping should snap to device pixel boundaries.
     4        https://bugs.webkit.org/show_bug.cgi?id=131466
     5
     6        Reviewed by Simon Fraser.
     7
     8        Fractional pixel clipping can produce cruft on RenderLayers. Since RenderLayer
     9        sizing and painting are snapped, painting clip rect needs to be snapped the same way.
     10
     11        Test: fast/clip/clip-when-rect-has-fractional-pixel-value.html
     12
     13        * rendering/RenderLayer.cpp:
     14        (WebCore::RenderLayer::clipToRect):
     15
    1162014-04-19  Brent Fulgham  <bfulgham@apple.com>
    217
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r167424 r167562  
    36313631                             BorderRadiusClippingRule rule)
    36323632{
     3633    float deviceScaleFactor = renderer().document().deviceScaleFactor();
    36333634    if (clipRect.rect() != paintDirtyRect || clipRect.hasRadius()) {
    36343635        context->save();
    3635         context->clip(clipRect.rect());
     3636        context->clip(pixelSnappedForPainting(clipRect.rect(), deviceScaleFactor));
    36363637    }
    36373638
     
    36463647                LayoutPoint delta;
    36473648                layer->convertToLayerCoords(rootLayer, delta);
    3648                 context->clipRoundedRect(FloatRoundedRect(layer->renderer().style().getRoundedInnerBorderFor(LayoutRect(delta, layer->size()))));
     3649                context->clipRoundedRect(layer->renderer().style().getRoundedInnerBorderFor(LayoutRect(delta, layer->size())).pixelSnappedRoundedRectForPainting(deviceScaleFactor));
    36493650        }
    36503651
Note: See TracChangeset for help on using the changeset viewer.