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

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

Issue 2969153002: vr/gpu: BrowserGpuChannelHostFactory should be called on the same thread. (Closed)
Patch Set: comment Created 3 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/mailbox_to_surface_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_MAILBOX_TO_SURFACE_BRIDGE_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_MAILBOX_TO_SURFACE_BRIDGE_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_MAILBOX_TO_SURFACE_BRIDGE_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_MAILBOX_TO_SURFACE_BRIDGE_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 9
10 namespace gl { 10 namespace gl {
11 class ScopedJavaSurface;
11 class SurfaceTexture; 12 class SurfaceTexture;
12 } 13 }
13 14
14 namespace gpu { 15 namespace gpu {
15 struct MailboxHolder; 16 struct MailboxHolder;
16 namespace gles2 { 17 namespace gles2 {
17 class GLES2Interface; 18 class GLES2Interface;
18 } 19 }
19 } 20 }
20 21
(...skipping 11 matching lines...) Expand all
32 void CreateSurface(gl::SurfaceTexture*); 33 void CreateSurface(gl::SurfaceTexture*);
33 34
34 void ResizeSurface(int width, int height); 35 void ResizeSurface(int width, int height);
35 36
36 // Returns true if swapped successfully. This can fail if the GL 37 // Returns true if swapped successfully. This can fail if the GL
37 // context isn't ready for use yet, in that case the caller 38 // context isn't ready for use yet, in that case the caller
38 // won't get a new frame on the SurfaceTexture. 39 // won't get a new frame on the SurfaceTexture.
39 bool CopyMailboxToSurfaceAndSwap(const gpu::MailboxHolder& mailbox); 40 bool CopyMailboxToSurfaceAndSwap(const gpu::MailboxHolder& mailbox);
40 41
41 private: 42 private:
42 void OnContextAvailable(scoped_refptr<cc::ContextProvider>); 43 void OnContextAvailable(std::unique_ptr<gl::ScopedJavaSurface> surface,
44 scoped_refptr<cc::ContextProvider>);
43 void InitializeRenderer(); 45 void InitializeRenderer();
44 void DestroyContext(); 46 void DestroyContext();
45 void DrawQuad(unsigned int textureHandle); 47 void DrawQuad(unsigned int textureHandle);
46 48
47 scoped_refptr<cc::ContextProvider> context_provider_; 49 scoped_refptr<cc::ContextProvider> context_provider_;
48 gpu::gles2::GLES2Interface* gl_ = nullptr; 50 gpu::gles2::GLES2Interface* gl_ = nullptr;
49 int surface_handle_ = 0; 51 int surface_handle_ = 0;
50 52
51 // Saved state for a pending resize, the dimensions are only 53 // Saved state for a pending resize, the dimensions are only
52 // valid if needs_resize_ is true. 54 // valid if needs_resize_ is true.
53 bool needs_resize_ = false; 55 bool needs_resize_ = false;
54 int resize_width_; 56 int resize_width_;
55 int resize_height_; 57 int resize_height_;
56 58
57 // Must be last. 59 // Must be last.
58 base::WeakPtrFactory<MailboxToSurfaceBridge> weak_ptr_factory_; 60 base::WeakPtrFactory<MailboxToSurfaceBridge> weak_ptr_factory_;
59 }; 61 };
60 62
61 } // namespace vr_shell 63 } // namespace vr_shell
62 64
63 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_MAILBOX_TO_SURFACE_BRIDGE_H_ 65 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_MAILBOX_TO_SURFACE_BRIDGE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/mailbox_to_surface_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698