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

Unified Diff: sky/shell/apk/src/org/domokit/sky/shell/SkyView.java

Issue 936883002: Connect Sky and Ganesh in SkyShell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address review comments Created 5 years, 10 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 | « sky/shell/apk/src/org/domokit/sky/shell/SkyShellApplication.java ('k') | sky/shell/gpu/ganesh_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/apk/src/org/domokit/sky/shell/SkyView.java
diff --git a/sky/shell/apk/src/org/domokit/sky/shell/SkyView.java b/sky/shell/apk/src/org/domokit/sky/shell/SkyView.java
deleted file mode 100644
index 2f82e638ccb570f039463c0e3e47195e957f28fe..0000000000000000000000000000000000000000
--- a/sky/shell/apk/src/org/domokit/sky/shell/SkyView.java
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2013 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.
-
-package org.domokit.sky.shell;
-
-import android.app.Activity;
-import android.content.Context;
-import android.view.Surface;
-import android.view.SurfaceHolder;
-import android.view.SurfaceView;
-import android.view.View;
-
-import org.chromium.base.CalledByNative;
-import org.chromium.base.JNINamespace;
-
-/**
- * A view containing Sky
- */
-@JNINamespace("sky::shell")
-public class SkyView extends SurfaceView {
- private long mNativeSkyView;
- private final SurfaceHolder.Callback mSurfaceCallback;
-
- @SuppressWarnings("unused")
- @CalledByNative
- public static void createForActivity(Activity activity, long nativeSkyView) {
- activity.setContentView(new SkyView(activity, nativeSkyView));
- }
-
- public SkyView(Context context, long nativeSkyView) {
- super(context);
-
- setFocusable(true);
- setFocusableInTouchMode(true);
-
- mNativeSkyView = nativeSkyView;
- assert mNativeSkyView != 0;
-
- final float density = context.getResources().getDisplayMetrics().density;
-
- mSurfaceCallback = new SurfaceHolder.Callback() {
- @Override
- public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
- assert mNativeSkyView != 0;
- nativeSurfaceSetSize(mNativeSkyView, width, height, density);
- }
-
- @Override
- public void surfaceCreated(SurfaceHolder holder) {
- assert mNativeSkyView != 0;
- nativeSurfaceCreated(mNativeSkyView, holder.getSurface());
- }
-
- @Override
- public void surfaceDestroyed(SurfaceHolder holder) {
- assert mNativeSkyView != 0;
- nativeSurfaceDestroyed(mNativeSkyView);
- }
- };
- getHolder().addCallback(mSurfaceCallback);
- }
-
- public void destroy() {
- getHolder().removeCallback(mSurfaceCallback);
- nativeDestroy(mNativeSkyView);
- mNativeSkyView = 0;
- }
-
- @Override
- protected void onWindowVisibilityChanged(int visibility) {
- super.onWindowVisibilityChanged(visibility);
- if (visibility == View.VISIBLE) {
- requestFocusFromTouch();
- requestFocus();
- }
- }
-
- private static native void nativeDestroy(long nativeSkyView);
- private static native void nativeSurfaceCreated(long nativeSkyView, Surface surface);
- private static native void nativeSurfaceDestroyed(long nativeSkyView);
- private static native void nativeSurfaceSetSize(
- long nativeSkyView, int width, int height, float density);
-}
« no previous file with comments | « sky/shell/apk/src/org/domokit/sky/shell/SkyShellApplication.java ('k') | sky/shell/gpu/ganesh_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698