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_ |