[Texmap] Refactor TextureMapperShaderManager to be clearer
https://bugs.webkit.org/show_bug.cgi?id=86048
Reviewed by Martin Robinson.
Previous implementation of TextureMapperShaderManager was very verbose, calling for too
many casts and ambiguous ownership.
This refactor does the following:
1. TextureMapperShaderProgram is one class without subclasses.
2. Uniform/Attribute accessors are generated by special macros (TEXMAP_DECLARE_...) that
generate both the C++ access function, as well as the GLSL name of the variable. This
allows adding/removing variables from a shader without adding broiler-plate code like
before.
After this change TextureMapperShaderManager has only one responsibility - dealing with
TextureMapperGL's built-in shaders and their lifecycle. Preparing filters etc. is done
in TextureMapperGL.
This is a refactor without new functionality. It has been verified to not break any existing
relevant test.
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawBorder):
(WebCore::TextureMapperGL::drawQuad):
(WebCore::TextureMapperGL::drawTextureRectangleARB):
(WebCore::TextureMapperGL::drawTexture):
(WebCore::TextureMapperGL::drawTextureWithAntialiasing):
(WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
(WebCore::TextureMapperGL::beginClip):
Use the MACRO-generated uniform accessors.
(WebCore):
(WebCore::keyForFilterType):
(WebCore::getPassesRequiredForFilter):
(WebCore::gauss):
(WebCore::gaussianKernel):
(WebCore::prepareFilterProgram):
(WebCore::TextureMapperGL::drawFiltered):
(WebCore::BitmapTextureGL::applyFilters):
Move the filter logic to TextureMapperGL
* platform/graphics/texmap/TextureMapperShaderManager.cpp:
(WebCore::TextureMapperShaderProgram::TextureMapperShaderProgram):
(WebCore::TextureMapperShaderProgram::getLocation):
(ShaderSpec):
(WebCore::ShaderSpec::ShaderSpec):
(WebCore::getShaderSpec):
(WebCore::TextureMapperShaderManager::TextureMapperShaderManager):
(WebCore::TextureMapperShaderManager::~TextureMapperShaderManager):
(WebCore::TextureMapperShaderManager::getShaderProgram):
* platform/graphics/texmap/TextureMapperShaderManager.h:
(WebCore):
(WebCore::TextureMapperShaderProgram::programID):
(WebCore::TextureMapperShaderProgram::context):
(WebCore::TextureMapperShaderProgram::create):
(TextureMapperShaderProgram):
(TextureMapperShaderManager):
See description.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
4 files changed