Search in sources :

Example 46 with LayoutParams

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;
}
Also used : LayoutParams(android.view.WindowManager.LayoutParams) Point(android.graphics.Point)

Aggregations

LayoutParams (android.view.WindowManager.LayoutParams)46 View (android.view.View)19 Point (android.graphics.Point)10 Rect (android.graphics.Rect)8 OnClickListener (android.view.View.OnClickListener)8 LayoutInflater (android.view.LayoutInflater)7 Transition (android.transition.Transition)5 TransitionListenerAdapter (android.transition.Transition.TransitionListenerAdapter)5 ViewGroup (android.view.ViewGroup)5 ViewParent (android.view.ViewParent)5 WindowManager (android.view.WindowManager)5 Window (android.view.Window)3 Canvas (android.graphics.Canvas)2 Surface (android.view.Surface)2 Animation (android.view.animation.Animation)2 TargetApi (android.annotation.TargetApi)1 Intent (android.content.Intent)1 Bitmap (android.graphics.Bitmap)1 EpicenterCallback (android.transition.Transition.EpicenterCallback)1 Display (android.view.Display)1