Commit cf09bfc2 authored by danakj's avatar danakj Committed by Commit bot

webgl: Zero-initialize the SyncToken before calling GenSyncTokenCHROMIUM

The GenSyncTokenCHROMIUM function may fail if it generates an error, or
the context already has an error on it. At that point the sync token
will not be updated, so we should have it initialized to 0 for this
case.

R=kbr@chromium.org
BUG=629008

Review-Url: https://codereview.chromium.org/2162673002
Cr-Commit-Position: refs/heads/master@{#406162}
parent 61709246
......@@ -30,6 +30,7 @@
#include "platform/graphics/gpu/DrawingBuffer.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/common/capabilities.h"
#include "platform/RuntimeEnabledFeatures.h"
......@@ -569,7 +570,7 @@ bool DrawingBuffer::copyToPlatformTexture(gpu::gles2::GLES2Interface* gl, GLuint
const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM();
gl->Flush();
GLbyte syncToken[24];
GLbyte syncToken[GL_SYNC_TOKEN_SIZE_CHROMIUM] = { 0 };
gl->GenSyncTokenCHROMIUM(fenceSync, syncToken);
m_gl->WaitSyncTokenCHROMIUM(syncToken);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment