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

Unified Diff: sky/shell/sky_view.h

Issue 890803004: SkyShell should be able to draw a green square with GL (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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: sky/shell/sky_view.h
diff --git a/sky/shell/sky_view.h b/sky/shell/sky_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..300d926f591f52bc6dba29cb934611e3cc6a45b9
--- /dev/null
+++ b/sky/shell/sky_view.h
@@ -0,0 +1,59 @@
+// 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 SKY_SHELL_SKY_VIEW_H_
+#define SKY_SHELL_SKY_VIEW_H_
+
+#include "base/android/jni_weak_ref.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "ui/gfx/native_widget_types.h"
+
+struct ANativeWindow;
+
+namespace sky {
+namespace shell {
+
+class SkyView {
+ public:
+ static bool Register(JNIEnv* env);
+
+ class Delegate {
+ public:
+ virtual void OnAcceleratedWidgetAvailable(
+ gfx::AcceleratedWidget widget) = 0;
+ virtual void OnDestroyed() = 0;
+
+ protected:
+ virtual ~Delegate();
+ };
+
+ explicit SkyView(Delegate* delegate);
+ ~SkyView();
+
+ void Init();
+
+ // Called from Java
+ void Destroy(JNIEnv* env, jobject obj);
+ void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface);
+ void SurfaceDestroyed(JNIEnv* env, jobject obj);
+ void SurfaceSetSize(JNIEnv* env,
+ jobject obj,
+ jint width,
+ jint height,
+ jfloat density);
+
+ private:
+ void ReleaseWindow();
+
+ Delegate* delegate_;
+ ANativeWindow* window_;
+
+ DISALLOW_COPY_AND_ASSIGN(SkyView);
+};
+
+} // namespace shell
+} // namespace sky
+
+#endif // SKY_SHELL_SKY_VIEW_H_
« sky/shell/library_loader.cc ('K') | « sky/shell/sky_main.cc ('k') | sky/shell/sky_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698