Index: blimp/client/compositor/blimp_compositor_android.h |
diff --git a/blimp/client/compositor/blimp_compositor_android.h b/blimp/client/compositor/blimp_compositor_android.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1f7ca31dd57898ed4447c775b15e9054586aa3f5 |
--- /dev/null |
+++ b/blimp/client/compositor/blimp_compositor_android.h |
@@ -0,0 +1,60 @@ |
+// Copyright 2015 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 BLIMP_CLIENT_ANDROID_COMPOSITOR_BLIMP_COMPOSITOR_ANDROID_H_ |
+#define BLIMP_CLIENT_ANDROID_COMPOSITOR_BLIMP_COMPOSITOR_ANDROID_H_ |
+ |
+#include "base/android/jni_android.h" |
+#include "base/macros.h" |
+#include "blimp/client/compositor/blimp_compositor.h" |
+#include "ui/gfx/geometry/size.h" |
+#include "ui/gfx/native_widget_types.h" |
+ |
+namespace base { |
+class SingleThreadTaskRunner; |
+class Thread; |
+} |
+ |
+namespace cc { |
+class LayerTreeHost; |
+} |
+ |
+namespace blimp { |
+ |
+// An Android specific version of the BlimpCompositor. This class builds a |
+// gfx::AcceleratedWidget out of an Android SurfaceView's surface. |
+class BlimpCompositorAndroid : public BlimpCompositor { |
+ public: |
+ static scoped_ptr<BlimpCompositorAndroid> Create( |
+ const gfx::Size& physical_size, |
+ const gfx::Size& display_size, |
+ float device_scale_factor); |
+ |
+ ~BlimpCompositorAndroid() override; |
+ |
+ void SetSurface(JNIEnv* env, jobject jsurface); |
+ |
+ protected: |
+ BlimpCompositorAndroid(const gfx::Size& device_size, |
+ bool real_size_supported, |
+ float device_scale_factor); |
+ |
+ // BlimpCompositor Implementation -------------------------------------------- |
+ gfx::AcceleratedWidget GetWindow() override; |
+ void GenerateLayerTreeSettings(cc::LayerTreeSettings& settings, |
+ const base::CommandLine& cmd) override; |
+ |
+ private: |
+ int portrait_width_; |
+ int landscape_width_; |
+ bool real_size_supported_; |
+ |
+ gfx::AcceleratedWidget window_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BlimpCompositorAndroid); |
+}; |
+ |
+} // namespace blimp |
+ |
+#endif // BLIMP_CLIENT_ANDROID_COMPOSITOR_BLIMP_COMPOSITOR_ANDROID_H_ |