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

Unified Diff: blimp/client/compositor/blimp_compositor_android.h

Issue 1295243003: Initial commit of the blimp/ folder and target (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some cleanup nits. Created 5 years, 4 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
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);
Wez 2015/08/27 02:01:52 nit: Comment to explain the parameters
David Trainor- moved to gerrit 2015/08/28 01:23:47 Done.
+
+ ~BlimpCompositorAndroid() override;
+
+ void SetSurface(JNIEnv* env, jobject jsurface);
Wez 2015/08/27 02:01:52 nit: Comment to explain e.g. ownership semantics f
David Trainor- moved to gerrit 2015/08/28 01:23:47 Done. I do jsurface because it's a Java object.
Wez 2015/09/03 00:49:27 Acknowledged.
+
+ protected:
+ BlimpCompositorAndroid(const gfx::Size& device_size,
+ bool real_size_supported,
+ float device_scale_factor);
Wez 2015/08/27 02:01:52 nit: Comment parameters?
David Trainor- moved to gerrit 2015/08/28 01:23:47 Done.
+
+ // 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_;
Wez 2015/08/27 02:01:52 nit: Comments on members' usage?
David Trainor- moved to gerrit 2015/08/28 01:23:47 Done.
+
+ gfx::AcceleratedWidget window_;
Wez 2015/08/27 02:01:52 nit: Initialize in-line?
David Trainor- moved to gerrit 2015/08/28 01:23:47 Still would prefer all constructor initialization,
Wez 2015/09/03 00:49:27 Acknowledged.
+
+ DISALLOW_COPY_AND_ASSIGN(BlimpCompositorAndroid);
+};
+
+} // namespace blimp
+
+#endif // BLIMP_CLIENT_ANDROID_COMPOSITOR_BLIMP_COMPOSITOR_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698