Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4659)

Unified Diff: content/renderer/media/android/stream_texture_factory_android_impl.cc

Issue 132163004: Remove WebGraphicsContext3D getter from cc::ContextProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/android/stream_texture_factory_android_impl.cc
diff --git a/content/renderer/media/android/stream_texture_factory_android_impl.cc b/content/renderer/media/android/stream_texture_factory_android_impl.cc
index 3b421ca04ef76b23f7c62fb03eb715e173cb6210..d055a7895a01df681f8325e531565f9214975abb 100644
--- a/content/renderer/media/android/stream_texture_factory_android_impl.cc
+++ b/content/renderer/media/android/stream_texture_factory_android_impl.cc
@@ -7,7 +7,7 @@
#include "content/common/gpu/client/gpu_channel_host.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/renderer/gpu/stream_texture_host_android.h"
-#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "ui/gfx/size.h"
namespace content {
@@ -80,11 +80,11 @@ void StreamTextureProxyImpl::OnMatrixChanged(const float matrix[16]) {
} // namespace
StreamTextureFactoryImpl::StreamTextureFactoryImpl(
- blink::WebGraphicsContext3D* context,
+ gpu::gles2::GLES2Interface* gl,
GpuChannelHost* channel,
int view_id)
- : context_(context), channel_(channel), view_id_(view_id) {
- DCHECK(context_);
+ : gl_(gl), channel_(channel), view_id_(view_id) {
+ DCHECK(gl_);
DCHECK(channel);
}
@@ -108,28 +108,25 @@ unsigned StreamTextureFactoryImpl::CreateStreamTexture(
gpu::Mailbox* texture_mailbox,
unsigned* texture_mailbox_sync_point) {
unsigned stream_id = 0;
- if (context_->makeContextCurrent()) {
- *texture_id = context_->createTexture();
- stream_id = context_->createStreamTextureCHROMIUM(*texture_id);
+ gl_->GenTextures(1, texture_id);
- context_->genMailboxCHROMIUM(texture_mailbox->name);
- context_->bindTexture(texture_target, *texture_id);
- context_->produceTextureCHROMIUM(texture_target, texture_mailbox->name);
+ stream_id = gl_->CreateStreamTextureCHROMIUM(*texture_id);
- context_->flush();
- *texture_mailbox_sync_point = context_->insertSyncPoint();
- }
+ gl_->GenMailboxCHROMIUM(texture_mailbox->name);
+ gl_->BindTexture(texture_target, *texture_id);
+ gl_->ProduceTextureCHROMIUM(texture_target, texture_mailbox->name);
+
+ gl_->Flush();
+ *texture_mailbox_sync_point = gl_->InsertSyncPointCHROMIUM();
return stream_id;
}
void StreamTextureFactoryImpl::DestroyStreamTexture(unsigned texture_id) {
- if (context_->makeContextCurrent()) {
- // TODO(sievers): Make the destroyStreamTexture implicit when the last
- // texture referencing it is lost.
- context_->destroyStreamTextureCHROMIUM(texture_id);
- context_->deleteTexture(texture_id);
- context_->flush();
- }
+ // TODO(sievers): Make the DestroyStreamTexture implicit when the last
+ // texture referencing it is lost.
+ gl_->DestroyStreamTextureCHROMIUM(texture_id);
+ gl_->DeleteTextures(1, &texture_id);
+ gl_->Flush();
}
void StreamTextureFactoryImpl::SetStreamTextureSize(
@@ -137,8 +134,8 @@ void StreamTextureFactoryImpl::SetStreamTextureSize(
channel_->Send(new GpuChannelMsg_SetStreamTextureSize(stream_id, size));
}
-blink::WebGraphicsContext3D* StreamTextureFactoryImpl::Context3d() {
- return context_;
+gpu::gles2::GLES2Interface* StreamTextureFactoryImpl::ContextGL() {
+ return gl_;
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698