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

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: Revert FrameView.cpp change, re-enable typemap workaround. 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 class Mailbox;
19 class SyncToken;
20 namespace gles2 {
21 class GLES2Interface;
22 }
23 }
24
25 namespace ui {
26 class ContextProviderCommandBuffer;
27 }
28
29 namespace vr_shell {
30
31 class GpuRenderer;
32
33 class VrShellCommandBufferGl {
34 public:
35 VrShellCommandBufferGl();
36 ~VrShellCommandBufferGl();
37
38 std::unique_ptr<gl::ScopedJavaSurface> CreateSurface(
39 scoped_refptr<gl::SurfaceTexture>);
40
41 void ResizeSurface(int width, int height);
42
43 bool CopyFrameToSurface(int frame_index,
44 const gpu::Mailbox& mailbox,
45 gpu::SyncToken& sync_token,
46 bool discard);
47
48 private:
49 void OnGpuChannelEstablished(
50 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
51
52 scoped_refptr<ui::ContextProviderCommandBuffer>
53 context_provider_command_buffer_;
54 gpu::gles2::GLES2Interface* gl_ = nullptr;
55 int surface_handle_;
56 std::unique_ptr<GpuRenderer> copy_renderer_;
57 base::WeakPtrFactory<VrShellCommandBufferGl> weak_ptr_factory_;
58 };
59
60 } // namespace vr_shell
61
62 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_COMMAND_BUFFER_GL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698