Merge "Add debug information." into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
84187bc62f
@@ -33,6 +33,9 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController.StateList
|
||||
import com.android.systemui.statusbar.StatusBarState;
|
||||
import com.android.systemui.statusbar.phone.DozeParameters;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
* Default built-in wallpaper that simply shows a static image.
|
||||
*/
|
||||
@@ -217,5 +220,33 @@ public class ImageWallpaper extends WallpaperService {
|
||||
return mNeedTransition && mController != null
|
||||
&& mController.getState() == StatusBarState.KEYGUARD;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dump(String prefix, FileDescriptor fd, PrintWriter out, String[] args) {
|
||||
super.dump(prefix, fd, out, args);
|
||||
out.print(prefix); out.print("Engine="); out.println(this);
|
||||
|
||||
boolean isHighEndGfx = ActivityManager.isHighEndGfx();
|
||||
out.print(prefix); out.print("isHighEndGfx="); out.println(isHighEndGfx);
|
||||
|
||||
DozeParameters dozeParameters = DozeParameters.getInstance(getApplicationContext());
|
||||
out.print(prefix); out.print("displayNeedsBlanking=");
|
||||
out.println(dozeParameters != null ? dozeParameters.getDisplayNeedsBlanking() : "null");
|
||||
|
||||
out.print(prefix); out.print("mNeedTransition="); out.println(mNeedTransition);
|
||||
out.print(prefix); out.print("StatusBarState=");
|
||||
out.println(mController != null ? mController.getState() : "null");
|
||||
|
||||
out.print(prefix); out.print("valid surface=");
|
||||
out.println(getSurfaceHolder() != null && getSurfaceHolder().getSurface() != null
|
||||
? getSurfaceHolder().getSurface().isValid()
|
||||
: "null");
|
||||
|
||||
out.print(prefix); out.print("surface frame=");
|
||||
out.println(getSurfaceHolder() != null ? getSurfaceHolder().getSurfaceFrame() : "null");
|
||||
|
||||
mEglHelper.dump(prefix, fd, out, args);
|
||||
mRenderer.dump(prefix, fd, out, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,9 @@ import android.opengl.GLUtils;
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceHolder;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
* A helper class to handle EGL management.
|
||||
*/
|
||||
@@ -62,6 +65,8 @@ public class EglHelper {
|
||||
private EGLConfig mEglConfig;
|
||||
private EGLContext mEglContext;
|
||||
private EGLSurface mEglSurface;
|
||||
private final int[] mEglVersion = new int[2];
|
||||
private boolean mEglReady;
|
||||
|
||||
/**
|
||||
* Initialize EGL and prepare EglSurface.
|
||||
@@ -75,7 +80,8 @@ public class EglHelper {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!eglInitialize(mEglDisplay, null, 0, null, 0)) {
|
||||
if (!eglInitialize(mEglDisplay, mEglVersion, 0 /* majorOffset */,
|
||||
mEglVersion, 1 /* minorOffset */)) {
|
||||
Log.w(TAG, "eglInitialize failed: " + GLUtils.getEGLErrorString(eglGetError()));
|
||||
return false;
|
||||
}
|
||||
@@ -96,6 +102,7 @@ public class EglHelper {
|
||||
return false;
|
||||
}
|
||||
|
||||
mEglReady = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -225,6 +232,30 @@ public class EglHelper {
|
||||
destroyEglContext();
|
||||
}
|
||||
eglTerminate(mEglDisplay);
|
||||
mEglReady = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to dump current state.
|
||||
* @param prefix prefix.
|
||||
* @param fd fd.
|
||||
* @param out out.
|
||||
* @param args args.
|
||||
*/
|
||||
public void dump(String prefix, FileDescriptor fd, PrintWriter out, String[] args) {
|
||||
String eglVersion = mEglVersion[0] + "." + mEglVersion[1];
|
||||
out.print(prefix); out.print("EGL version="); out.print(eglVersion);
|
||||
out.print(", "); out.print("EGL ready="); out.print(mEglReady);
|
||||
out.print(", "); out.print("has EglContext="); out.print(hasEglContext());
|
||||
out.print(", "); out.print("has EglSurface="); out.println(hasEglSurface());
|
||||
|
||||
int[] configs = getConfig();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append('{');
|
||||
for (int egl : configs) {
|
||||
sb.append("0x").append(Integer.toHexString(egl)).append(",");
|
||||
}
|
||||
sb.setCharAt(sb.length() - 1, '}');
|
||||
out.print(prefix); out.print("EglConfig="); out.println(sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,9 @@ package com.android.systemui.glwallpaper;
|
||||
import android.util.Size;
|
||||
import android.view.SurfaceHolder;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
* A renderer which is responsible for making OpenGL calls to render a frame.
|
||||
*/
|
||||
@@ -58,6 +61,15 @@ public interface GLWallpaperRenderer {
|
||||
*/
|
||||
void finish();
|
||||
|
||||
/**
|
||||
* Called to dump current state.
|
||||
* @param prefix prefix.
|
||||
* @param fd fd.
|
||||
* @param out out.
|
||||
* @param args args.
|
||||
*/
|
||||
void dump(String prefix, FileDescriptor fd, PrintWriter out, String[] args);
|
||||
|
||||
/**
|
||||
* A proxy which owns surface holder.
|
||||
*/
|
||||
|
||||
@@ -32,6 +32,9 @@ import android.util.Size;
|
||||
|
||||
import com.android.systemui.R;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
* A GL renderer for image wallpaper.
|
||||
*/
|
||||
@@ -156,4 +159,11 @@ public class ImageWallpaperRenderer implements GLWallpaperRenderer,
|
||||
public void onRevealEnd() {
|
||||
mProxy.postRender();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dump(String prefix, FileDescriptor fd, PrintWriter out, String[] args) {
|
||||
out.print(prefix); out.print("mProxy="); out.print(mProxy);
|
||||
out.print(prefix); out.print("mSurfaceSize="); out.print(mSurfaceSize);
|
||||
out.print(prefix); out.print("threshold="); out.print(mImageProcessHelper.getThreshold());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user