Commit 8cff53a6 authored by bbudge's avatar bbudge Committed by Commit bot

Pepper: Fix VideoDecoderShim texture upload.

VideoFrame conversion is to RGBA, so we need to specify
BGRA when uploading the texture.

BUG=450205

Review URL: https://codereview.chromium.org/901683004

Cr-Commit-Position: refs/heads/master@{#315141}
parent 3f7de242
...@@ -523,15 +523,21 @@ void VideoDecoderShim::SendPictures() { ...@@ -523,15 +523,21 @@ void VideoDecoderShim::SendPictures() {
gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL();
gles2->ActiveTexture(GL_TEXTURE0); gles2->ActiveTexture(GL_TEXTURE0);
gles2->BindTexture(GL_TEXTURE_2D, local_texture_id); gles2->BindTexture(GL_TEXTURE_2D, local_texture_id);
#if !defined(OS_ANDROID)
// BGRA is the native texture format, except on Android, where textures
// would be uploaded as GL_RGBA.
gles2->TexImage2D(GL_TEXTURE_2D, gles2->TexImage2D(GL_TEXTURE_2D,
0, 0,
GL_RGBA, GL_BGRA_EXT,
texture_size_.width(), texture_size_.width(),
texture_size_.height(), texture_size_.height(),
0, 0,
GL_RGBA, GL_BGRA_EXT,
GL_UNSIGNED_BYTE, GL_UNSIGNED_BYTE,
&frame->argb_pixels.front()); &frame->argb_pixels.front());
#else
#error Not implemented.
#endif
host_->PictureReady(media::Picture(texture_id, frame->decode_id, host_->PictureReady(media::Picture(texture_id, frame->decode_id,
frame->visible_rect, false)); frame->visible_rect, false));
......
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