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

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

Issue 10392141: Plumb texture target to VideoDecodeAccelerator::Client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win build Created 8 years, 6 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') | media/filters/gpu_video_decoder.h » ('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 82d145b46a4f3706f6af679db848eea0898fc838..305ef99e5d5431723c83c131dca4482aa742fa80 100644
--- a/content/renderer/media/renderer_gpu_video_decoder_factories.cc
+++ b/content/renderer/media/renderer_gpu_video_decoder_factories.cc
@@ -75,7 +75,7 @@ void RendererGpuVideoDecoderFactories::AsyncCreateVideoDecodeAccelerator(
bool RendererGpuVideoDecoderFactories::CreateTextures(
int32 count, const gfx::Size& size,
std::vector<uint32>* texture_ids,
- uint32* texture_target) {
+ uint32 texture_target) {
DCHECK_NE(MessageLoop::current(), message_loop_);
bool success = false;
base::WaitableEvent waiter(false, false);
@@ -88,8 +88,9 @@ 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) {
+ uint32 texture_target, bool* success, base::WaitableEvent* waiter) {
DCHECK_EQ(MessageLoop::current(), message_loop_);
+ DCHECK(texture_target);
if (!context_) {
*success = false;
waiter->Signal();
@@ -98,16 +99,15 @@ void RendererGpuVideoDecoderFactories::AsyncCreateTextures(
gpu::gles2::GLES2Implementation* gles2 = context_->GetImplementation();
texture_ids->resize(count);
gles2->GenTextures(count, &texture_ids->at(0));
- *texture_target = GL_TEXTURE_2D;
for (int i = 0; i < count; ++i) {
gles2->ActiveTexture(GL_TEXTURE0);
uint32 texture_id = texture_ids->at(i);
- gles2->BindTexture(*texture_target, texture_id);
- gles2->TexParameteri(*texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- gles2->TexParameteri(*texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- gles2->TexParameterf(*texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- gles2->TexParameterf(*texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- gles2->TexImage2D(*texture_target, 0, GL_RGBA, size.width(), size.height(),
+ gles2->BindTexture(texture_target, texture_id);
+ gles2->TexParameteri(texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ gles2->TexParameteri(texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ gles2->TexParameterf(texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ gles2->TexParameterf(texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ gles2->TexImage2D(texture_target, 0, GL_RGBA, size.width(), size.height(),
0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
// We need a glFlush here to guarantee the decoder (in the GPU process) can
« no previous file with comments | « content/renderer/media/renderer_gpu_video_decoder_factories.h ('k') | media/filters/gpu_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698