2011-01-24 Zhenyao Mo <zmo@google.com>
authorzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Jan 2011 22:42:12 +0000 (22:42 +0000)
committerzmo@google.com <zmo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Jan 2011 22:42:12 +0000 (22:42 +0000)
        Reviewed by Darin Adler.

        Remove sizeInBytes from GraphicsContext3D's various implementations
        https://bugs.webkit.org/show_bug.cgi?id=52339

        * src/GraphicsContext3DChromium.cpp:
        * src/GraphicsContext3DInternal.h:
2011-01-24  Zhenyao Mo  <zmo@google.com>

        Reviewed by Darin Adler.

        Remove sizeInBytes from GraphicsContext3D's various implementations
        https://bugs.webkit.org/show_bug.cgi?id=52339

        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::sizeInBytes):
        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
        * platform/graphics/qt/GraphicsContext3DQt.cpp:

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

Source/WebCore/ChangeLog
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/platform/graphics/GraphicsContext3D.h
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp
Source/WebKit/chromium/src/GraphicsContext3DInternal.h

index 2ab6e7c..77a69a8 100644 (file)
@@ -1,3 +1,16 @@
+2011-01-24  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Darin Adler.
+
+        Remove sizeInBytes from GraphicsContext3D's various implementations
+        https://bugs.webkit.org/show_bug.cgi?id=52339
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::sizeInBytes):
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+
 2011-01-24  Adam Roben  <aroben@apple.com>
 
         Windows Production build fix
index a3b9699..1894485 100644 (file)
@@ -487,7 +487,24 @@ void WebGLRenderingContext::reshape(int width, int height)
 
 unsigned int WebGLRenderingContext::sizeInBytes(GC3Denum type)
 {
-    return m_context->sizeInBytes(type);
+    switch (type) {
+    case GraphicsContext3D::BYTE:
+        return sizeof(GC3Dbyte);
+    case GraphicsContext3D::UNSIGNED_BYTE:
+        return sizeof(GC3Dubyte);
+    case GraphicsContext3D::SHORT:
+        return sizeof(GC3Dshort);
+    case GraphicsContext3D::UNSIGNED_SHORT:
+        return sizeof(GC3Dushort);
+    case GraphicsContext3D::INT:
+        return sizeof(GC3Dint);
+    case GraphicsContext3D::UNSIGNED_INT:
+        return sizeof(GC3Duint);
+    case GraphicsContext3D::FLOAT:
+        return sizeof(GC3Dfloat);
+    }
+    ASSERT_NOT_REACHED();
+    return 0;
 }
 
 void WebGLRenderingContext::activeTexture(GC3Denum texture, ExceptionCode& ec)
index 24827e5..47b953e 100644 (file)
@@ -47,7 +47,9 @@
 typedef unsigned int GC3Denum;
 typedef unsigned char GC3Dboolean;
 typedef unsigned int GC3Dbitfield;
+typedef signed char GC3Dbyte;
 typedef unsigned char GC3Dubyte;
+typedef short GC3Dshort;
 typedef unsigned short GC3Dushort;
 typedef int GC3Dint;
 typedef int GC3Dsizei;
@@ -487,10 +489,6 @@ public:
     void prepareTexture();
 #endif
 
-    // Helper to return the size in bytes of OpenGL data types
-    // like GL_FLOAT, GL_INT, etc.
-    unsigned int sizeInBytes(GC3Denum type);
-
     // Helper to texImage2D with pixel==0 case: pixels are initialized to 0.
     // Return true if no GL error is synthesized.
     // By default, alignment is 4, the OpenGL default setting.
index 7c103f3..7cef26d 100644 (file)
@@ -1437,28 +1437,6 @@ void GraphicsContext3D::deleteTexture(Platform3DObject texture)
     glDeleteTextures(1, &texture);
 }
 
-uint32_t GraphicsContext3D::sizeInBytes(GC3Denum type)
-{
-    switch (type) {
-        case GL_BYTE:
-            return sizeof(GLbyte);
-        case GL_UNSIGNED_BYTE:
-            return sizeof(GLubyte);
-        case GL_SHORT:
-            return sizeof(GLshort);
-        case GL_UNSIGNED_SHORT:
-            return sizeof(GLushort);
-        case GL_INT:
-            return sizeof(GLint);
-        case GL_UNSIGNED_INT:
-            return sizeof(GLuint);
-        case GL_FLOAT:
-            return sizeof(GLfloat);
-        default:
-            return 0;
-    }
-}
-
 void GraphicsContext3D::synthesizeGLError(GC3Denum error)
 {
     m_syntheticErrors.add(error);
index 295212c..63a8d40 100644 (file)
@@ -1611,28 +1611,6 @@ void GraphicsContext3D::deleteTexture(Platform3DObject texture)
     glDeleteTextures(1, &texture);
 }
 
-unsigned int GraphicsContext3D::sizeInBytes(GC3Denum type)
-{
-    switch (type) {
-    case GraphicsContext3D::BYTE:
-        return sizeof(GLbyte);
-    case GraphicsContext3D::UNSIGNED_BYTE:
-        return sizeof(GLubyte);
-    case GraphicsContext3D::SHORT:
-        return sizeof(GLshort);
-    case GraphicsContext3D::UNSIGNED_SHORT:
-        return sizeof(GLushort);
-    case GraphicsContext3D::INT:
-        return sizeof(GLint);
-    case GraphicsContext3D::UNSIGNED_INT:
-        return sizeof(GLuint);
-    case GraphicsContext3D::FLOAT:
-        return sizeof(GLfloat);
-    default:
-        return 0;
-    }
-}
-
 void GraphicsContext3D::synthesizeGLError(GC3Denum error)
 {
     m_internal->m_syntheticErrors.add(error);
index 6fc13fc..d5fd184 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-24  Zhenyao Mo  <zmo@google.com>
+
+        Reviewed by Darin Adler.
+
+        Remove sizeInBytes from GraphicsContext3D's various implementations
+        https://bugs.webkit.org/show_bug.cgi?id=52339
+
+        * src/GraphicsContext3DChromium.cpp:
+        * src/GraphicsContext3DInternal.h:
+
 2011-01-24  Tony Chang  <tony@chromium.org>
 
         Reviewed by James Robinson.
index 8148ff6..75b40c5 100644 (file)
@@ -365,7 +365,6 @@ rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7
 }
 
 DELEGATE_TO_IMPL_R(makeContextCurrent, bool)
-DELEGATE_TO_IMPL_1R(sizeInBytes, GC3Denum, unsigned int)
 
 bool GraphicsContext3DInternal::isGLES2Compliant() const
 {
@@ -897,7 +896,6 @@ PlatformLayer* GraphicsContext3D::platformLayer() const
 #endif
 
 DELEGATE_TO_INTERNAL(makeContextCurrent)
-DELEGATE_TO_INTERNAL_1R(sizeInBytes, GC3Denum, unsigned int)
 DELEGATE_TO_INTERNAL_2(reshape, int, int)
 DELEGATE_TO_INTERNAL_R(getInternalFramebufferSize, IntSize)
 
index 30a8e57..18e3089 100644 (file)
@@ -62,8 +62,6 @@ public:
 
     bool makeContextCurrent();
 
-    unsigned int sizeInBytes(GC3Denum type);
-
     void reshape(int width, int height);
     IntSize getInternalFramebufferSize();