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

Unified Diff: gpu/command_buffer/service/in_process_command_buffer.cc

Issue 23234003: Support stream textures with the synchronous compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android clang Created 7 years, 4 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: gpu/command_buffer/service/in_process_command_buffer.cc
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index 2f949c901c2fb9be37a3d82973766fe96dfe525c..6b9fe8a5675ccd0a19ff94565596ee53920588a0 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -34,6 +34,11 @@
#include "ui/gl/gl_image.h"
#include "ui/gl/gl_share_group.h"
+#if defined(OS_ANDROID)
+#include "gpu/command_buffer/service/stream_texture_manager_in_process_android.h"
+#include "ui/gl/android/surface_texture_bridge.h"
+#endif
+
namespace gpu {
namespace {
@@ -379,11 +384,21 @@ bool InProcessCommandBuffer::InitializeOnGpuThread(
share_group = new gfx::GLShareGroup;
}
+ StreamTextureManager* stream_texture_manager = NULL;
+#if defined(OS_ANDROID)
+ stream_texture_manager = stream_texture_manager_ =
+ context_group ? context_group->stream_texture_manager_.get()
+ : new StreamTextureManagerInProcess;
+#endif
+
bool bind_generates_resource = false;
decoder_.reset(gles2::GLES2Decoder::Create(
context_group ? context_group->decoder_->GetContextGroup()
- : new gles2::ContextGroup(
- NULL, NULL, NULL, NULL, bind_generates_resource)));
+ : new gles2::ContextGroup(NULL,
+ NULL,
+ NULL,
+ stream_texture_manager,
+ bind_generates_resource)));
gpu_scheduler_.reset(
new GpuScheduler(command_buffer.get(), decoder_.get(), decoder_.get()));
@@ -712,6 +727,14 @@ base::Closure InProcessCommandBuffer::WrapCallback(
return wrapped_callback;
}
+#if defined(OS_ANDROID)
+scoped_refptr<gfx::SurfaceTextureBridge>
+InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) {
+ DCHECK(stream_texture_manager_);
+ return stream_texture_manager_->GetSurfaceTexture(stream_id);
+}
+#endif
+
// static
void InProcessCommandBuffer::EnableVirtualizedContext() {
g_use_virtualized_gl_context = true;
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.h ('k') | gpu/command_buffer/service/stream_texture_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698