Commit d231c648 authored by fischman@chromium.org's avatar fischman@chromium.org

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
parent 62f8c199
...@@ -20,8 +20,11 @@ ...@@ -20,8 +20,11 @@
#include "ui/gfx/gl/gl_context.h" #include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_surface_egl.h" #include "ui/gfx/gl/gl_surface_egl.h"
#endif #endif
#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gfx/size.h" #include "ui/gfx/size.h"
using gpu::gles2::TextureManager;
GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator( GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator(
IPC::Message::Sender* sender, IPC::Message::Sender* sender,
int32 host_route_id, int32 host_route_id,
...@@ -136,9 +139,19 @@ void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( ...@@ -136,9 +139,19 @@ void GpuVideoDecodeAccelerator::OnAssignPictureBuffers(
const std::vector<gfx::Size>& sizes) { const std::vector<gfx::Size>& sizes) {
DCHECK(stub_ && stub_->decoder()); // Ensure already Initialize()'d. DCHECK(stub_ && stub_->decoder()); // Ensure already Initialize()'d.
gpu::gles2::GLES2Decoder* command_decoder = stub_->decoder(); gpu::gles2::GLES2Decoder* command_decoder = stub_->decoder();
gpu::gles2::TextureManager* texture_manager =
command_decoder->GetContextGroup()->texture_manager();
std::vector<media::PictureBuffer> buffers; std::vector<media::PictureBuffer> buffers;
for (uint32 i = 0; i < buffer_ids.size(); ++i) { 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; uint32 service_texture_id;
if (!command_decoder->GetServiceTextureId( if (!command_decoder->GetServiceTextureId(
texture_ids[i], &service_texture_id)) { texture_ids[i], &service_texture_id)) {
......
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