use of android.view.WindowManager.LayoutParams in project android_frameworks_base by crdroidandroid.
the class WindowStateAnimator method tryChangeFormatInPlaceLocked.
/**
* Try to change the pixel format without recreating the surface. This
* will be common in the case of changing from PixelFormat.OPAQUE to
* PixelFormat.TRANSLUCENT in the hardware-accelerated case as both
* requested formats resolve to the same underlying SurfaceControl format
* @return True if format was succesfully changed, false otherwise
*/
boolean tryChangeFormatInPlaceLocked() {
if (mSurfaceController == null) {
return false;
}
final LayoutParams attrs = mWin.getAttrs();
final boolean isHwAccelerated = (attrs.flags & FLAG_HARDWARE_ACCELERATED) != 0;
final int format = isHwAccelerated ? PixelFormat.TRANSLUCENT : attrs.format;
if (format == mSurfaceFormat) {
setOpaqueLocked(!PixelFormat.formatHasAlpha(attrs.format));
return true;
}
return false;
}
Aggregations