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

Unified Diff: platform_tools/android/visualbench/src/com/skia/VisualBenchActivity.java

Issue 1164403002: Visual bench on native android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 5 years, 6 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: platform_tools/android/visualbench/src/com/skia/VisualBenchActivity.java
diff --git a/platform_tools/android/visualbench/src/com/skia/VisualBenchActivity.java b/platform_tools/android/visualbench/src/com/skia/VisualBenchActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..c7203b4bed317cf7312f646eab8b2c9fa82919c1
--- /dev/null
+++ b/platform_tools/android/visualbench/src/com/skia/VisualBenchActivity.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+package com.skia;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.util.Log;
+import android.view.View;
+import android.view.WindowManager;
+
+public class VisualBenchActivity extends android.app.NativeActivity {
+ static {
+ System.loadLibrary("skia_android");
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ getIntent().putExtra("hmm", "woah");
djsollen 2015/06/11 20:32:00 hmm?
joshualitt 2015/06/12 15:40:36 Acknowledged.
+ super.onCreate(savedInstanceState);
+ }
+
+ @Override
+ public void onWindowFocusChanged(boolean hasFocus) {
+ super.onWindowFocusChanged(hasFocus);
+ if (!hasFocus) {
+ return;
+ }
+ getWindow().getDecorView().setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide nav bar
+ View.SYSTEM_UI_FLAG_FULLSCREEN |// hide status bar
+ View.SYSTEM_UI_FLAG_IMMERSIVE);
+
+ // Disable backlight to keep the system as cool as possible
+ // TODO make this configurable
+ Settings.System.putInt(getContentResolver(),
+ Settings.System.SCREEN_BRIGHTNESS_MODE,
+ Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
+
+ WindowManager.LayoutParams lp = getWindow().getAttributes();
+ lp.screenBrightness = 0; // 0f - no backlight
+ getWindow().setAttributes(lp);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698