Commit 23c687cc authored by alex@webkit.org's avatar alex@webkit.org
Browse files

2011-01-07 Alejandro G. Castro <alex@igalia.com>

        Reviewed by Martin Robinson.

        Cairo's ContextShadow may mis-render some box shadows
        https://bugs.webkit.org/show_bug.cgi?id=51374

        The space required for the internal shadow of the corners was not
        correctly considered.

        * platform/graphics/cairo/ContextShadowCairo.cpp:
        (WebCore::ContextShadow::drawRectShadow):

2011-01-07  Alejandro G. Castro  <alex@igalia.com>

        Reviewed by Martin Robinson.

        Cairo's ContextShadow may mis-render some box shadows
        https://bugs.webkit.org/show_bug.cgi?id=51374

        Added new test to check rectangular tiled shadows.

        * platform/gtk/fast/css/rect-shadow-tiled-expected.checksum: Added.
        * platform/gtk/fast/css/rect-shadow-tiled-expected.png: Added.
        * platform/gtk/fast/css/rect-shadow-tiled-expected.txt: Added.
        * platform/gtk/fast/css/rect-shadow-tiled.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 01689715
2011-01-07 Alejandro G. Castro <alex@igalia.com>
Reviewed by Martin Robinson.
Cairo's ContextShadow may mis-render some box shadows
https://bugs.webkit.org/show_bug.cgi?id=51374
Added new test to check rectangular tiled shadows.
* platform/gtk/fast/css/rect-shadow-tiled-expected.checksum: Added.
* platform/gtk/fast/css/rect-shadow-tiled-expected.png: Added.
* platform/gtk/fast/css/rect-shadow-tiled-expected.txt: Added.
* platform/gtk/fast/css/rect-shadow-tiled.html: Added.
2011-01-07 Kinuko Yasuda <kinuko@chromium.org>
 
Unreviewed; an attempt to fix chromium bot failures by removing failing test line (they must be failing due to modificationTime accuracy error).
......
828eb8aaf7b505ca4be3acf42c94a297
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
layer at (100,100) size 320x250
RenderBlock (positioned) {DIV} at (100,100) size 320x250
<style>
.roundedRect {
position: absolute;
left: 100px;
top: 100px;
width: 320px;
height: 250px;
-webkit-border-radius: 100px;
-webkit-box-shadow: 0 0 100px black;
}
</style>
<div class="roundedRect"></div>
2011-01-07 Alejandro G. Castro <alex@igalia.com>
Reviewed by Martin Robinson.
Cairo's ContextShadow may mis-render some box shadows
https://bugs.webkit.org/show_bug.cgi?id=51374
The space required for the internal shadow of the corners was not
correctly considered.
* platform/graphics/cairo/ContextShadowCairo.cpp:
(WebCore::ContextShadow::drawRectShadow):
2011-01-06 Adam Barth <abarth@webkit.org>
 
Reviewed by Darin Adler.
......
......@@ -190,12 +190,20 @@ static inline FloatPoint getPhase(const FloatRect& dest, const FloatRect& tile)
void ContextShadow::drawRectShadow(GraphicsContext* context, const IntRect& rect, const IntSize& topLeftRadius, const IntSize& topRightRadius, const IntSize& bottomLeftRadius, const IntSize& bottomRightRadius)
{
// drawShadowedRect still does not work with rotations.
// https://bugs.webkit.org/show_bug.cgi?id=45042
float radiusTwice = m_blurDistance * 2;
// Find the space the corners need inside the rect for its shadows.
int internalShadowWidth = radiusTwice + max(topLeftRadius.width(), bottomLeftRadius.width()) +
max(topRightRadius.width(), bottomRightRadius.width());
int internalShadowHeight = radiusTwice + max(topLeftRadius.height(), topRightRadius.height()) +
max(bottomLeftRadius.height(), bottomRightRadius.height());
cairo_t* cr = context->platformContext();
if ((!context->getCTM().isIdentityOrTranslationOrFlipped()) || (radiusTwice > rect.width())
|| (radiusTwice > rect.height()) || (m_type != BlurShadow)) {
// drawShadowedRect still does not work with rotations.
// https://bugs.webkit.org/show_bug.cgi?id=45042
if ((!context->getCTM().isIdentityOrTranslationOrFlipped()) || (internalShadowWidth > rect.width())
|| (internalShadowHeight > rect.height()) || (m_type != BlurShadow)) {
drawRectShadowWithoutTiling(context, rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, context->getAlpha());
return;
}
......@@ -210,16 +218,10 @@ void ContextShadow::drawRectShadow(GraphicsContext* context, const IntRect& rect
// Size of the tiling side.
int sideTileWidth = 1;
// Find the extra space needed from the curve of the corners.
int extraWidthFromCornerRadii = radiusTwice + max(topLeftRadius.width(), bottomLeftRadius.width()) +
radiusTwice + max(topRightRadius.width(), bottomRightRadius.width());
int extraHeightFromCornerRadii = radiusTwice + max(topLeftRadius.height(), topRightRadius.height()) +
radiusTwice + max(bottomLeftRadius.height(), bottomRightRadius.height());
// The length of a side of the buffer is the enough space for four blur radii,
// the radii of the corners, and then 1 pixel to draw the side tiles.
IntSize shadowTemplateSize = IntSize(sideTileWidth + extraWidthFromCornerRadii,
sideTileWidth + extraHeightFromCornerRadii);
IntSize shadowTemplateSize = IntSize(sideTileWidth + radiusTwice + internalShadowWidth,
sideTileWidth + radiusTwice + internalShadowHeight);
// Reduce the size of what we have to draw with the clip area.
double x1, x2, y1, y2;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment