| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/macros.h" |
| 12 #include "content/public/browser/android/compositor_client.h" |
| 13 |
| 14 namespace cc { |
| 15 class Layer; |
| 16 } |
| 17 |
| 18 namespace content { |
| 19 class Compositor; |
| 20 class ContentViewCore; |
| 21 } |
| 22 |
| 23 namespace ui { |
| 24 class WindowAndroid; |
| 25 } |
| 26 |
| 27 namespace vr_shell { |
| 28 |
| 29 class VrCompositor : public content::CompositorClient { |
| 30 public: |
| 31 explicit VrCompositor(ui::WindowAndroid* window); |
| 32 ~VrCompositor() override; |
| 33 |
| 34 void SurfaceDestroyed(); |
| 35 void SurfaceChanged(int width, |
| 36 int height, |
| 37 const base::android::JavaParamRef<jobject>& surface); |
| 38 void SetLayer(content::ContentViewCore* core); |
| 39 |
| 40 // CompositorClient implementation: |
| 41 void UpdateLayerTreeHost() override; |
| 42 void OnSwapBuffersCompleted(int pending_swap_buffers) override; |
| 43 |
| 44 private: |
| 45 std::unique_ptr<content::Compositor> compositor_; |
| 46 |
| 47 cc::Layer* layer_ = nullptr; |
| 48 cc::Layer* layer_parent_ = nullptr; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(VrCompositor); |
| 51 }; |
| 52 |
| 53 } // namespace vr_shell |
| 54 |
| 55 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_ |
| OLD | NEW |