OLD | NEW |
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 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 namespace vr_shell { | 29 namespace vr_shell { |
30 | 30 |
31 class VrCompositor : public content::CompositorClient { | 31 class VrCompositor : public content::CompositorClient { |
32 public: | 32 public: |
33 VrCompositor(ui::WindowAndroid* window, bool is_transparent); | 33 VrCompositor(ui::WindowAndroid* window, bool is_transparent); |
34 ~VrCompositor() override; | 34 ~VrCompositor() override; |
35 | 35 |
36 void SurfaceDestroyed(); | 36 void SurfaceDestroyed(); |
37 void SurfaceChanged(int width, | 37 void SetWindowBounds(int width, int height); |
38 int height, | 38 void SurfaceChanged(const base::android::JavaParamRef<jobject>& surface); |
39 const base::android::JavaParamRef<jobject>& surface); | |
40 void SetLayer(content::WebContents* web_contents); | 39 void SetLayer(content::WebContents* web_contents); |
41 | 40 |
42 // CompositorClient implementation: | 41 // CompositorClient implementation: |
43 void UpdateLayerTreeHost() override; | 42 void UpdateLayerTreeHost() override; |
44 void OnSwapBuffersCompleted(int pending_swap_buffers) override; | 43 void OnSwapBuffersCompleted(int pending_swap_buffers) override; |
45 | 44 |
46 private: | 45 private: |
47 std::unique_ptr<content::Compositor> compositor_; | 46 std::unique_ptr<content::Compositor> compositor_; |
48 | 47 |
49 cc::Layer* layer_ = nullptr; | 48 cc::Layer* layer_ = nullptr; |
50 cc::Layer* layer_parent_ = nullptr; | 49 cc::Layer* layer_parent_ = nullptr; |
51 SkColor background_color_; | 50 SkColor background_color_; |
52 bool transparent_; | 51 bool transparent_; |
53 | 52 |
54 DISALLOW_COPY_AND_ASSIGN(VrCompositor); | 53 DISALLOW_COPY_AND_ASSIGN(VrCompositor); |
55 }; | 54 }; |
56 | 55 |
57 } // namespace vr_shell | 56 } // namespace vr_shell |
58 | 57 |
59 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_ | 58 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_ |
OLD | NEW |