[Webkit-unassigned] [Bug 89277] [Texmap] Share gaussian formula between shaders in TextureMapperShaderManager.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat Jun 16 19:25:26 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=89277
Noam Rosenthal <noam.rosenthal at nokia.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #148000|review?, commit-queue? |review+, commit-queue-
Flag| |
--- Comment #7 from Noam Rosenthal <noam.rosenthal at nokia.com> 2012-06-16 19:25:25 PST ---
(From update of attachment 148000)
View in context: https://bugs.webkit.org/attachment.cgi?id=148000&action=review
Awesome! Please fix nit-picks before committing.
> Source/WebCore/platform/graphics/texmap/TextureMapperShaderManager.cpp:658
> + return exp(- (x * x) / 2.f);
Remove space between - and (
Use 2. instead of 2.f
> Source/WebCore/platform/graphics/texmap/TextureMapperShaderManager.cpp:678
> + if (!prepared) {
> + kernel[0] = gauss(0);
> + float sum = kernel[0];
> + for (unsigned i = 1; i < GAUSSIAN_KERNEL_HALF_WIDTH; ++i) {
> + kernel[i] = gauss(i * GAUSSIAN_KERNEL_STEP);
> + sum += 2 * kernel[i];
> + }
> +
> + // Normalize the kernel
> + float scale = 1 / sum;
> + for (unsigned i = 0; i < GAUSSIAN_KERNEL_HALF_WIDTH; ++i)
> + kernel[i] *= scale;
> + prepared = true;
> + }
Better to do
if (prepared)
return kernel;
--
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