summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-05 22:33:47 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-05 22:33:47 +0000
commitd231c648042148d89a99676b76e37591fce663a9 (patch)
tree392dfc4b39db636f5d5f5f73162cee96bffb694e /content/common
parent62f8c1994a1a3eb35fe0164a94d20033792486bc (diff)
downloadchromium_src-d231c648042148d89a99676b76e37591fce663a9.zip
chromium_src-d231c648042148d89a99676b76e37591fce663a9.tar.gz
chromium_src-d231c648042148d89a99676b76e37591fce663a9.tar.bz2
Indicate to that textures passed to GVDA are cleared by the decoder.
This is required by CL 108226; without this textures that were created with TexImage2D(..., NULL) (i.e. pixels==NULL) get cleared right before being rendered, *after* they've been drawn to by the decoder. BUG=104579 TEST=trybots. Also, gles2 works again (as does the nascent <video> HW video decode being developed for the bug above) Review URL: http://codereview.chromium.org/8702017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113046 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r--content/common/gpu/media/gpu_video_decode_accelerator.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc
index c07ee0b..7be8df8 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)) {