[TexMap] Remove the TEXMAP_OPENGL_ES_2 define
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Dec 2015 08:28:19 +0000 (08:28 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Dec 2015 08:28:19 +0000 (08:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152069

Reviewed by Alex Christensen.

Remove the TEXMAP_OPENGL_ES_2 macro define and clean up the code
that it was (not) guarding.

* platform/graphics/texmap/BitmapTexture.h:
* platform/graphics/texmap/BitmapTextureGL.cpp: Remove the TEXMAP_OPENGL_ES_2
guard. Keep the GL_UNSIGNED_INT_8_8_8_8_REV define for OS(DARWIN), but use
the GraphicsContext3D constants for other values.
(WebCore::BitmapTextureGL::updateContentsNoSwizzle):
(WebCore::BitmapTextureGL::initializeStencil): Remove the TEXMAP_OPENGL_ES_2
guard and default to calling the renderbufferStorage() function with the
GraphicsContext3D::STENCIL_INDEX8 argument.
* platform/graphics/texmap/BitmapTexturePool.h:
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperGL.cpp: Remove both the TEXMAP_OPENGL_ES_2
guard and the code it guarded. Because we were defining TEXMAP_OPENGL_ES_2 and not
USE_TEXMAP_OPENGL_ES_2, the guarded defines were always enforced, but they're never
actually used in this file anyway.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/BitmapTexture.h
Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp
Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp

index 1811a00..6694a80 100644 (file)
@@ -1,3 +1,28 @@
+2015-12-10  Zan Dobersek  <zdobersek@igalia.com>
+
+        [TexMap] Remove the TEXMAP_OPENGL_ES_2 define
+        https://bugs.webkit.org/show_bug.cgi?id=152069
+
+        Reviewed by Alex Christensen.
+
+        Remove the TEXMAP_OPENGL_ES_2 macro define and clean up the code
+        that it was (not) guarding.
+
+        * platform/graphics/texmap/BitmapTexture.h:
+        * platform/graphics/texmap/BitmapTextureGL.cpp: Remove the TEXMAP_OPENGL_ES_2
+        guard. Keep the GL_UNSIGNED_INT_8_8_8_8_REV define for OS(DARWIN), but use
+        the GraphicsContext3D constants for other values.
+        (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
+        (WebCore::BitmapTextureGL::initializeStencil): Remove the TEXMAP_OPENGL_ES_2
+        guard and default to calling the renderbufferStorage() function with the
+        GraphicsContext3D::STENCIL_INDEX8 argument.
+        * platform/graphics/texmap/BitmapTexturePool.h:
+        * platform/graphics/texmap/TextureMapper.h:
+        * platform/graphics/texmap/TextureMapperGL.cpp: Remove both the TEXMAP_OPENGL_ES_2
+        guard and the code it guarded. Because we were defining TEXMAP_OPENGL_ES_2 and not
+        USE_TEXMAP_OPENGL_ES_2, the guarded defines were always enforced, but they're never
+        actually used in this file anyway.
+
 2015-12-09  Brady Eidson  <beidson@apple.com>
 
         Modern IDB: storage/indexeddb/objectstore-basics.html fails.
index 3d8b0a9..adf9e58 100644 (file)
 #ifndef BitmapTexture_h
 #define BitmapTexture_h
 
-#if USE(OPENGL_ES_2)
-#define TEXMAP_OPENGL_ES_2
-#endif
-
 #include "IntPoint.h"
 #include "IntRect.h"
 #include "IntSize.h"
index fc34f0b..82436c4 100644 (file)
 #include <wtf/text/CString.h>
 #endif
 
-#if !USE(TEXMAP_OPENGL_ES_2)
-// FIXME: Move to Extensions3D.h.
+#if OS(DARWIN)
 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#define GL_UNPACK_SKIP_PIXELS 0x0CF4
-#define GL_UNPACK_SKIP_ROWS 0x0CF3
 #endif
 
 namespace WebCore {
@@ -132,18 +128,18 @@ void BitmapTextureGL::updateContentsNoSwizzle(const void* srcData, const IntRect
     // For ES drivers that don't support sub-images.
     if (driverSupportsSubImage(m_context3D.get())) {
         // Use the OpenGL sub-image extension, now that we know it's available.
-        m_context3D->pixelStorei(GL_UNPACK_ROW_LENGTH, bytesPerLine / bytesPerPixel);
-        m_context3D->pixelStorei(GL_UNPACK_SKIP_ROWS, sourceOffset.y());
-        m_context3D->pixelStorei(GL_UNPACK_SKIP_PIXELS, sourceOffset.x());
+        m_context3D->pixelStorei(GraphicsContext3D::UNPACK_ROW_LENGTH, bytesPerLine / bytesPerPixel);
+        m_context3D->pixelStorei(GraphicsContext3D::UNPACK_SKIP_ROWS, sourceOffset.y());
+        m_context3D->pixelStorei(GraphicsContext3D::UNPACK_SKIP_PIXELS, sourceOffset.x());
     }
 
     m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, m_type, srcData);
 
     // For ES drivers that don't support sub-images.
     if (driverSupportsSubImage(m_context3D.get())) {
-        m_context3D->pixelStorei(GL_UNPACK_ROW_LENGTH, 0);
-        m_context3D->pixelStorei(GL_UNPACK_SKIP_ROWS, 0);
-        m_context3D->pixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+        m_context3D->pixelStorei(GraphicsContext3D::UNPACK_ROW_LENGTH, 0);
+        m_context3D->pixelStorei(GraphicsContext3D::UNPACK_SKIP_ROWS, 0);
+        m_context3D->pixelStorei(GraphicsContext3D::UNPACK_SKIP_PIXELS, 0);
     }
 }
 
@@ -276,11 +272,7 @@ void BitmapTextureGL::initializeStencil()
 
     m_rbo = m_context3D->createRenderbuffer();
     m_context3D->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_rbo);
-#ifdef TEXMAP_OPENGL_ES_2
     m_context3D->renderbufferStorage(GraphicsContext3D::RENDERBUFFER, GraphicsContext3D::STENCIL_INDEX8, m_textureSize.width(), m_textureSize.height());
-#else
-    m_context3D->renderbufferStorage(GraphicsContext3D::RENDERBUFFER, GraphicsContext3D::DEPTH_STENCIL, m_textureSize.width(), m_textureSize.height());
-#endif
     m_context3D->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, 0);
     m_context3D->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::STENCIL_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_rbo);
     m_context3D->clearStencil(0);
index dc0cf66..e2a707b 100644 (file)
 #ifndef BitmapTexturePool_h
 #define BitmapTexturePool_h
 
-#if USE(OPENGL_ES_2)
-#define TEXMAP_OPENGL_ES_2
-#endif
-
 #include "BitmapTexture.h"
 #include "IntRect.h"
 #include "IntSize.h"
index 65c9872..163fe20 100644 (file)
 
 #if USE(TEXTURE_MAPPER)
 
-#if USE(OPENGL_ES_2)
-#define TEXMAP_OPENGL_ES_2
-#endif
-
 #include "BitmapTexture.h"
 #include "GraphicsContext.h"
 #include "IntRect.h"
index 1f9a41a..98d71ff 100644 (file)
 #include <wtf/text/CString.h>
 #endif
 
-#if !USE(TEXMAP_OPENGL_ES_2)
-// FIXME: Move to Extensions3D.h.
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#define GL_UNPACK_SKIP_PIXELS 0x0CF4
-#define GL_UNPACK_SKIP_ROWS 0x0CF3
-#endif
-
 namespace WebCore {
 struct TextureMapperGLData {
     WTF_MAKE_FAST_ALLOCATED;