| 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_SIMPLE_COMPOSITOR_VIEW_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_SIMPLE_COMPOSITOR_VIEW_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 SimpleCompositorView : public content::CompositorClient { |
| 30 public: |
| 31 explicit SimpleCompositorView(ui::WindowAndroid* window); |
| 32 ~SimpleCompositorView() override; |
| 33 |
| 34 void SurfaceCreated(); |
| 35 void SurfaceDestroyed(); |
| 36 void SurfaceChanged(int format, |
| 37 int width, |
| 38 int height, |
| 39 const base::android::JavaParamRef<jobject>& surface); |
| 40 void SetLayer(content::ContentViewCore* core); |
| 41 |
| 42 // CompositorClient implementation: |
| 43 void UpdateLayerTreeHost() override; |
| 44 void OnSwapBuffersCompleted(int pending_swap_buffers) override; |
| 45 |
| 46 private: |
| 47 std::unique_ptr<content::Compositor> compositor_; |
| 48 |
| 49 int current_surface_format_; |
| 50 cc::Layer* layer_; |
| 51 cc::Layer* layer_parent_; |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(SimpleCompositorView); |
| 54 }; |
| 55 |
| 56 } // namespace vr_shell |
| 57 |
| 58 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_SIMPLE_COMPOSITOR_VIEW_H_ |
| OLD | NEW |