Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 26921004: Work around broken GL_TEXTURE_BINDING_EXTERNAL_OES query (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 4dbae41669e2a47c112ba302ed04ba6860219621..28b57a5012671933c22a6fce902d568119b5cdfe 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1374,8 +1374,8 @@ class GLES2DecoderImpl : public GLES2Decoder {
void RestoreStateForAttrib(GLuint attrib);
// If texture is a stream texture, this will update the stream to the newest
- // buffer.
- void UpdateStreamTextureIfNeeded(Texture* texture);
+ // buffer and bind the texture implicitly.
+ void UpdateStreamTextureIfNeeded(Texture* texture, GLuint texture_unit_index);
// Returns false if unrenderable textures were replaced.
bool PrepareTexturesForRender();
@@ -5741,13 +5741,16 @@ void GLES2DecoderImpl::PerformanceWarning(
std::string("PERFORMANCE WARNING: ") + msg);
}
-void GLES2DecoderImpl::UpdateStreamTextureIfNeeded(Texture* texture) {
+void GLES2DecoderImpl::UpdateStreamTextureIfNeeded(Texture* texture,
+ GLuint texture_unit_index) {
if (texture && texture->IsStreamTexture()) {
DCHECK(stream_texture_manager());
StreamTexture* stream_tex =
stream_texture_manager()->LookupStreamTexture(texture->service_id());
- if (stream_tex)
+ if (stream_tex) {
+ glActiveTexture(GL_TEXTURE0 + texture_unit_index);
stream_tex->Update();
+ }
}
}
@@ -5773,7 +5776,7 @@ bool GLES2DecoderImpl::PrepareTexturesForRender() {
TextureRef* texture =
texture_unit.GetInfoForSamplerType(uniform_info->type).get();
if (texture)
- UpdateStreamTextureIfNeeded(texture->texture());
+ UpdateStreamTextureIfNeeded(texture->texture(), texture_unit_index);
if (have_unrenderable_textures &&
(!texture || !texture_manager()->CanRender(texture))) {
textures_set = true;
« no previous file with comments | « content/common/gpu/stream_texture_manager_android.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698