[webkit-changes] [WebKit/WebKit] 57b05d: [TextureMapper] Shrink texture before applying lar...

Commit Queue noreply at github.com
Tue Sep 5 13:08:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 57b05d82091bb5917db172f2aa00276b2a85a5f5
      https://github.com/WebKit/WebKit/commit/57b05d82091bb5917db172f2aa00276b2a85a5f5
  Author: Akihiro Kiuchi <Akihiro.Kiuchi at sony.com>
  Date:   2023-09-05 (Tue, 05 Sep 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h
    M Source/WebCore/platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp
    M Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
    M Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
    M Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
    M Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp
    M Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp
    M Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.h

  Log Message:
  -----------
  [TextureMapper] Shrink texture before applying large radius blur
https://bugs.webkit.org/show_bug.cgi?id=261101

Reviewed by Fujii Hironori.

As Bug231653 pointed out, current blurring causes a mosaic artifacts
when the blur radius is large.

This is because the size of kernel for gaussian blur is fixed and the
implementation just expanded the kernel according to the blur radius.
So the radius is too large, kernel size is smaller than the number of
pixels which should be convolved in a pixel, that is there are unsampled
pixels between the pixels that the adjacent elements of the kernel
sample.

This periodical missing of pixels leads to the mosaic artifact.

This fix first shrinks the texture so that there is no gap between
kernel elements, and aligns the kernel elements to pixels precisely.

* Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h:
(WebCore::BitmapTextureGL::FilterInfo::FilterInfo):
* Source/WebCore/platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp:
(WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper):
* Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::optionsForFilterType):
(WebCore::blurRadiusToKernelHalfSize):
(WebCore::kernelHalfSizeToBlurRadius):
(WebCore::gauss):
(WebCore::computeGaussianKernel):
(WebCore::prepareFilterProgram):
(WebCore::TextureMapperGL::drawTexture):
(WebCore::TextureMapperGL::drawTexturePlanarYUV):
(WebCore::TextureMapperGL::drawTextureSemiPlanarYUV):
(WebCore::TextureMapperGL::drawTexturePackedYUV):
(WebCore::TextureMapperGL::drawTextureCopy):
(WebCore::TextureMapperGL::drawBlurred):
(WebCore::TextureMapperGL::applyBlurFilter):
(WebCore::TextureMapperGL::applyDropShadowFilter):
(WebCore::TextureMapperGL::applySinglePassFilter):
(WebCore::TextureMapperGL::applyFilter):
(WebCore::gaussianKernel): Deleted.
(WebCore::TextureMapperGL::drawFilterPass): Deleted.
(WebCore::getPassesRequiredForFilter): Deleted.
* Source/WebCore/platform/graphics/texmap/TextureMapperGL.h:
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
* Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxyDMABuf.cpp:
(WebCore::TextureMapperPlatformLayerProxyDMABuf::DMABufLayer::paintToTextureMapper):
* Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::create):
* Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.h:

Canonical link: https://commits.webkit.org/267646@main




More information about the webkit-changes mailing list