From abd3ee31ea51b47264986e4f5a3109582fbef97d Mon Sep 17 00:00:00 2001 From: "gman@chromium.org" Date: Wed, 24 Nov 2010 19:32:50 +0000 Subject: Initialize destinations variables before calling GL functions because if the context is lost those variables will be uninitialized. TEST=ran chrome, conformance tests, unit tests and hand edited gles2_demo to test BUG=none Review URL: http://codereview.chromium.org/5305005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67293 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc') diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc index af89470..17d0e22 100644 --- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc +++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc @@ -693,7 +693,7 @@ WebKit::WebString WebGraphicsContext3DCommandBufferImpl::getProgramInfoLog( scoped_array log(new GLchar[logLength]); if (!log.get()) return WebKit::WebString(); - GLsizei returnedLogLength; + GLsizei returnedLogLength = 0; glGetProgramInfoLog(program, logLength, &returnedLogLength, log.get()); DCHECK_EQ(logLength, returnedLogLength + 1); WebKit::WebString res = @@ -716,7 +716,7 @@ WebKit::WebString WebGraphicsContext3DCommandBufferImpl::getShaderInfoLog( scoped_array log(new GLchar[logLength]); if (!log.get()) return WebKit::WebString(); - GLsizei returnedLogLength; + GLsizei returnedLogLength = 0; glGetShaderInfoLog(shader, logLength, &returnedLogLength, log.get()); DCHECK_EQ(logLength, returnedLogLength + 1); WebKit::WebString res = @@ -734,7 +734,7 @@ WebKit::WebString WebGraphicsContext3DCommandBufferImpl::getShaderSource( scoped_array log(new GLchar[logLength]); if (!log.get()) return WebKit::WebString(); - GLsizei returnedLogLength; + GLsizei returnedLogLength = 0; glGetShaderSource(shader, logLength, &returnedLogLength, log.get()); DCHECK_EQ(logLength, returnedLogLength + 1); WebKit::WebString res = -- cgit v1.1