package ῲ.㿎.K;

import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;

/* renamed from: ῲ.㿎.K.ῲ  reason: contains not printable characters */
/* compiled from: ViewGroupUtils */
public class C2297 {

    /* renamed from: ῲ  reason: contains not printable characters */
    public static final ThreadLocal<RectF> f7949 = new ThreadLocal<>();

    /* renamed from: K  reason: contains not printable characters */
    public static final ThreadLocal<Matrix> f7950 = new ThreadLocal<>();

    /* renamed from: K  reason: contains not printable characters */
    public static void m5991(ViewGroup viewGroup, View view, Rect rect) {
        rect.set(0, 0, view.getWidth(), view.getHeight());
        Matrix matrix = f7950.get();
        if (matrix == null) {
            matrix = new Matrix();
            f7950.set(matrix);
        } else {
            matrix.reset();
        }
        m5992(viewGroup, view, matrix);
        RectF rectF = f7949.get();
        if (rectF == null) {
            rectF = new RectF();
            f7949.set(rectF);
        }
        rectF.set(rect);
        matrix.mapRect(rectF);
        rect.set((int) (rectF.left + 0.5f), (int) (rectF.top + 0.5f), (int) (rectF.right + 0.5f), (int) (rectF.bottom + 0.5f));
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m5992(ViewParent viewParent, View view, Matrix matrix) {
        ViewParent parent = view.getParent();
        if ((parent instanceof View) && parent != viewParent) {
            View view2 = (View) parent;
            m5992(viewParent, view2, matrix);
            matrix.preTranslate((float) (-view2.getScrollX()), (float) (-view2.getScrollY()));
        }
        matrix.preTranslate((float) view.getLeft(), (float) view.getTop());
        if (!view.getMatrix().isIdentity()) {
            matrix.preConcat(view.getMatrix());
        }
    }
}
