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

Unified Diff: content/renderer/media/android/stream_texture_factory_android_synchronous_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_synchronous_impl.cc
diff --git a/content/renderer/media/android/stream_texture_factory_android_synchronous_impl.cc b/content/renderer/media/android/stream_texture_factory_android_synchronous_impl.cc
index c284328a4b28c899d5656caafe49a9b203ddf9ac..c19b5c67b3294e916daf927a7e871951f9baf9d7 100644
--- a/content/renderer/media/android/stream_texture_factory_android_synchronous_impl.cc
+++ b/content/renderer/media/android/stream_texture_factory_android_synchronous_impl.cc
@@ -15,9 +15,11 @@
#include "base/synchronization/lock.h"
#include "cc/output/context_provider.h"
#include "content/common/android/surface_texture_peer.h"
-#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "ui/gl/android/surface_texture.h"
+using gpu::gles2::GLES2Interface;
+
namespace content {
namespace {
@@ -154,41 +156,37 @@ unsigned StreamTextureFactorySynchronousImpl::CreateStreamTexture(
gpu::Mailbox* texture_mailbox,
unsigned* texture_mailbox_sync_point) {
DCHECK(context_provider_);
- blink::WebGraphicsContext3D* context = context_provider_->Context3d();
unsigned stream_id = 0;
- if (context->makeContextCurrent()) {
- *texture_id = context->createTexture();
- stream_id = context->createStreamTextureCHROMIUM(*texture_id);
+ GLES2Interface* gl = context_provider_->ContextGL();
+ gl->GenTextures(1, texture_id);
+ stream_id = gl->CreateStreamTextureCHROMIUM(*texture_id);
- context->genMailboxCHROMIUM(texture_mailbox->name);
- context->bindTexture(texture_target, *texture_id);
- context->produceTextureCHROMIUM(texture_target, texture_mailbox->name);
+ gl->GenMailboxCHROMIUM(texture_mailbox->name);
+ gl->BindTexture(texture_target, *texture_id);
+ gl->ProduceTextureCHROMIUM(texture_target, texture_mailbox->name);
- context->flush();
- *texture_mailbox_sync_point = context->insertSyncPoint();
- }
+ gl->Flush();
+ *texture_mailbox_sync_point = gl->InsertSyncPointCHROMIUM();
return stream_id;
}
void StreamTextureFactorySynchronousImpl::DestroyStreamTexture(
unsigned texture_id) {
DCHECK(context_provider_);
- blink::WebGraphicsContext3D* context = context_provider_->Context3d();
- if (context->makeContextCurrent()) {
- context->destroyStreamTextureCHROMIUM(texture_id);
- context->deleteTexture(texture_id);
- context->flush();
- }
+ GLES2Interface* gl = context_provider_->ContextGL();
+ gl->DestroyStreamTextureCHROMIUM(texture_id);
+ gl->DeleteTextures(1, &texture_id);
+ gl->Flush();
}
void StreamTextureFactorySynchronousImpl::SetStreamTextureSize(
int32 stream_id,
const gfx::Size& size) {}
-blink::WebGraphicsContext3D*
-StreamTextureFactorySynchronousImpl::Context3d() {
+gpu::gles2::GLES2Interface*
+StreamTextureFactorySynchronousImpl::ContextGL() {
DCHECK(context_provider_);
- return context_provider_->Context3d();
+ return context_provider_->ContextGL();
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698