| 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/media/android/stream_texture_factory_impl.h" | 5 #include "content/renderer/media/android/stream_texture_factory_impl.h" |
| 6 | 6 |
| 7 #include "cc/output/context_provider.h" | 7 #include "cc/output/context_provider.h" |
| 8 #include "content/common/gpu/client/gpu_channel_host.h" | 8 #include "content/common/gpu/client/gpu_channel_host.h" |
| 9 #include "content/common/gpu/gpu_messages.h" | 9 #include "content/common/gpu/gpu_messages.h" |
| 10 #include "content/renderer/gpu/stream_texture_host_android.h" | 10 #include "content/renderer/gpu/stream_texture_host_android.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 channel_->Send( | 139 channel_->Send( |
| 140 new GpuStreamTextureMsg_EstablishPeer(stream_id, frame_id_, player_id)); | 140 new GpuStreamTextureMsg_EstablishPeer(stream_id, frame_id_, player_id)); |
| 141 } | 141 } |
| 142 | 142 |
| 143 unsigned StreamTextureFactoryImpl::CreateStreamTexture( | 143 unsigned StreamTextureFactoryImpl::CreateStreamTexture( |
| 144 unsigned texture_target, | 144 unsigned texture_target, |
| 145 unsigned* texture_id, | 145 unsigned* texture_id, |
| 146 gpu::Mailbox* texture_mailbox) { | 146 gpu::Mailbox* texture_mailbox) { |
| 147 GLuint stream_id = 0; | 147 GLuint stream_id = 0; |
| 148 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); | 148 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); |
| 149 int32 image_id = channel_->ReserveImageId(); |
| 149 gl->GenTextures(1, texture_id); | 150 gl->GenTextures(1, texture_id); |
| 150 | 151 stream_id = gl->CreateStreamTextureImageCHROMIUM(image_id); |
| 151 stream_id = gl->CreateStreamTextureCHROMIUM(*texture_id); | 152 gl->BindTexture(texture_target, *texture_id); |
| 152 | 153 gl->BindTexImage2DCHROMIUM(texture_target, image_id); |
| 153 gl->GenMailboxCHROMIUM(texture_mailbox->name); | 154 gl->GenMailboxCHROMIUM(texture_mailbox->name); |
| 154 gl->ProduceTextureDirectCHROMIUM( | 155 gl->ProduceTextureDirectCHROMIUM( |
| 155 *texture_id, texture_target, texture_mailbox->name); | 156 *texture_id, texture_target, texture_mailbox->name); |
| 156 return stream_id; | 157 return stream_id; |
| 157 } | 158 } |
| 158 | 159 |
| 159 void StreamTextureFactoryImpl::SetStreamTextureSize(int32 stream_id, | 160 void StreamTextureFactoryImpl::SetStreamTextureSize(int32 stream_id, |
| 160 const gfx::Size& size) { | 161 const gfx::Size& size) { |
| 161 channel_->Send(new GpuStreamTextureMsg_SetSize(stream_id, size)); | 162 channel_->Send(new GpuStreamTextureMsg_SetSize(stream_id, size)); |
| 162 } | 163 } |
| 163 | 164 |
| 164 gpu::gles2::GLES2Interface* StreamTextureFactoryImpl::ContextGL() { | 165 gpu::gles2::GLES2Interface* StreamTextureFactoryImpl::ContextGL() { |
| 165 return context_provider_->ContextGL(); | 166 return context_provider_->ContextGL(); |
| 166 } | 167 } |
| 167 | 168 |
| 168 void StreamTextureFactoryImpl::AddObserver( | 169 void StreamTextureFactoryImpl::AddObserver( |
| 169 StreamTextureFactoryContextObserver* obs) { | 170 StreamTextureFactoryContextObserver* obs) { |
| 170 } | 171 } |
| 171 | 172 |
| 172 void StreamTextureFactoryImpl::RemoveObserver( | 173 void StreamTextureFactoryImpl::RemoveObserver( |
| 173 StreamTextureFactoryContextObserver* obs) { | 174 StreamTextureFactoryContextObserver* obs) { |
| 174 } | 175 } |
| 175 | 176 |
| 176 } // namespace content | 177 } // namespace content |
| OLD | NEW |