[Webkit-unassigned] [Bug 43962] Improve FEGaussianBlur algorithm performance
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Aug 13 09:16:38 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=43962
--- Comment #3 from Ariya Hidayat <ariya.hidayat at gmail.com> 2010-08-13 09:16:38 PST ---
(From update of attachment 64318)
This looks good! :)
> #include "GraphicsContext.h"
> #include "ImageData.h"
> #include <wtf/MathExtras.h>
Needs the Sencha copyright (see also Patch 2 in https://bugs.webkit.org/show_bug.cgi?id=34479).
> +#define CURRENT_ALGO 0
Have you profiled the different between using CURRENT_ALGO and not using it?
> +// Note: image must be RGB32 format
> +static void blurHorizontal(unsigned char* image, int imgWidth, int imgHeight, int strideLine, int radius, bool swap = false)
The comment does not apply anymore since you prepare 'image' manually by yourself (hence, you know it's guaranteed RGB32 :)
> + OwnPtr<ImageBuffer> tmpImageBuffer = ImageBuffer::create(resultImage()->size());
> +
> + AffineTransform transform;
> + transform.rotate(90);
> + RefPtr<Pattern> pattern = Pattern::create(m_in->resultImage()->image(), false, false);
> + tmpImageBuffer->context()->concatCTM(transform);
> + tmpImageBuffer->context()->translate(0, -imageRect.height());
> + tmpImageBuffer->context()->setFillPattern(pattern.get());
> + tmpImageBuffer->context()->fillRect(imageRect);
This works only if every platform graphics stack supports fast 90 degree rotation (aka transposed). Qt supports this hence why I use it.
Otherwise, it is faster to transpose the pixels ourselves.
Possible idea: provide a default ImageBuffer::transpose and let the platform overrides it if it has a faster version.
BTW, track also Hyatt's refactoring on Canvas. This might or might not conflict with some of his changes, but just in case. https://bugs.webkit.org/show_bug.cgi?id=43507
--
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