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

Side by Side 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 unified diff | Download patch
OLDNEW
(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_
OLDNEW
« 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