Remove invalid code.
authorYongGeol Jung <yg48.jung@samsung.com>
Mon, 29 Apr 2013 11:47:42 +0000 (20:47 +0900)
committerYongGeol Jung <yg48.jung@samsung.com>
Thu, 2 May 2013 07:47:33 +0000 (16:47 +0900)
[Title] Remove invalid code.
[Issue#] N/A
[Problem] Some webgl test cases fail on emulator.
[Cause] After initializing webgl context, getError function returns INVALID_VALUE due to invalid code.
[Solution] Remove invalid code.

Change-Id: Id8617171ae59ad4e5ceb87729c43996fe73cb1fa

Source/WebCore/platform/graphics/efl/tizen/GraphicsContext3DOffscreen.cpp

index 82a2dd3..18def8f 100755 (executable)
@@ -732,37 +732,6 @@ void GraphicsContext3DOffscreen::reshape(int width, int height)
         mustRestoreFBO = true;
         GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, m_fbo));
     }
-
-    // FIXME: Do we need to care for preserveDrawingBuffer here? I haven't found the case.
-    // It seems we don't need to copy from m_texture to m_compositorTexture. It might be enough
-    // that using m_compositorTexture only, then we might be able to improve a bit performance
-    // since no texture copy is required.
-    // But I don't have any confidence & evidence it'll make no problem, so let's keep
-    // the legacy codes. If redering directly to compositorTexture causes an any issue,
-    // then recover the case seperating preserveDrawingBuffer.
-    GL_CMD(glBindTexture(GL_TEXTURE_2D, m_texture));
-    GL_CMD(glTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, type, 0));
-    GL_CMD(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture, 0));
-    GL_CMD(glBindTexture(GL_TEXTURE_2D, m_compositorTexture));
-    GL_CMD(glTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, type, 0));
-
-    GL_CMD(glBindTexture(GL_TEXTURE_2D, 0));
-
-    if (!m_attributes.antialias) {
-        if (m_attributes.stencil) {
-            GL_CMD(glBindRenderbuffer(GL_RENDERBUFFER, m_stencilBuffer));
-            GL_CMD(glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, width, height));
-            GL_CMD(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_stencilBuffer));
-        }
-
-        if (m_attributes.depth) {
-            GL_CMD(glBindRenderbuffer(GL_RENDERBUFFER, m_depthBuffer));
-            GL_CMD(glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height));
-            GL_CMD(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthBuffer));
-        }
-
-        GL_CMD(glBindRenderbuffer(GL_RENDERBUFFER, 0));
-    }
 #endif // !ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
 
     // Initialize renderbuffers to 0.
@@ -868,6 +837,10 @@ void GraphicsContext3DOffscreen::bindTexture(GC3Denum target, Platform3DObject t
 
 void GraphicsContext3DOffscreen::bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage)
 {
+#if !ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
+    if (!size)
+        return;
+#endif
     GraphicsContext3DInternal::bufferData(target, size, data, usage);
 
     // FIXME : Driver issue!