Index: webkit/media/webmediaplayer_impl.cc |
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc |
index 61710678adc1648ca8c0f523db17da5249d7968a..e89797f7bea8db01854f878f894fd9f20d82ed60 100644 |
--- a/webkit/media/webmediaplayer_impl.cc |
+++ b/webkit/media/webmediaplayer_impl.cc |
@@ -737,7 +737,12 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture( |
if (video_frame && |
video_frame->format() == media::VideoFrame::NATIVE_TEXTURE && |
video_frame->texture_target() == GL_TEXTURE_2D) { |
- uint32 source_texture = video_frame->texture_id(); |
+ uint32 source_texture = web_graphics_context->createTexture(); |
+ |
+ web_graphics_context->bindTexture(GL_TEXTURE_2D, source_texture); |
+ const gpu::Mailbox& mailbox = video_frame->texture_mailbox(); |
+ web_graphics_context->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
+ |
// The video is stored in a unmultiplied format, so premultiply |
// if necessary. |
web_graphics_context->pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, |
@@ -752,6 +757,9 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture( |
web_graphics_context->pixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, false); |
web_graphics_context->pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, |
false); |
+ |
+ web_graphics_context->deleteTexture(source_texture); |
+ |
// The flush() operation is not necessary here. It is kept since the |
// performance will be better when it is added than not. |
web_graphics_context->flush(); |