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

Side by Side Diff: content/renderer/media/renderer_gpu_video_accelerator_factories.cc

Issue 23567012: Use fast path of mailbox generation in RGVAF::CreateTextures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 7 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" 5 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 gles2->TexImage2D(texture_target, 216 gles2->TexImage2D(texture_target,
217 0, 217 0,
218 GL_RGBA, 218 GL_RGBA,
219 size.width(), 219 size.width(),
220 size.height(), 220 size.height(),
221 0, 221 0,
222 GL_RGBA, 222 GL_RGBA,
223 GL_UNSIGNED_BYTE, 223 GL_UNSIGNED_BYTE,
224 NULL); 224 NULL);
225 } 225 }
226 gles2->GenMailboxCHROMIUM(created_texture_mailboxes_[i].name); 226 // GLES2Implementation doesn't currently have the fast path of mailbox
227 // generation, but WebGraphicsContext3DCommandBufferImpl does.
228 context_->genMailboxCHROMIUM(created_texture_mailboxes_[i].name);
227 gles2->ProduceTextureCHROMIUM(texture_target, 229 gles2->ProduceTextureCHROMIUM(texture_target,
228 created_texture_mailboxes_[i].name); 230 created_texture_mailboxes_[i].name);
229 } 231 }
230 232
231 // We need a glFlush here to guarantee the decoder (in the GPU process) can 233 // We need a glFlush here to guarantee the decoder (in the GPU process) can
232 // use the texture ids we return here. Since textures are expected to be 234 // use the texture ids we return here. Since textures are expected to be
233 // reused, this should not be unacceptably expensive. 235 // reused, this should not be unacceptably expensive.
234 gles2->Flush(); 236 gles2->Flush();
235 DCHECK_EQ(gles2->GetError(), static_cast<GLenum>(GL_NO_ERROR)); 237 DCHECK_EQ(gles2->GetError(), static_cast<GLenum>(GL_NO_ERROR));
236 238
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 } 421 }
420 422
421 void 423 void
422 RendererGpuVideoAcceleratorFactories::AsyncDestroyVideoEncodeAccelerator() { 424 RendererGpuVideoAcceleratorFactories::AsyncDestroyVideoEncodeAccelerator() {
423 // OK to release because Destroy() will delete the VDA instance. 425 // OK to release because Destroy() will delete the VDA instance.
424 if (vea_) 426 if (vea_)
425 vea_.release()->Destroy(); 427 vea_.release()->Destroy();
426 } 428 }
427 429
428 } // namespace content 430 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698