Index: content/common/gpu/media/gpu_video_decode_accelerator.cc |
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc |
index c07ee0bdcefef2583c2572039472f0be3064f67c..7be8df8f379d588f6da111c60c4b7b90a7c78a4a 100644 |
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc |
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc |
@@ -20,8 +20,11 @@ |
#include "ui/gfx/gl/gl_context.h" |
#include "ui/gfx/gl/gl_surface_egl.h" |
#endif |
+#include "gpu/command_buffer/service/texture_manager.h" |
#include "ui/gfx/size.h" |
+using gpu::gles2::TextureManager; |
+ |
GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator( |
IPC::Message::Sender* sender, |
int32 host_route_id, |
@@ -136,9 +139,19 @@ void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( |
const std::vector<gfx::Size>& sizes) { |
DCHECK(stub_ && stub_->decoder()); // Ensure already Initialize()'d. |
gpu::gles2::GLES2Decoder* command_decoder = stub_->decoder(); |
+ gpu::gles2::TextureManager* texture_manager = |
+ command_decoder->GetContextGroup()->texture_manager(); |
std::vector<media::PictureBuffer> buffers; |
for (uint32 i = 0; i < buffer_ids.size(); ++i) { |
+ gpu::gles2::TextureManager::TextureInfo* info = |
+ texture_manager->GetTextureInfo(texture_ids[i]); |
+ if (!info || |
+ !texture_manager->ClearRenderableLevels(command_decoder, info)) { |
+ // TODO(fischman): send an error for invalid textures. |
+ DLOG(DFATAL) << "Failed to Clear texture!"; |
+ return; |
+ } |
uint32 service_texture_id; |
if (!command_decoder->GetServiceTextureId( |
texture_ids[i], &service_texture_id)) { |