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

Unified Diff: content/renderer/media/renderer_gpu_video_decoder_factories.cc

Issue 11017060: Merge 159842 - ReadPixels from known-usable textures, and give SkBitmap its precious BGRA. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/src/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | media/base/video_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/renderer_gpu_video_decoder_factories.cc
===================================================================
--- content/renderer/media/renderer_gpu_video_decoder_factories.cc (revision 161172)
+++ content/renderer/media/renderer_gpu_video_decoder_factories.cc (working copy)
@@ -175,22 +175,26 @@
gpu::gles2::GLES2Implementation* gles2 = context_->GetImplementation();
- gles2->ActiveTexture(GL_TEXTURE0);
- gles2->BindTexture(texture_target, texture_id);
- gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ GLuint tmp_texture;
+ gles2->GenTextures(1, &tmp_texture);
+ gles2->BindTexture(texture_target, tmp_texture);
+ gles2->TexParameteri(texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ gles2->TexParameteri(texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ gles2->TexParameteri(texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ gles2->TexParameteri(texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ context_->copyTextureCHROMIUM(
+ texture_target, texture_id, tmp_texture, 0, GL_RGBA);
GLuint fb;
gles2->GenFramebuffers(1, &fb);
gles2->BindFramebuffer(GL_FRAMEBUFFER, fb);
gles2->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- texture_target, texture_id, 0);
+ texture_target, tmp_texture, 0);
gles2->PixelStorei(GL_PACK_ALIGNMENT, 4);
- gles2->ReadPixels(0, 0, size.width(), size.height(), GL_RGBA,
+ gles2->ReadPixels(0, 0, size.width(), size.height(), GL_BGRA_EXT,
GL_UNSIGNED_BYTE, pixels);
gles2->DeleteFramebuffers(1, &fb);
+ gles2->DeleteTextures(1, &tmp_texture);
DCHECK_EQ(gles2->GetError(), static_cast<GLenum>(GL_NO_ERROR));
waiter->Signal();
}
« no previous file with comments | « no previous file | media/base/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698