[Webkit-unassigned] [Bug 50527] [Qt] Background image rendering is slow

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 6 07:06:56 PST 2010


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





--- Comment #6 from Benjamin Poulain <benjamin.poulain at nokia.com>  2010-12-06 07:06:56 PST ---
(From update of attachment 75618)
View in context: https://bugs.webkit.org/attachment.cgi?id=75618&action=review

> WebCore/platform/graphics/qt/ImageQt.cpp:125
> +    // FIXME: Might be worth investigating to cache the transformed result, though this has memory implications.
> +    QPixmap tilePixmap;
> +    if (tileRect.x() || tileRect.y() || tileRect.width() != framePixmap->width() || tileRect.height() != framePixmap->height() || !patternTransform.isIdentityOrTranslation()) {
> +        // We can't use the pixmap as is, because we're using only part of it or it needs to be scaled. Because we know the pixmap is going to be
> +        // drawn more than once, we copy/scale it only once to avoid repeating the operation for each tile.
> +        QRect targetTileRect = patternTransform.mapRect(tileRect);
> +        tilePixmap = QPixmap(targetTileRect.size());
> +        QPainter painter(&tilePixmap);
> +        painter.setCompositionMode(QPainter::CompositionMode_Source);
> +        painter.setTransform(patternTransform);
> +        painter.translate(-targetTileRect.topLeft());
> +        painter.drawPixmap(tileRect, *framePixmap);
> +    } else

I don't think that would work with rotation so you don't implement the interface given by the API of ImageBuffer.
I would prefer if you change the function signature to take two arguments scaleX and scaleY so it is explicit that any other type transform is not supported.

Otherwise, future change to support arbitrary transform from CSS would break Qt.

-- 
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