OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_COMMAND_BUFFER_GL_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_COMMAND_BUFFER_GL_H_ |
| 7 |
| 8 #include "base/memory/weak_ptr.h" |
| 9 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" |
| 10 |
| 11 namespace gl { |
| 12 class SurfaceTexture; |
| 13 class ScopedJavaSurface; |
| 14 } |
| 15 |
| 16 namespace gpu { |
| 17 class GpuChannelHost; |
| 18 struct MailboxHolder; |
| 19 namespace gles2 { |
| 20 class GLES2Interface; |
| 21 } |
| 22 } |
| 23 |
| 24 namespace ui { |
| 25 class ContextProviderCommandBuffer; |
| 26 } |
| 27 |
| 28 namespace vr_shell { |
| 29 |
| 30 class GpuRenderer; |
| 31 |
| 32 class VrShellCommandBufferGl { |
| 33 public: |
| 34 VrShellCommandBufferGl(); |
| 35 ~VrShellCommandBufferGl(); |
| 36 |
| 37 std::unique_ptr<gl::ScopedJavaSurface> CreateSurface( |
| 38 scoped_refptr<gl::SurfaceTexture>); |
| 39 |
| 40 void ResizeSurface(int width, int height); |
| 41 |
| 42 bool CopyFrameToSurface(int frame_index, |
| 43 const gpu::MailboxHolder& mailbox, |
| 44 bool discard); |
| 45 |
| 46 private: |
| 47 void OnGpuChannelEstablished( |
| 48 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host); |
| 49 |
| 50 scoped_refptr<ui::ContextProviderCommandBuffer> |
| 51 context_provider_command_buffer_; |
| 52 gpu::gles2::GLES2Interface* gl_ = nullptr; |
| 53 int surface_handle_; |
| 54 std::unique_ptr<GpuRenderer> copy_renderer_; |
| 55 base::WeakPtrFactory<VrShellCommandBufferGl> weak_ptr_factory_; |
| 56 }; |
| 57 |
| 58 } // namespace vr_shell |
| 59 |
| 60 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_COMMAND_BUFFER_GL_H_ |
OLD | NEW |