summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-06 03:25:21 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-06 03:25:21 +0000
commit95b8777e39b9bdb4a840cb79d5cba6a5f21487e6 (patch)
treeee1262d174a4874aed336dd4b0abad1119496d83 /content
parent5c53b095d2e8d1add4c24ac1b9949f28dad0adc1 (diff)
downloadchromium_src-95b8777e39b9bdb4a840cb79d5cba6a5f21487e6.zip
chromium_src-95b8777e39b9bdb4a840cb79d5cba6a5f21487e6.tar.gz
chromium_src-95b8777e39b9bdb4a840cb79d5cba6a5f21487e6.tar.bz2
Force a glFlush() before returning new texture id's to be used by the decoder.
Fixes a race condition that manifests in Release builds (mostly on seaboards). BUG=none TEST=failures go away. Review URL: http://codereview.chromium.org/9113025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116637 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/renderer/renderer_gpu_video_decoder_factories.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/content/renderer/renderer_gpu_video_decoder_factories.cc b/content/renderer/renderer_gpu_video_decoder_factories.cc
index 4c71456..5195d3e 100644
--- a/content/renderer/renderer_gpu_video_decoder_factories.cc
+++ b/content/renderer/renderer_gpu_video_decoder_factories.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -45,6 +45,10 @@ bool RendererGpuVideoDecoderFactories::CreateTextures(
gles2->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size.width(), size.height(),
0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
+ // We need a glFlush here to guarantee the decoder (in the GPU process) can
+ // use the texture ids we return here. Since textures are expected to be
+ // reused, this should not be unacceptably expensive.
+ gles2->Flush();
DCHECK_EQ(gles2->GetError(), static_cast<GLenum>(GL_NO_ERROR));
return true;
}