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

Unified Diff: chrome/browser/android/vr_shell/vr_compositor.h

Issue 2319863005: Implement new compositor and ContentViewCore reparenting for VR Shell. (Closed)
Patch Set: Rebase onto ToT Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/BUILD.gn ('k') | chrome/browser/android/vr_shell/vr_compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_compositor.h
diff --git a/chrome/browser/android/vr_shell/vr_compositor.h b/chrome/browser/android/vr_shell/vr_compositor.h
new file mode 100644
index 0000000000000000000000000000000000000000..76d32c60e91af9bec0d419b3a6dfeb2d83c7a8bb
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_compositor.h
@@ -0,0 +1,55 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_
+#define CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_
+
+#include <memory>
+
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "content/public/browser/android/compositor_client.h"
+
+namespace cc {
+class Layer;
+}
+
+namespace content {
+class Compositor;
+class ContentViewCore;
+}
+
+namespace ui {
+class WindowAndroid;
+}
+
+namespace vr_shell {
+
+class VrCompositor : public content::CompositorClient {
+ public:
+ explicit VrCompositor(ui::WindowAndroid* window);
+ ~VrCompositor() override;
+
+ void SurfaceDestroyed();
+ void SurfaceChanged(int width,
+ int height,
+ const base::android::JavaParamRef<jobject>& surface);
+ void SetLayer(content::ContentViewCore* core);
+
+ // CompositorClient implementation:
+ void UpdateLayerTreeHost() override;
+ void OnSwapBuffersCompleted(int pending_swap_buffers) override;
+
+ private:
+ std::unique_ptr<content::Compositor> compositor_;
+
+ cc::Layer* layer_ = nullptr;
+ cc::Layer* layer_parent_ = nullptr;
+
+ DISALLOW_COPY_AND_ASSIGN(VrCompositor);
+};
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_COMPOSITOR_H_
« no previous file with comments | « chrome/browser/android/vr_shell/BUILD.gn ('k') | chrome/browser/android/vr_shell/vr_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698