Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Make TextureMapper work with GraphicsSurface.
https://bugs.webkit.org/show_bug.cgi?id=87738 Add TextureMapperSurfaceBackingStore, a new backing store that allows to import textures from a GraphicsSurface. On Mac the GraphicsSurface is backed by an IOSurface which must be used with a GL_TEXTURE_RECTANGLE_ARB texture. Therefore it is also necessary to add new shader programs for directly painting these textures on screen. Reviewed by Noam Rosenthal. * platform/graphics/texmap/TextureMapperBackingStore.cpp: Add a new TextureMapperBackingStore implementation that can directly reuse textures as they are being passed from the GraphicsSurface. (WebCore::TextureMapperSurfaceBackingStore::setGraphicsSurface): (WebCore::TextureMapperSurfaceBackingStore::texture): (WebCore::TextureMapperSurfaceBackingStore::paintToTextureMapper): * platform/graphics/texmap/TextureMapperBackingStore.h: (GraphicsSurfaceData): (WebCore::GraphicsSurfaceData::setSurface): (WebCore::GraphicsSurfaceData::GraphicsSurfaceData): (TextureMapperSurfaceBackingStore): (WebCore::TextureMapperSurfaceBackingStore::create): (WebCore::TextureMapperSurfaceBackingStore::~TextureMapperSurfaceBackingStore): (WebCore::TextureMapperSurfaceBackingStore::TextureMapperSurfaceBackingStore): * platform/graphics/texmap/TextureMapperGL.cpp: Add a drawing function for textures of type GL_TEXTURE_RECTANGLE_ARB. (WebCore::TextureMapperGL::drawTextureRectangleARB): * platform/graphics/texmap/TextureMapperShaderManager.cpp: (WebCore::TextureMapperShaderManager::getShaderProgram): (WebCore::TextureMapperShaderProgramSimple::create): (WebCore::TextureMapperShaderProgramSimple::initialize): (WebCore::TextureMapperShaderProgramSolidColor::create): (WebCore::TextureMapperShaderProgramSolidColor::initialize): (WebCore::TextureMapperShaderProgramRectSimple::create): (WebCore::TextureMapperShaderProgramRectSimple::fragmentShaderSource): (WebCore::TextureMapperShaderProgramOpacityAndMask::create): (WebCore::TextureMapperShaderProgramOpacityAndMask::initialize): (WebCore::TextureMapperShaderProgramRectOpacityAndMask::create): (WebCore::TextureMapperShaderProgramRectOpacityAndMask::fragmentShaderSource): * platform/graphics/texmap/TextureMapperShaderManager.h: Add new shader programs that can be used with GL_TEXTURE_RECTANGLE_ARB textures. This is mainly necessary, because this type of texture uses non-normalized coordinates. Further move the calls to initializeProgram() from the constructor into a separate initialize() function, as initializeProgram() calls vertexShaderSource() (and friends) and we should not call virtual functions in the constructor. (WebCore::TextureMapperShaderProgram::initialize): (TextureMapperShaderProgramSimple): (WebCore::TextureMapperShaderProgramSimple::TextureMapperShaderProgramSimple): (TextureMapperShaderProgramRectSimple): (WebCore::TextureMapperShaderProgramRectSimple::TextureMapperShaderProgramRectSimple): (TextureMapperShaderProgramOpacityAndMask): (WebCore::TextureMapperShaderProgramOpacityAndMask::TextureMapperShaderProgramOpacityAndMask): (TextureMapperShaderProgramRectOpacityAndMask): (WebCore::TextureMapperShaderProgramRectOpacityAndMask::TextureMapperShaderProgramRectOpacityAndMask): (TextureMapperShaderProgramSolidColor): (WebCore::TextureMapperShaderProgramSolidColor::TextureMapperShaderProgramSolidColor): Canonical link: https://commits.webkit.org/105925@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Zeno Albisser
committed
Jun 1, 2012
1 parent
50da6f8
commit cac2b48
Showing
7 changed files
with
275 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.