2010-12-02 Gregg Tavares <gman@google.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Dec 2010 07:25:10 +0000 (07:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Dec 2010 07:25:10 +0000 (07:25 +0000)
        Reviewed by David Levin.

        Need to initialize destination variables before calling GL
        https://bugs.webkit.org/show_bug.cgi?id=50048

        No new tests because no change in functionality.

        * html/canvas/WebGLFramebuffer.cpp:
        (WebCore::WebGLFramebuffer::initializeRenderbuffers):
        * html/canvas/WebGLProgram.cpp:
        (WebCore::WebGLProgram::cacheActiveAttribLocations):
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::getAttachedShaders):
        (WebCore::WebGLRenderingContext::getBufferParameter):
        (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
        (WebCore::WebGLRenderingContext::getBooleanParameter):
        (WebCore::WebGLRenderingContext::getFloatParameter):
        (WebCore::WebGLRenderingContext::getLongParameter):
        (WebCore::WebGLRenderingContext::getUnsignedLongParameter):
        * platform/graphics/chromium/LayerChromium.cpp:
        (WebCore::loadShader):
        (WebCore::LayerChromium::createShaderProgram):
        * platform/graphics/chromium/LayerRendererChromium.cpp:
        (WebCore::LayerRendererChromium::initializeSharedObjects):
        * platform/graphics/gpu/DrawingBuffer.cpp:
        (WebCore::DrawingBuffer::reset):
        * platform/graphics/gpu/Shader.cpp:
        (WebCore::Shader::loadProgram):

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

WebCore/ChangeLog
WebCore/html/canvas/WebGLFramebuffer.cpp
WebCore/html/canvas/WebGLProgram.cpp
WebCore/html/canvas/WebGLRenderingContext.cpp
WebCore/platform/graphics/chromium/LayerChromium.cpp
WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
WebCore/platform/graphics/gpu/DrawingBuffer.cpp
WebCore/platform/graphics/gpu/Shader.cpp

index eb4bc73..730f598 100644 (file)
@@ -1,3 +1,34 @@
+2010-12-02  Gregg Tavares  <gman@google.com>
+
+        Reviewed by David Levin.
+
+        Need to initialize destination variables before calling GL
+        https://bugs.webkit.org/show_bug.cgi?id=50048
+
+        No new tests because no change in functionality.
+
+        * html/canvas/WebGLFramebuffer.cpp:
+        (WebCore::WebGLFramebuffer::initializeRenderbuffers):
+        * html/canvas/WebGLProgram.cpp:
+        (WebCore::WebGLProgram::cacheActiveAttribLocations):
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::getAttachedShaders):
+        (WebCore::WebGLRenderingContext::getBufferParameter):
+        (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
+        (WebCore::WebGLRenderingContext::getBooleanParameter):
+        (WebCore::WebGLRenderingContext::getFloatParameter):
+        (WebCore::WebGLRenderingContext::getLongParameter):
+        (WebCore::WebGLRenderingContext::getUnsignedLongParameter):
+        * platform/graphics/chromium/LayerChromium.cpp:
+        (WebCore::loadShader):
+        (WebCore::LayerChromium::createShaderProgram):
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::initializeSharedObjects):
+        * platform/graphics/gpu/DrawingBuffer.cpp:
+        (WebCore::DrawingBuffer::reset):
+        * platform/graphics/gpu/Shader.cpp:
+        (WebCore::Shader::loadProgram):
+
 2010-12-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
 
         Reviewed by Andreas Kling.
index 9e2db56..0ef8ef6 100644 (file)
@@ -233,7 +233,7 @@ bool WebGLFramebuffer::initializeRenderbuffers()
 
     float colorClearValue[] = {0, 0, 0, 0}, depthClearValue = 0;
     int stencilClearValue = 0;
-    unsigned char colorMask[] = {1, 1, 1, 1}, depthMask = 1;
+    unsigned char colorMask[] = {0, 0, 0, 0}, depthMask = 0;
     unsigned int stencilMask = 0xffffffff;
     bool isScissorEnabled = false;
     bool isDitherEnabled = false;
index e4ffa80..1c06e83 100644 (file)
@@ -67,7 +67,7 @@ bool WebGLProgram::cacheActiveAttribLocations()
     if (!object())
         return false;
     GraphicsContext3D* context3d = context()->graphicsContext3D();
-    int linkStatus;
+    int linkStatus = 0;
     context3d->getProgramiv(object(), GraphicsContext3D::LINK_STATUS, &linkStatus);
     if (!linkStatus)
         return false;
