[Webkit-unassigned] [Bug 27570] [CSS3 Backgrounds and Borders] Add support for the "space" value for background-repeat

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 26 09:20:30 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=27570





--- Comment #27 from Simon Fraser (smfr) <simon.fraser at apple.com>  2011-07-26 09:20:29 PST ---
(From update of attachment 102009)
View in context: https://bugs.webkit.org/attachment.cgi?id=102009&action=review

> Source/WebCore/platform/graphics/Image.cpp:183
> +        for (int x = 0; x <= repeatX; ++x) {
> +            for (int y = 0; y <= repeatY; ++y) {
> +                FloatRect tileRect;
> +                tileRect.setX(destRect.x() + fmodf(fmodf(-srcPoint.x(), tileRealSize.width()) - tileRealSize.width(), tileRealSize.width()));
> +                tileRect.setY(destRect.y() + fmodf(fmodf(-srcPoint.y(), tileRealSize.height()) - tileRealSize.height(), tileRealSize.height()));
> +                tileRect.setSize(scaledTileSize);
> +
> +                tileRect.move(tileRealSize.width() * x, tileRealSize.height() * y);
> +
> +                FloatRect clippedRect = tileRect;
> +                clippedRect.intersect(destRect);
> +
> +                if (clippedRect.isEmpty())
> +                    continue;
> +
> +                if (usesSolidColor)
> +                    fillWithSolidColor(ctxt, clippedRect, solidColor(), styleColorSpace, op);
> +                else {
> +                    FloatRect visibleSrcRect((clippedRect.x() - tileRect.x()) / scale.width(),
> +                                             (clippedRect.y() - tileRect.y()) / scale.height(),
> +                                             clippedRect.width() / scale.width(),
> +                                             clippedRect.height() / scale.height());
> +                    draw(ctxt, clippedRect, visibleSrcRect, styleColorSpace, op);
> +                }
> +            }
> +        }

I'm concerned about the performance implications of this simple loop. Seems like you could fall into this slow tiling when you have a small background image with tiling over a large div (say a 1x1 px image with a 1px space over a 1000x1000 div).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list