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