index b201692..9200b88 100644 (file)
@@ -1375,7 +1375,7 @@ bool WebGLRenderingContext::getAttachedShaders(WebGLProgram* program, Vector<Web
     m_context->getProgramiv(objectOrZero(program), GraphicsContext3D::ATTACHED_SHADERS, &numShaders);
     if (numShaders) {
         OwnArrayPtr<unsigned int> shaders(new unsigned int[numShaders]);
-        int count;
+        int count = 0;
         m_context->getAttachedShaders(objectOrZero(program), numShaders, &count, shaders.get());
         if (count != numShaders)
             return false;
@@ -1415,7 +1415,7 @@ WebGLGetInfo WebGLRenderingContext::getBufferParameter(unsigned long target, uns
     }
 
     WebGLStateRestorer(this, false);
-    int value;
+    int value = 0;
     m_context->getBufferParameteriv(target, pname, &value);
     if (pname == GraphicsContext3D::BUFFER_SIZE)
         return WebGLGetInfo(static_cast<long>(value));
@@ -1459,7 +1459,7 @@ WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(unsigned l
 
     if (pname != GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) {
         WebGLStateRestorer(this, false);
-        int value;
+        int value = 0;
         m_context->getFramebufferAttachmentParameteriv(target, attachment, pname, &value);
         if (pname == GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)
             return WebGLGetInfo(static_cast<unsigned long>(value));
@@ -3352,7 +3352,7 @@ WebGLShader* WebGLRenderingContext::findShader(Platform3DObject obj)
 
 WebGLGetInfo WebGLRenderingContext::getBooleanParameter(unsigned long pname)
 {
-    unsigned char value;
+    unsigned char value = 0;
     m_context->getBooleanv(pname, &value);
     return WebGLGetInfo(static_cast<bool>(value));
 }
@@ -3373,7 +3373,7 @@ WebGLGetInfo WebGLRenderingContext::getBooleanArrayParameter(unsigned long pname
 
 WebGLGetInfo WebGLRenderingContext::getFloatParameter(unsigned long pname)
 {
-    float value;
+    float value = 0;
     m_context->getFloatv(pname, &value);
     return WebGLGetInfo(static_cast<float>(value));
 }
@@ -3385,14 +3385,14 @@ WebGLGetInfo WebGLRenderingContext::getIntParameter(unsigned long pname)
 
 WebGLGetInfo WebGLRenderingContext::getLongParameter(unsigned long pname)
 {
-    int value;
+    int value = 0;
     m_context->getIntegerv(pname, &value);
     return WebGLGetInfo(static_cast<long>(value));
 }
 
 WebGLGetInfo WebGLRenderingContext::getUnsignedLongParameter(unsigned long pname)
 {
-    int value;
+    int value = 0;
     m_context->getIntegerv(pname, &value);
     unsigned int uValue = static_cast<unsigned int>(value);
     return WebGLGetInfo(static_cast<unsigned long>(uValue));
index 1f4feaf..ddcba76 100644 (file)
@@ -59,7 +59,7 @@ static unsigned loadShader(GraphicsContext3D* context, unsigned type, const char
     String sourceString(shaderSource);
     GLC(context, context->shaderSource(shader, sourceString));
     GLC(context, context->compileShader(shader));
-    int compiled;
+    int compiled = 0;
     GLC(context, context->getShaderiv(shader, GraphicsContext3D::COMPILE_STATUS, &compiled));
     if (!compiled) {
         GLC(context, context->deleteShader(shader));
@@ -228,7 +228,7 @@ unsigned LayerChromium::createShaderProgram(GraphicsContext3D* context, const ch
     GLC(context, context->bindAttribLocation(programObject, s_texCoordAttribLocation, "a_texCoord"));
 
     GLC(context, context->linkProgram(programObject));
-    int linked;
+    int linked = 0;
     GLC(context, context->getProgramiv(programObject, GraphicsContext3D::LINK_STATUS, &linked));
     if (!linked) {
         LOG_ERROR("Failed to link shader program");
index 91580cc..1bdea85 100644 (file)
@@ -843,6 +843,7 @@ bool LayerRendererChromium::initializeSharedObjects()
     GLC(m_context, m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::NEAREST));
 
     // Get the max texture size supported by the system.
+    m_maxTextureSize = 0;
     GLC(m_context, m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &m_maxTextureSize));
 
     // Create an FBO for doing offscreen rendering.
index 8cb6d0c..c4c952b 100644 (file)
@@ -113,7 +113,7 @@ void DrawingBuffer::reset(const IntSize& newSize)
 
     // resize multisample FBO
     if (multisample()) {
-        int maxSampleCount;
+        int maxSampleCount = 0;
         
         m_context->getIntegerv(Extensions3D::MAX_SAMPLES, &maxSampleCount);
         int sampleCount = std::min(8, maxSampleCount);
index 8983adc..120c652 100644 (file)
@@ -91,7 +91,7 @@ unsigned Shader::loadProgram(GraphicsContext3D* context, const char* vertexShade
     context->attachShader(program, vertexShader);
     context->attachShader(program, fragmentShader);
     context->linkProgram(program);
-    int linkStatus;
+    int linkStatus = 0;
     context->getProgramiv(program, GraphicsContext3D::LINK_STATUS, &linkStatus);
     if (!linkStatus)
         context->deleteProgram(program);