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

Unified Diff: content/common/gpu/media/rendering_helper.cc

Issue 324253005: rendering_helper - Activate the appropriate texture target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/rendering_helper.cc
diff --git a/content/common/gpu/media/rendering_helper.cc b/content/common/gpu/media/rendering_helper.cc
index 6abe8c5ca4dda93ac3032d70dee4deae488a1872..816ffb4a1d93286acbc3ca830e1363b75bc9164a 100644
--- a/content/common/gpu/media/rendering_helper.cc
+++ b/content/common/gpu/media/rendering_helper.cc
@@ -470,21 +470,16 @@ void RenderingHelper::RenderThumbnail(uint32 texture_target,
}
void RenderingHelper::RenderTexture(uint32 texture_target, uint32 texture_id) {
- // Unbound texture samplers default to (0, 0, 0, 1). Use this fact to switch
- // between GL_TEXTURE_2D and GL_TEXTURE_EXTERNAL_OES as appopriate.
+ // The ExternalOES sampler is bound to GL_TEXTURE1 and the Texture2D sampler
+ // is bound to GL_TEXTURE0.
if (texture_target == GL_TEXTURE_2D) {
glActiveTexture(GL_TEXTURE0 + 0);
- glBindTexture(GL_TEXTURE_2D, texture_id);
- glActiveTexture(GL_TEXTURE0 + 1);
- glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0);
} else if (texture_target == GL_TEXTURE_EXTERNAL_OES) {
- glActiveTexture(GL_TEXTURE0 + 0);
- glBindTexture(GL_TEXTURE_2D, 0);
glActiveTexture(GL_TEXTURE0 + 1);
- glBindTexture(GL_TEXTURE_EXTERNAL_OES, texture_id);
}
-
+ glBindTexture(texture_target, texture_id);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ glBindTexture(texture_target, 0);
CHECK_EQ(static_cast<int>(glGetError()), GL_NO_ERROR);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698