[webkit-reviews] review granted: [Bug 89277] [Texmap] Share gaussian formula between shaders in TextureMapperShaderManager. : [Attachment 148000] patch v.2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jun 16 19:25:26 PDT 2012


Noam Rosenthal <noam.rosenthal at nokia.com> has granted Huang Dongsung
<luxtella at company100.net>'s request for review:
Bug 89277: [Texmap] Share gaussian formula between shaders in
TextureMapperShaderManager.
https://bugs.webkit.org/show_bug.cgi?id=89277

Attachment 148000: patch v.2
https://bugs.webkit.org/attachment.cgi?id=148000&action=review

------- Additional Comments from Noam Rosenthal <noam.rosenthal at nokia.com>
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;


More information about the webkit-reviews mailing list