use of android.view.SurfaceSession in project android_frameworks_base by ParanoidAndroid.
the class Session method windowAddedLocked.
void windowAddedLocked() {
if (mSurfaceSession == null) {
if (WindowManagerService.localLOGV)
Slog.v(WindowManagerService.TAG, "First window added to " + this + ", creating SurfaceSession");
mSurfaceSession = new SurfaceSession();
if (WindowManagerService.SHOW_TRANSACTIONS)
Slog.i(WindowManagerService.TAG, " NEW SURFACE SESSION " + mSurfaceSession);
mService.mSessions.add(this);
}
mNumWindow++;
}
use of android.view.SurfaceSession in project android_frameworks_base by ParanoidAndroid.
the class ElectronBeam method createSurface.
/* not used because it is too expensive to create / destroy contexts all of the time
private void destroyEglContext() {
if (mEglContext != null) {
if (!EGL14.eglDestroyContext(mEglDisplay, mEglContext)) {
logEglError("eglDestroyContext");
}
mEglContext = null;
}
}*/
private boolean createSurface() {
if (mSurfaceSession == null) {
mSurfaceSession = new SurfaceSession();
}
SurfaceControl.openTransaction();
try {
if (mSurfaceControl == null) {
try {
int flags;
if (mMode == MODE_FADE) {
flags = SurfaceControl.FX_SURFACE_DIM | SurfaceControl.HIDDEN;
} else {
flags = SurfaceControl.OPAQUE | SurfaceControl.HIDDEN;
}
mSurfaceControl = new SurfaceControl(mSurfaceSession, "ElectronBeam", mDisplayWidth, mDisplayHeight, PixelFormat.OPAQUE, flags);
} catch (SurfaceControl.OutOfResourcesException ex) {
Slog.e(TAG, "Unable to create surface.", ex);
return false;
}
}
mSurfaceControl.setLayerStack(mDisplayLayerStack);
mSurfaceControl.setSize(mDisplayWidth, mDisplayHeight);
mSurface = new Surface();
mSurface.copyFrom(mSurfaceControl);
mSurfaceLayout = new NaturalSurfaceLayout(mDisplayManager, mSurfaceControl);
mSurfaceLayout.onDisplayTransaction();
} finally {
SurfaceControl.closeTransaction();
}
return true;
}
use of android.view.SurfaceSession in project android_frameworks_base by AOSPA.
the class ColorFade method createSurface.
private boolean createSurface() {
if (mSurfaceSession == null) {
mSurfaceSession = new SurfaceSession();
}
SurfaceControl.openTransaction();
try {
if (mSurfaceControl == null) {
try {
int flags;
if (mMode == MODE_FADE) {
flags = SurfaceControl.FX_SURFACE_DIM | SurfaceControl.HIDDEN;
} else {
flags = SurfaceControl.OPAQUE | SurfaceControl.HIDDEN;
}
mSurfaceControl = new SurfaceControl(mSurfaceSession, "ColorFade", mDisplayWidth, mDisplayHeight, PixelFormat.OPAQUE, flags);
} catch (OutOfResourcesException ex) {
Slog.e(TAG, "Unable to create surface.", ex);
return false;
}
mSurfaceControl.setLayerStack(mDisplayLayerStack);
mSurfaceControl.setSize(mDisplayWidth, mDisplayHeight);
mSurface = new Surface();
mSurface.copyFrom(mSurfaceControl);
mSurfaceLayout = new NaturalSurfaceLayout(mDisplayManagerInternal, mDisplayId, mSurfaceControl);
mSurfaceLayout.onDisplayTransaction();
}
} finally {
SurfaceControl.closeTransaction();
}
return true;
}
use of android.view.SurfaceSession in project android_frameworks_base by DirtyUnicorns.
the class ColorFade method createSurface.
private boolean createSurface() {
if (mSurfaceSession == null) {
mSurfaceSession = new SurfaceSession();
}
SurfaceControl.openTransaction();
try {
if (mSurfaceControl == null) {
try {
int flags;
if (mMode == MODE_FADE) {
flags = SurfaceControl.FX_SURFACE_DIM | SurfaceControl.HIDDEN;
} else {
flags = SurfaceControl.OPAQUE | SurfaceControl.HIDDEN;
}
mSurfaceControl = new SurfaceControl(mSurfaceSession, "ColorFade", mDisplayWidth, mDisplayHeight, PixelFormat.OPAQUE, flags);
} catch (OutOfResourcesException ex) {
Slog.e(TAG, "Unable to create surface.", ex);
return false;
}
mSurfaceControl.setLayerStack(mDisplayLayerStack);
mSurfaceControl.setSize(mDisplayWidth, mDisplayHeight);
mSurface = new Surface();
mSurface.copyFrom(mSurfaceControl);
mSurfaceLayout = new NaturalSurfaceLayout(mDisplayManagerInternal, mDisplayId, mSurfaceControl);
mSurfaceLayout.onDisplayTransaction();
}
} finally {
SurfaceControl.closeTransaction();
}
return true;
}
use of android.view.SurfaceSession in project android_frameworks_base by ResurrectionRemix.
the class ColorFade method createSurface.
private boolean createSurface() {
if (mSurfaceSession == null) {
mSurfaceSession = new SurfaceSession();
}
SurfaceControl.openTransaction();
try {
if (mSurfaceControl == null) {
try {
int flags;
if (mMode == MODE_FADE) {
flags = SurfaceControl.FX_SURFACE_DIM | SurfaceControl.HIDDEN;
} else {
flags = SurfaceControl.OPAQUE | SurfaceControl.HIDDEN;
}
mSurfaceControl = new SurfaceControl(mSurfaceSession, "ColorFade", mDisplayWidth, mDisplayHeight, PixelFormat.OPAQUE, flags);
} catch (OutOfResourcesException ex) {
Slog.e(TAG, "Unable to create surface.", ex);
return false;
}
mSurfaceControl.setLayerStack(mDisplayLayerStack);
mSurfaceControl.setSize(mDisplayWidth, mDisplayHeight);
mSurface = new Surface();
mSurface.copyFrom(mSurfaceControl);
mSurfaceLayout = new NaturalSurfaceLayout(mDisplayManagerInternal, mDisplayId, mSurfaceControl);
mSurfaceLayout.onDisplayTransaction();
}
} finally {
SurfaceControl.closeTransaction();
}
return true;
}
Aggregations