Futile attempts to make rendering faster
This commit is contained in:
@@ -896,6 +896,14 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
||||
/*
|
||||
* Create an EGL surface we can render into.
|
||||
*/
|
||||
/*
|
||||
// This does not have any effect on Galaxy Note
|
||||
int [] attribList = new int[4];
|
||||
attribList[0] = mEgl.EGL_RENDER_BUFFER;
|
||||
attribList[1] = mEgl.EGL_SINGLE_BUFFER;
|
||||
attribList[2] = mEgl.EGL_NONE;
|
||||
attribList[3] = mEgl.EGL_NONE;
|
||||
*/
|
||||
mEglSurface = mEgl.eglCreateWindowSurface(mEglDisplay,
|
||||
mEglConfig, holder, null);
|
||||
|
||||
|
||||
@@ -294,8 +294,10 @@ public class MainActivity extends Activity
|
||||
_tv = null;
|
||||
_inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
_videoLayout = new FrameLayout(this);
|
||||
SetLayerType.get().setLayerType(_videoLayout);
|
||||
setContentView(_videoLayout);
|
||||
mGLView = new DemoGLSurfaceView(this);
|
||||
SetLayerType.get().setLayerType(mGLView);
|
||||
_videoLayout.addView(mGLView);
|
||||
mGLView.setFocusableInTouchMode(true);
|
||||
mGLView.setFocusable(true);
|
||||
@@ -1053,3 +1055,38 @@ abstract class DimSystemStatusBar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
abstract class SetLayerType
|
||||
{
|
||||
public static SetLayerType get()
|
||||
{
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB)
|
||||
return SetLayerTypeHoneycomb.Holder.sInstance;
|
||||
else
|
||||
return SetLayerTypeDummy.Holder.sInstance;
|
||||
}
|
||||
public abstract void setLayerType(final View view);
|
||||
|
||||
private static class SetLayerTypeHoneycomb extends SetLayerType
|
||||
{
|
||||
private static class Holder
|
||||
{
|
||||
private static final SetLayerTypeHoneycomb sInstance = new SetLayerTypeHoneycomb();
|
||||
}
|
||||
public void setLayerType(final View view)
|
||||
{
|
||||
view.setLayerType(android.view.View.LAYER_TYPE_NONE, null);
|
||||
//view.setLayerType(android.view.View.LAYER_TYPE_HARDWARE, null);
|
||||
}
|
||||
}
|
||||
private static class SetLayerTypeDummy extends SetLayerType
|
||||
{
|
||||
private static class Holder
|
||||
{
|
||||
private static final SetLayerTypeDummy sInstance = new SetLayerTypeDummy();
|
||||
}
|
||||
public void setLayerType(final View view)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user