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

Unified Diff: chrome/browser/android/vr_shell/vr_shell_command_buffer_gl.h

Issue 2729523002: Re-land^2 WebVR compositor bypass via BrowserMain context + mailbox (Closed)
Patch Set: Further cleanups Created 3 years, 10 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: chrome/browser/android/vr_shell/vr_shell_command_buffer_gl.h
diff --git a/chrome/browser/android/vr_shell/vr_shell_command_buffer_gl.h b/chrome/browser/android/vr_shell/vr_shell_command_buffer_gl.h
new file mode 100644
index 0000000000000000000000000000000000000000..30b066b042548f750792b1ac8ef3a6f69f76f43f
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_shell_command_buffer_gl.h
@@ -0,0 +1,57 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_COMMAND_BUFFER_GL_H_
+#define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_COMMAND_BUFFER_GL_H_
+
+#include "base/memory/weak_ptr.h"
+#include "gpu/ipc/client/gpu_channel_host.h"
+#include "ui/android/context_provider_factory.h"
+
+namespace gl {
+class SurfaceTexture;
+}
+
+namespace gpu {
+class Mailbox;
+namespace gles2 {
+class GLES2Interface;
+}
+}
+
+namespace ui {
+class ContextProviderCommandBuffer;
+}
+
+namespace vr_shell {
+
+class VrShellCommandBufferGl {
+ public:
+ VrShellCommandBufferGl();
+ ~VrShellCommandBufferGl();
+
+ void CreateContext(scoped_refptr<gl::SurfaceTexture>);
+
+ gpu::gles2::GLES2Interface* GetContext() {
+ return gl_;
+ }
+
+ bool CopyFrameToSurface(int frame_index, const gpu::Mailbox& mailbox,
+ bool discard);
+
+ private:
+ void OnGpuChannelEstablished(
+ scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
+ ui::ContextProviderFactory::GpuChannelHostResult result);
+
+ scoped_refptr<ui::ContextProviderCommandBuffer>
+ context_provider_command_buffer_;
+ gpu::gles2::GLES2Interface* gl_ = nullptr;
+ int surface_handle_;
+ base::WeakPtrFactory<VrShellCommandBufferGl> weak_ptr_factory_;
+};
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_COMMAND_BUFFER_GL_H_

Powered by Google App Engine
This is Rietveld 408576698