[TexMap] Drop GC3D* type usage from TextureMapperPlatformLayer{Buffer,Proxy}
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 13:05:22 +0000 (13:05 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 13:05:22 +0000 (13:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175314

Reviewed by Carlos Garcia Campos.

Switch to using OpenGL types in the TextureMapperPlatformLayerBuffer and
TextureMapperPlatformLayerProxy classes, instead of the equivalent GC3D*
types provided in the GraphicsTypes3D.h header.

No new tests -- no change in behavior.

* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
(WebCore::TextureMapperPlatformLayerBuffer::canReuseWithoutReset):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@220400 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.h

index 2e756b0..60a59a1 100644 (file)
@@ -1,5 +1,26 @@
 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
 
+        [TexMap] Drop GC3D* type usage from TextureMapperPlatformLayer{Buffer,Proxy}
+        https://bugs.webkit.org/show_bug.cgi?id=175314
+
+        Reviewed by Carlos Garcia Campos.
+
+        Switch to using OpenGL types in the TextureMapperPlatformLayerBuffer and
+        TextureMapperPlatformLayerProxy classes, instead of the equivalent GC3D*
+        types provided in the GraphicsTypes3D.h header.
+
+        No new tests -- no change in behavior.
+
+        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
+        (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
+        (WebCore::TextureMapperPlatformLayerBuffer::canReuseWithoutReset):
+        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
+        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
+        (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer):
+        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
+
+2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
+
         [TexMap] Don't use GraphicsContext3D in ClipStack
         https://bugs.webkit.org/show_bug.cgi?id=174776
 
index 1fd09a5..a5a08e8 100644 (file)
@@ -38,7 +38,7 @@ TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer(RefPtr<Bitmap
 {
 }
 
-TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer(GLuint textureID, const IntSize& size, TextureMapperGL::Flags flags, GC3Dint internalFormat)
+TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer(GLuint textureID, const IntSize& size, TextureMapperGL::Flags flags, GLint internalFormat)
     : m_textureID(textureID)
     , m_size(size)
     , m_internalFormat(internalFormat)
@@ -47,9 +47,9 @@ TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer(GLuint textur
 {
 }
 
-bool TextureMapperPlatformLayerBuffer::canReuseWithoutReset(const IntSize& size, GC3Dint internalFormat)
+bool TextureMapperPlatformLayerBuffer::canReuseWithoutReset(const IntSize& size, GLint internalFormat)
 {
-    return m_texture && (m_texture->size() == size) && (static_cast<BitmapTextureGL*>(m_texture.get())->internalFormat() == internalFormat || internalFormat == GraphicsContext3D::DONT_CARE);
+    return m_texture && (m_texture->size() == size) && (static_cast<BitmapTextureGL*>(m_texture.get())->internalFormat() == internalFormat || internalFormat == GL_DONT_CARE);
 }
 
 std::unique_ptr<TextureMapperPlatformLayerBuffer> TextureMapperPlatformLayerBuffer::clone(TextureMapperGL& texmapGL)
index 964f400..6066df5 100644 (file)
@@ -26,7 +26,7 @@
 #pragma once
 
 #include "BitmapTextureGL.h"
-#include "GraphicsTypes3D.h"
+#include "TextureMapperGLHeaders.h"
 #include "TextureMapperPlatformLayer.h"
 #include <wtf/CurrentTime.h>
 
@@ -39,13 +39,13 @@ class TextureMapperPlatformLayerBuffer : public TextureMapperPlatformLayer {
     WTF_MAKE_FAST_ALLOCATED();
 public:
     TextureMapperPlatformLayerBuffer(RefPtr<BitmapTexture>&&, TextureMapperGL::Flags = 0);
-    TextureMapperPlatformLayerBuffer(GLuint textureID, const IntSize&, TextureMapperGL::Flags, GC3Dint internalFormat);
+    TextureMapperPlatformLayerBuffer(GLuint textureID, const IntSize&, TextureMapperGL::Flags, GLint internalFormat);
 
     virtual ~TextureMapperPlatformLayerBuffer() = default;
 
     void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) final;
 
-    bool canReuseWithoutReset(const IntSize&, GC3Dint internalFormat);
+    bool canReuseWithoutReset(const IntSize&, GLint internalFormat);
     BitmapTextureGL& textureGL() { return static_cast<BitmapTextureGL&>(*m_texture); }
 
     inline void markUsed() { m_timeLastUsed = monotonicallyIncreasingTime(); }
@@ -72,7 +72,7 @@ private:
 
     GLuint m_textureID;
     IntSize m_size;
-    GC3Dint m_internalFormat;
+    GLint m_internalFormat;
     TextureMapperGL::Flags m_extraFlags;
     bool m_hasManagedTexture;
     std::unique_ptr<UnmanagedBufferDataHolder> m_unmanagedBufferDataHolder;
index befd98c..1cca0cc 100644 (file)
@@ -117,7 +117,7 @@ void TextureMapperPlatformLayerProxy::pushNextBuffer(std::unique_ptr<TextureMapp
         m_compositor->onNewBufferAvailable();
 }
 
-std::unique_ptr<TextureMapperPlatformLayerBuffer> TextureMapperPlatformLayerProxy::getAvailableBuffer(const IntSize& size, GC3Dint internalFormat)
+std::unique_ptr<TextureMapperPlatformLayerBuffer> TextureMapperPlatformLayerProxy::getAvailableBuffer(const IntSize& size, GLint internalFormat)
 {
     ASSERT(m_lock.isHeld());
     ASSERT(m_compositorThreadID == WTF::currentThread());
index 935ad3b..d004cc8 100644 (file)
@@ -28,7 +28,7 @@
 
 #if USE(COORDINATED_GRAPHICS_THREADED)
 
-#include "GraphicsTypes3D.h"
+#include "TextureMapperGLHeaders.h"
 #include <wtf/Function.h>
 #include <wtf/Lock.h>
 #include <wtf/RunLoop.h>
@@ -62,7 +62,7 @@ public:
     // the implementation of TextureMapperPlatformLayerProxyProvider should
     // aquire / release the lock explicitly to use below methods.
     Lock& lock() { return m_lock; }
-    std::unique_ptr<TextureMapperPlatformLayerBuffer> getAvailableBuffer(const IntSize&, GC3Dint internalFormat);
+    std::unique_ptr<TextureMapperPlatformLayerBuffer> getAvailableBuffer(const IntSize&, GLint internalFormat);
     void pushNextBuffer(std::unique_ptr<TextureMapperPlatformLayerBuffer>);
     bool isActive();