| 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/android/stream_texture_factory_android_synchron
ous_impl.h" | 5 #include "content/renderer/media/android/stream_texture_factory_android_synchron
ous_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 player_id); | 147 player_id); |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 | 150 |
| 151 unsigned StreamTextureFactorySynchronousImpl::CreateStreamTexture( | 151 unsigned StreamTextureFactorySynchronousImpl::CreateStreamTexture( |
| 152 unsigned texture_target, | 152 unsigned texture_target, |
| 153 unsigned* texture_id, | 153 unsigned* texture_id, |
| 154 gpu::Mailbox* texture_mailbox, | 154 gpu::Mailbox* texture_mailbox, |
| 155 unsigned* texture_mailbox_sync_point) { | 155 unsigned* texture_mailbox_sync_point) { |
| 156 DCHECK(context_provider_); | 156 DCHECK(context_provider_); |
| 157 WebKit::WebGraphicsContext3D* context = context_provider_->Context3d(); | 157 blink::WebGraphicsContext3D* context = context_provider_->Context3d(); |
| 158 unsigned stream_id = 0; | 158 unsigned stream_id = 0; |
| 159 if (context->makeContextCurrent()) { | 159 if (context->makeContextCurrent()) { |
| 160 *texture_id = context->createTexture(); | 160 *texture_id = context->createTexture(); |
| 161 stream_id = context->createStreamTextureCHROMIUM(*texture_id); | 161 stream_id = context->createStreamTextureCHROMIUM(*texture_id); |
| 162 | 162 |
| 163 context->genMailboxCHROMIUM(texture_mailbox->name); | 163 context->genMailboxCHROMIUM(texture_mailbox->name); |
| 164 context->bindTexture(texture_target, *texture_id); | 164 context->bindTexture(texture_target, *texture_id); |
| 165 context->produceTextureCHROMIUM(texture_target, texture_mailbox->name); | 165 context->produceTextureCHROMIUM(texture_target, texture_mailbox->name); |
| 166 | 166 |
| 167 context->flush(); | 167 context->flush(); |
| 168 *texture_mailbox_sync_point = context->insertSyncPoint(); | 168 *texture_mailbox_sync_point = context->insertSyncPoint(); |
| 169 } | 169 } |
| 170 return stream_id; | 170 return stream_id; |
| 171 } | 171 } |
| 172 | 172 |
| 173 void StreamTextureFactorySynchronousImpl::DestroyStreamTexture( | 173 void StreamTextureFactorySynchronousImpl::DestroyStreamTexture( |
| 174 unsigned texture_id) { | 174 unsigned texture_id) { |
| 175 DCHECK(context_provider_); | 175 DCHECK(context_provider_); |
| 176 WebKit::WebGraphicsContext3D* context = context_provider_->Context3d(); | 176 blink::WebGraphicsContext3D* context = context_provider_->Context3d(); |
| 177 if (context->makeContextCurrent()) { | 177 if (context->makeContextCurrent()) { |
| 178 context->destroyStreamTextureCHROMIUM(texture_id); | 178 context->destroyStreamTextureCHROMIUM(texture_id); |
| 179 context->deleteTexture(texture_id); | 179 context->deleteTexture(texture_id); |
| 180 context->flush(); | 180 context->flush(); |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| 184 void StreamTextureFactorySynchronousImpl::SetStreamTextureSize( | 184 void StreamTextureFactorySynchronousImpl::SetStreamTextureSize( |
| 185 int32 stream_id, | 185 int32 stream_id, |
| 186 const gfx::Size& size) {} | 186 const gfx::Size& size) {} |
| 187 | 187 |
| 188 WebKit::WebGraphicsContext3D* | 188 blink::WebGraphicsContext3D* |
| 189 StreamTextureFactorySynchronousImpl::Context3d() { | 189 StreamTextureFactorySynchronousImpl::Context3d() { |
| 190 DCHECK(context_provider_); | 190 DCHECK(context_provider_); |
| 191 return context_provider_->Context3d(); | 191 return context_provider_->Context3d(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace content | 194 } // namespace content |
| OLD | NEW |