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

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

Issue 2658643003: Refactor GvrDelegate ownership into GvrDelegateProvider and fix more threading violations. (Closed)
Patch Set: Address comments Created 3 years, 10 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_VR_COMPOSITOR_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 18 matching lines...) Expand all
29 29
30 namespace vr_shell { 30 namespace vr_shell {
31 31
32 class VrCompositor : public content::CompositorClient { 32 class VrCompositor : public content::CompositorClient {
33 public: 33 public:
34 VrCompositor(ui::WindowAndroid* window, bool is_transparent); 34 VrCompositor(ui::WindowAndroid* window, bool is_transparent);
35 ~VrCompositor() override; 35 ~VrCompositor() override;
36 36
37 void SurfaceDestroyed(); 37 void SurfaceDestroyed();
38 void SetWindowBounds(gfx::Size size); 38 void SetWindowBounds(gfx::Size size);
39 gfx::Size GetWindowBounds() { return bounds_; }
40 void SurfaceChanged(jobject surface); 39 void SurfaceChanged(jobject surface);
41 void SetLayer(content::WebContents* web_contents); 40 void SetLayer(content::WebContents* web_contents);
42 41
43 // CompositorClient implementation: 42 // CompositorClient implementation:
44 void UpdateLayerTreeHost() override; 43 void UpdateLayerTreeHost() override;
45 void OnSwapBuffersCompleted(int pending_swap_buffers) override; 44 void OnSwapBuffersCompleted(int pending_swap_buffers) override;
46 45
47 private: 46 private:
48 void RestoreLayer(); 47 void RestoreLayer();
49 48
50 std::unique_ptr<content::Compositor> compositor_; 49 std::unique_ptr<content::Compositor> compositor_;
51 gfx::Size bounds_;
52 50
53 cc::Layer* layer_ = nullptr; 51 cc::Layer* layer_ = nullptr;
54 cc::Layer* layer_parent_ = nullptr; 52 cc::Layer* layer_parent_ = nullptr;
55 SkColor background_color_; 53 SkColor background_color_;
56 bool transparent_; 54 bool transparent_;
57 55
58 DISALLOW_COPY_AND_ASSIGN(VrCompositor); 56 DISALLOW_COPY_AND_ASSIGN(VrCompositor);
59 }; 57 };
60 58
61 } // namespace vr_shell 59 } // namespace vr_shell
62 60
63 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_ 61 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc ('k') | chrome/browser/android/vr_shell/vr_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698