| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/pepper/video_decoder_shim.h" | 5 #include "content/renderer/pepper/video_decoder_shim.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 #include <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 return; | 940 return; |
| 941 } | 941 } |
| 942 DCHECK_EQ(buffers.size(), pending_texture_mailboxes_.size()); | 942 DCHECK_EQ(buffers.size(), pending_texture_mailboxes_.size()); |
| 943 GLuint num_textures = base::checked_cast<GLuint>(buffers.size()); | 943 GLuint num_textures = base::checked_cast<GLuint>(buffers.size()); |
| 944 std::vector<uint32_t> local_texture_ids(num_textures); | 944 std::vector<uint32_t> local_texture_ids(num_textures); |
| 945 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); | 945 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); |
| 946 for (uint32_t i = 0; i < num_textures; i++) { | 946 for (uint32_t i = 0; i < num_textures; i++) { |
| 947 local_texture_ids[i] = gles2->CreateAndConsumeTextureCHROMIUM( | 947 local_texture_ids[i] = gles2->CreateAndConsumeTextureCHROMIUM( |
| 948 GL_TEXTURE_2D, pending_texture_mailboxes_[i].name); | 948 GL_TEXTURE_2D, pending_texture_mailboxes_[i].name); |
| 949 // Map the plugin texture id to the local texture id. | 949 // Map the plugin texture id to the local texture id. |
| 950 uint32_t plugin_texture_id = buffers[i].texture_id(); | 950 uint32_t plugin_texture_id = buffers[i].texture_ids().ids[0]; |
| 951 texture_id_map_[plugin_texture_id] = local_texture_ids[i]; | 951 texture_id_map_[plugin_texture_id] = local_texture_ids[i]; |
| 952 available_textures_.insert(plugin_texture_id); | 952 available_textures_.insert(plugin_texture_id); |
| 953 } | 953 } |
| 954 pending_texture_mailboxes_.clear(); | 954 pending_texture_mailboxes_.clear(); |
| 955 SendPictures(); | 955 SendPictures(); |
| 956 } | 956 } |
| 957 | 957 |
| 958 void VideoDecoderShim::ReusePictureBuffer(int32_t picture_buffer_id) { | 958 void VideoDecoderShim::ReusePictureBuffer(int32_t picture_buffer_id) { |
| 959 DCHECK(RenderThreadImpl::current()); | 959 DCHECK(RenderThreadImpl::current()); |
| 960 uint32_t texture_id = static_cast<uint32_t>(picture_buffer_id); | 960 uint32_t texture_id = static_cast<uint32_t>(picture_buffer_id); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { | 1120 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { |
| 1121 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); | 1121 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); |
| 1122 gles2->DeleteTextures(1, &texture_id); | 1122 gles2->DeleteTextures(1, &texture_id); |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 void VideoDecoderShim::FlushCommandBuffer() { | 1125 void VideoDecoderShim::FlushCommandBuffer() { |
| 1126 context_provider_->ContextGL()->Flush(); | 1126 context_provider_->ContextGL()->Flush(); |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 } // namespace content | 1129 } // namespace content |
| OLD | NEW |