OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |