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

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

Issue 2738683002: WebVR compositor bypass via BrowserMain context + mailbox (Closed)
Patch Set: Less hacked up version Created 3 years, 9 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..abe8ca0f4c3061a55bf03fc84e4f40689c779823
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_shell_command_buffer_gl.h
@@ -0,0 +1,60 @@
+// 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 "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
+
+namespace gl {
+class SurfaceTexture;
+class ScopedJavaSurface;
+}
+
+namespace gpu {
+class GpuChannelHost;
+struct MailboxHolder;
+namespace gles2 {
+class GLES2Interface;
+}
+}
+
+namespace ui {
+class ContextProviderCommandBuffer;
+}
+
+namespace vr_shell {
+
+class GpuRenderer;
+
+class VrShellCommandBufferGl {
+ public:
+ VrShellCommandBufferGl();
+ ~VrShellCommandBufferGl();
+
+ std::unique_ptr<gl::ScopedJavaSurface> CreateSurface(
+ scoped_refptr<gl::SurfaceTexture>);
+
+ void ResizeSurface(int width, int height);
+
+ bool CopyFrameToSurface(int frame_index,
+ const gpu::MailboxHolder& mailbox,
+ bool discard);
+
+ private:
+ void OnGpuChannelEstablished(
+ scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
+
+ scoped_refptr<ui::ContextProviderCommandBuffer>
+ context_provider_command_buffer_;
+ gpu::gles2::GLES2Interface* gl_ = nullptr;
+ int surface_handle_;
+ std::unique_ptr<GpuRenderer> copy_renderer_;
+ base::WeakPtrFactory<VrShellCommandBufferGl> weak_ptr_factory_;
+};
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_COMMAND_BUFFER_GL_H_
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.cc ('k') | chrome/browser/android/vr_shell/vr_shell_command_buffer_gl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698