| 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_synchronous_impl
.h" | 5 #include "content/renderer/media/android/stream_texture_factory_synchronous_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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 193 } |
| 194 | 194 |
| 195 unsigned StreamTextureFactorySynchronousImpl::CreateStreamTexture( | 195 unsigned StreamTextureFactorySynchronousImpl::CreateStreamTexture( |
| 196 unsigned texture_target, | 196 unsigned texture_target, |
| 197 unsigned* texture_id, | 197 unsigned* texture_id, |
| 198 gpu::Mailbox* texture_mailbox) { | 198 gpu::Mailbox* texture_mailbox) { |
| 199 DCHECK(context_provider_.get()); | 199 DCHECK(context_provider_.get()); |
| 200 unsigned stream_id = 0; | 200 unsigned stream_id = 0; |
| 201 GLES2Interface* gl = context_provider_->ContextGL(); | 201 GLES2Interface* gl = context_provider_->ContextGL(); |
| 202 gl->GenTextures(1, texture_id); | 202 gl->GenTextures(1, texture_id); |
| 203 stream_id = gl->CreateStreamTextureCHROMIUM(*texture_id); | 203 gl->ShallowFlushCHROMIUM(); |
| 204 | 204 stream_id = context_provider_->CreateStreamTexture(*texture_id); |
| 205 gl->GenMailboxCHROMIUM(texture_mailbox->name); | 205 gl->GenMailboxCHROMIUM(texture_mailbox->name); |
| 206 gl->ProduceTextureDirectCHROMIUM( | 206 gl->ProduceTextureDirectCHROMIUM( |
| 207 *texture_id, texture_target, texture_mailbox->name); | 207 *texture_id, texture_target, texture_mailbox->name); |
| 208 return stream_id; | 208 return stream_id; |
| 209 } | 209 } |
| 210 | 210 |
| 211 void StreamTextureFactorySynchronousImpl::SetStreamTextureSize( | 211 void StreamTextureFactorySynchronousImpl::SetStreamTextureSize( |
| 212 int32 stream_id, | 212 int32 stream_id, |
| 213 const gfx::Size& size) {} | 213 const gfx::Size& size) {} |
| 214 | 214 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 227 | 227 |
| 228 void StreamTextureFactorySynchronousImpl::RemoveObserver( | 228 void StreamTextureFactorySynchronousImpl::RemoveObserver( |
| 229 StreamTextureFactoryContextObserver* obs) { | 229 StreamTextureFactoryContextObserver* obs) { |
| 230 DCHECK_EQ(observer_, obs); | 230 DCHECK_EQ(observer_, obs); |
| 231 observer_ = NULL; | 231 observer_ = NULL; |
| 232 if (context_provider_.get()) | 232 if (context_provider_.get()) |
| 233 context_provider_->RemoveObserver(obs); | 233 context_provider_->RemoveObserver(obs); |
| 234 } | 234 } |
| 235 | 235 |
| 236 } // namespace content | 236 } // namespace content |
| OLD | NEW |