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

Side by Side 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, 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 "gpu/ipc/client/gpu_channel_host.h"
10 #include "ui/android/context_provider_factory.h"
11
12 namespace gl {
13 class SurfaceTexture;
14 }
15
16 namespace gpu {
17 class Mailbox;
18 namespace gles2 {
19 class GLES2Interface;
20 }
21 }
22
23 namespace ui {
24 class ContextProviderCommandBuffer;
25 }
26
27 namespace vr_shell {
28
29 class VrShellCommandBufferGl {
30 public:
31 VrShellCommandBufferGl();
32 ~VrShellCommandBufferGl();
33
34 void CreateContext(scoped_refptr<gl::SurfaceTexture>);
35
36 gpu::gles2::GLES2Interface* GetContext() {
37 return gl_;
38 }
39
40 bool CopyFrameToSurface(int frame_index, const gpu::Mailbox& mailbox,
41 bool discard);
42
43 private:
44 void OnGpuChannelEstablished(
45 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
46 ui::ContextProviderFactory::GpuChannelHostResult result);
47
48 scoped_refptr<ui::ContextProviderCommandBuffer>
49 context_provider_command_buffer_;
50 gpu::gles2::GLES2Interface* gl_ = nullptr;
51 int surface_handle_;
52 base::WeakPtrFactory<VrShellCommandBufferGl> weak_ptr_factory_;
53 };
54
55 } // namespace vr_shell
56
57 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_COMMAND_BUFFER_GL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698