Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: content/renderer/media/renderer_gpu_video_decoder_factories.cc

Issue 9639005: HW video decode support for --enable-threaded-compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/renderer_gpu_video_decoder_factories.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/renderer_gpu_video_decoder_factories.cc
diff --git a/content/renderer/media/renderer_gpu_video_decoder_factories.cc b/content/renderer/media/renderer_gpu_video_decoder_factories.cc
index e79834db313b05b15aa0e92aa42103d16cbc9e11..aad30e95c3ccf60200a5c6161522ac83efbfcba6 100644
--- a/content/renderer/media/renderer_gpu_video_decoder_factories.cc
+++ b/content/renderer/media/renderer_gpu_video_decoder_factories.cc
@@ -9,15 +9,16 @@
#include "content/common/child_thread.h"
#include "content/common/gpu/client/command_buffer_proxy.h"
#include "content/common/gpu/client/gpu_channel_host.h"
-#include "content/common/gpu/client/content_gl_context.h"
+#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
RendererGpuVideoDecoderFactories::~RendererGpuVideoDecoderFactories() {}
RendererGpuVideoDecoderFactories::RendererGpuVideoDecoderFactories(
- GpuChannelHost* gpu_channel_host, base::WeakPtr<ContentGLContext> context)
- : message_loop_(MessageLoop::current()),
+ GpuChannelHost* gpu_channel_host, MessageLoop* message_loop,
+ WebGraphicsContext3DCommandBufferImpl* wgc3dcbi)
+ : message_loop_(message_loop),
gpu_channel_host_(gpu_channel_host),
- context_(context) {
+ wgc3dcbi_(wgc3dcbi) {
}
media::VideoDecodeAccelerator*
@@ -38,9 +39,10 @@ void RendererGpuVideoDecoderFactories::AsyncCreateVideoDecodeAccelerator(
media::VideoDecodeAccelerator::Client* client,
media::VideoDecodeAccelerator** vda,
base::WaitableEvent* waiter) {
- if (context_) {
+ if (wgc3dcbi_->makeContextCurrent()) {
jamesr 2012/03/08 05:34:06 in chromium land is it typical practice to DCHECK(
Ami GONE FROM CHROMIUM 2012/03/08 17:39:50 Done.
*vda = gpu_channel_host_->CreateVideoDecoder(
- context_->GetCommandBufferProxy()->route_id(), profile, client);
+ wgc3dcbi_->context()->GetCommandBufferProxy()->route_id(),
+ profile, client);
} else {
*vda = NULL;
}
@@ -63,12 +65,13 @@ bool RendererGpuVideoDecoderFactories::CreateTextures(
void RendererGpuVideoDecoderFactories::AsyncCreateTextures(
int32 count, const gfx::Size& size, std::vector<uint32>* texture_ids,
uint32* texture_target, bool* success, base::WaitableEvent* waiter) {
- if (!context_) {
+ if (!wgc3dcbi_->makeContextCurrent()) {
*success = false;
waiter->Signal();
return;
}
- gpu::gles2::GLES2Implementation* gles2 = context_->GetImplementation();
+ gpu::gles2::GLES2Implementation* gles2 =
+ wgc3dcbi_->context()->GetImplementation();
texture_ids->resize(count);
gles2->GenTextures(count, &texture_ids->at(0));
*texture_target = GL_TEXTURE_2D;
@@ -99,9 +102,10 @@ void RendererGpuVideoDecoderFactories::DeleteTexture(uint32 texture_id) {
void RendererGpuVideoDecoderFactories::AsyncDeleteTexture(uint32 texture_id) {
DCHECK_EQ(MessageLoop::current(), message_loop_);
- if (!context_)
+ if (!wgc3dcbi_->makeContextCurrent())
return;
- gpu::gles2::GLES2Implementation* gles2 = context_->GetImplementation();
+ gpu::gles2::GLES2Implementation* gles2 =
+ wgc3dcbi_->context()->GetImplementation();
gles2->DeleteTextures(1, &texture_id);
DCHECK_EQ(gles2->GetError(), static_cast<GLenum>(GL_NO_ERROR));
}
@@ -110,7 +114,7 @@ base::SharedMemory* RendererGpuVideoDecoderFactories::CreateSharedMemory(
size_t size) {
base::SharedMemory* shm = NULL;
base::WaitableEvent waiter(false, false);
- message_loop_->PostTask(FROM_HERE, base::Bind(
+ ChildThread::current()->message_loop()->PostTask(FROM_HERE, base::Bind(
&RendererGpuVideoDecoderFactories::AsyncCreateSharedMemory, this,
size, &shm, &waiter));
waiter.Wait();
« no previous file with comments | « content/renderer/media/renderer_gpu_video_decoder_factories.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698