| 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.h" | 5 #include "content/renderer/media/android/stream_texture_factory_android.h" |
| 6 | 6 |
| 7 #include "content/common/gpu/client/gpu_channel_host.h" | 7 #include "content/common/gpu/client/gpu_channel_host.h" |
| 8 #include "content/common/gpu/gpu_messages.h" | 8 #include "content/common/gpu/gpu_messages.h" |
| 9 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 9 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 context_->genMailboxCHROMIUM(texture_mailbox->name); | 84 context_->genMailboxCHROMIUM(texture_mailbox->name); |
| 85 context_->bindTexture(texture_target, *texture_id); | 85 context_->bindTexture(texture_target, *texture_id); |
| 86 context_->produceTextureCHROMIUM(texture_target, texture_mailbox->name); | 86 context_->produceTextureCHROMIUM(texture_target, texture_mailbox->name); |
| 87 | 87 |
| 88 context_->flush(); | 88 context_->flush(); |
| 89 *texture_mailbox_sync_point = context_->insertSyncPoint(); | 89 *texture_mailbox_sync_point = context_->insertSyncPoint(); |
| 90 } | 90 } |
| 91 return stream_id; | 91 return stream_id; |
| 92 } | 92 } |
| 93 | 93 |
| 94 void StreamTextureFactory::DestroyStreamTexture(unsigned texture_id) { | 94 void StreamTextureFactory::DestroyStreamTexture(unsigned stream_id, |
| 95 unsigned texture_id) { |
| 95 if (context_->makeContextCurrent()) { | 96 if (context_->makeContextCurrent()) { |
| 96 // TODO(sievers): Make the destroyStreamTexture implicit when the last | 97 // TODO(sievers): Make the destroyStreamTexture implicit when the last |
| 97 // texture referencing it is lost. | 98 // texture referencing it is lost. |
| 98 context_->destroyStreamTextureCHROMIUM(texture_id); | 99 context_->destroyStreamTextureCHROMIUM(stream_id); |
| 99 context_->deleteTexture(texture_id); | 100 context_->deleteTexture(texture_id); |
| 100 context_->flush(); | 101 context_->flush(); |
| 101 } | 102 } |
| 102 } | 103 } |
| 103 | 104 |
| 104 void StreamTextureFactory::SetStreamTextureSize( | 105 void StreamTextureFactory::SetStreamTextureSize( |
| 105 int32 stream_id, const gfx::Size& size) { | 106 int32 stream_id, const gfx::Size& size) { |
| 106 channel_->Send(new GpuChannelMsg_SetStreamTextureSize(stream_id, size)); | 107 channel_->Send(new GpuChannelMsg_SetStreamTextureSize(stream_id, size)); |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace content | 110 } // namespace content |
| OLD | NEW |