| 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.h" | 5 #include "content/renderer/media/android/stream_texture_factory.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "cc/output/context_provider.h" | 8 #include "cc/output/context_provider.h" |
| 9 #include "content/common/gpu/client/context_provider_command_buffer.h" | 9 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 10 #include "gpu/command_buffer/client/gles2_interface.h" | 10 #include "gpu/command_buffer/client/gles2_interface.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 return new StreamTextureProxy(host); | 88 return new StreamTextureProxy(host); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void StreamTextureFactory::EstablishPeer(int32_t stream_id, | 91 void StreamTextureFactory::EstablishPeer(int32_t stream_id, |
| 92 int player_id, | 92 int player_id, |
| 93 int frame_id) { | 93 int frame_id) { |
| 94 channel_->Send( | 94 channel_->Send( |
| 95 new GpuStreamTextureMsg_EstablishPeer(stream_id, frame_id, player_id)); | 95 new GpuStreamTextureMsg_EstablishPeer(stream_id, frame_id, player_id)); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void StreamTextureFactory::ForwardStreamTextureForSurfaceRequest( |
| 99 int32_t stream_id, |
| 100 uint64_t request_token) { |
| 101 channel_->Send(new GpuStreamTextureMsg_ForwardForSurfaceRequest( |
| 102 stream_id, request_token)); |
| 103 } |
| 104 |
| 98 unsigned StreamTextureFactory::CreateStreamTexture( | 105 unsigned StreamTextureFactory::CreateStreamTexture( |
| 99 unsigned texture_target, | 106 unsigned texture_target, |
| 100 unsigned* texture_id, | 107 unsigned* texture_id, |
| 101 gpu::Mailbox* texture_mailbox) { | 108 gpu::Mailbox* texture_mailbox) { |
| 102 GLuint stream_id = 0; | 109 GLuint stream_id = 0; |
| 103 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); | 110 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); |
| 104 gl->GenTextures(1, texture_id); | 111 gl->GenTextures(1, texture_id); |
| 105 gl->ShallowFlushCHROMIUM(); | 112 gl->ShallowFlushCHROMIUM(); |
| 106 stream_id = context_provider_->GetCommandBufferProxy()->CreateStreamTexture( | 113 stream_id = context_provider_->GetCommandBufferProxy()->CreateStreamTexture( |
| 107 *texture_id); | 114 *texture_id); |
| 108 gl->GenMailboxCHROMIUM(texture_mailbox->name); | 115 gl->GenMailboxCHROMIUM(texture_mailbox->name); |
| 109 gl->ProduceTextureDirectCHROMIUM( | 116 gl->ProduceTextureDirectCHROMIUM( |
| 110 *texture_id, texture_target, texture_mailbox->name); | 117 *texture_id, texture_target, texture_mailbox->name); |
| 111 return stream_id; | 118 return stream_id; |
| 112 } | 119 } |
| 113 | 120 |
| 114 void StreamTextureFactory::SetStreamTextureSize(int32_t stream_id, | 121 void StreamTextureFactory::SetStreamTextureSize(int32_t stream_id, |
| 115 const gfx::Size& size) { | 122 const gfx::Size& size) { |
| 116 channel_->Send(new GpuStreamTextureMsg_SetSize(stream_id, size)); | 123 channel_->Send(new GpuStreamTextureMsg_SetSize(stream_id, size)); |
| 117 } | 124 } |
| 118 | 125 |
| 119 gpu::gles2::GLES2Interface* StreamTextureFactory::ContextGL() { | 126 gpu::gles2::GLES2Interface* StreamTextureFactory::ContextGL() { |
| 120 return context_provider_->ContextGL(); | 127 return context_provider_->ContextGL(); |
| 121 } | 128 } |
| 122 | 129 |
| 123 } // namespace content | 130 } // namespace content |
| OLD | NEW |