[TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
authoryoon@igalia.com <yoon@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Mar 2015 03:15:07 +0000 (03:15 +0000)
committeryoon@igalia.com <yoon@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Mar 2015 03:15:07 +0000 (03:15 +0000)
commit19c767c489646dc8d2891e8f9166ef60c8866ef0
treea9e94df0c813e2479e881b8fb4c6be6f8c48b539
parent4223e2ab125c8b222ee16fdc2d78fae745f99cf8
[TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
https://bugs.webkit.org/show_bug.cgi?id=142386

Reviewed by Žan Doberšek.

TextureMapper and TextureMapperGL are bloated and tightly coupled with
BitmapTexture. We should move these classes to seperated file of their own.
Also, this patch removes friend relationship from TextureMapperGL and  its
subsidiary classes.

The main purpose of this refactoring is to expose BitmapTexturePool to
renderers of platformlayers like Video and Canvas. By doing this, each
renderer can acquire textures from the global texture pool to paint
their contents directly.

Source/WebCore:

No new tests needed.

* PlatformEfl.cmake:
* PlatformGTK.cmake:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
Include BitmapTextureGL and BitmapTexturePool explicitly

* platform/graphics/texmap/BitmapTexture.cpp: Added.
* platform/graphics/texmap/BitmapTexture.h: Added.
(WebCore::BitmapTexture::updateContents):
Exclude BitmapTexture class from TextureMapper

* platform/graphics/texmap/BitmapTextureGL.cpp: Added.
* platform/graphics/texmap/BitmapTextureGL.h: Added.
Exclude BitmapTextureGL class from TextureMapperGL
(WebCore::BitmapTextureGL::clipStack): Added.
Add the getter for clipStack for TextureMapperGL
(WebCore::BitmapTextureGL::Bind): Deleted.
(WebCore::BitmapTextureGL::BindAsSurface): Added.
Bind used TextureMapperGL's internal data directly to compute projection matrix as a friend class,
However, TextureMapperGL can compute projection matrix itself after binding job, so this
friend ship is not needed. Also, this patch renames Bind to BindAsSurface to remove ambiguity.

* platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Added.
* platform/graphics/texmap/BitmapTextureImageBuffer.h: Added.
Exclude BitmapTextureImageBuffer class from TextureMapperImageBuffer

* platform/graphics/texmap/BitmapTexturePool.cpp: Added.
* platform/graphics/texmap/BitmapTexturePool.h: Added.
Exclude BitmapTexturePool class from TextureMapperGL
(WebCore::BitmapTexturePool::acquireTexture):
Modified to use passed GraphicsContext3D instead of TextureMapperGL to remove redundant coupling

* platform/graphics/texmap/TextureMapper.cpp:
* platform/graphics/texmap/TextureMapper.h:
Remove BitmapTexturePool and BitmapTexture from its implementation.

* platform/graphics/texmap/TextureMapperGL.cpp:
* platform/graphics/texmap/TextureMapperGL.h:
Remove BitmapTextureGL from its implementation.
(WebCore::TextureMapperGL::TextureMapperGL):
(WebCore::TextureMapperGL::clipStack):
(WebCore::TextureMapperGL::bindSurface):
(WebCore::TextureMapperGL::currentSurface):
Add a getter of the current surface for filtering operation in BitmapTextureGL.
It would be clear to move filtering operation from BitmapTextureGL to TextureMapperGL later.

(WebCore::TextureMapperGL::ClipStack):
Move inner class declaration to public.

* platform/graphics/texmap/TextureMapperImageBuffer.cpp:
* platform/graphics/texmap/TextureMapperImageBuffer.h:
Remove BitmapTextureImageBuffer from its implementation.

Source/WebKit2:

* Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Include BitmapTextureGL.h explicitly

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PlatformEfl.cmake
Source/WebCore/PlatformGTK.cmake
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/texmap/BitmapTexture.h [new file with mode: 0644]
Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h [new file with mode: 0644]
Source/WebCore/platform/graphics/texmap/BitmapTextureImageBuffer.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/texmap/BitmapTextureImageBuffer.h [new file with mode: 0644]
Source/WebCore/platform/graphics/texmap/BitmapTexturePool.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h [new file with mode: 0644]
Source/WebCore/platform/graphics/texmap/TextureMapper.cpp
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp