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

Side by Side Diff: chrome/browser/android/vr_shell/mailbox_to_surface_bridge.h

Issue 2729523002: Re-land^2 WebVR compositor bypass via BrowserMain context + mailbox (Closed)
Patch Set: Update MailboxToSurfaceBridge to use new ContextProvider API 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_MAILBOX_TO_SURFACE_BRIDGE_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_MAILBOX_TO_SURFACE_BRIDGE_H_
7
8 #include "base/memory/weak_ptr.h"
9
10 namespace gl {
11 class SurfaceTexture;
12 }
13
14 namespace gpu {
15 struct MailboxHolder;
16 namespace gles2 {
17 class GLES2Interface;
18 }
19 }
20
21 namespace cc {
22 class ContextProvider;
23 }
24
25 namespace vr_shell {
26
27 class MailboxToSurfaceBridge {
28 public:
29 MailboxToSurfaceBridge();
30 ~MailboxToSurfaceBridge();
31
32 void CreateSurface(scoped_refptr<gl::SurfaceTexture>);
33
34 void ResizeSurface(int width, int height);
35
36 bool CopyFrameToSurface(int frame_index,
37 const gpu::MailboxHolder& mailbox,
38 bool discard);
39
40 private:
41 void OnContextAvailable(scoped_refptr<cc::ContextProvider>);
42
43 void InitializeRenderer();
44 void DrawQuad(unsigned int textureHandle);
45
46 scoped_refptr<cc::ContextProvider> context_provider_;
47 gpu::gles2::GLES2Interface* gl_ = nullptr;
48 int surface_handle_ = 0;
49 base::WeakPtrFactory<MailboxToSurfaceBridge> weak_ptr_factory_;
50 };
51
52 } // namespace vr_shell
53
54 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_MAILBOX_TO_SURFACE_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698