Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3055353f authored by Jason Sams's avatar Jason Sams Committed by Android (Google) Code Review
Browse files

Merge "Fix defered type creation when loading from A3D."

parents 08009f14 452a7661
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -155,6 +155,18 @@ public class Allocation extends BaseObj {
        }
    }

    private void updateCacheInfo(Type t) {
        mCurrentDimX = t.getX();
        mCurrentDimY = t.getY();
        mCurrentDimZ = t.getZ();
        mCurrentCount = mCurrentDimX;
        if (mCurrentDimY > 1) {
            mCurrentCount *= mCurrentDimY;
        }
        if (mCurrentDimZ > 1) {
            mCurrentCount *= mCurrentDimZ;
        }
    }

    Allocation(int id, RenderScript rs, Type t, int usage) {
        super(id, rs);
@@ -167,15 +179,8 @@ public class Allocation extends BaseObj {
        }
        mType = t;

        mCurrentDimX = t.getX();
        mCurrentDimY = t.getY();
        mCurrentDimZ = t.getZ();
        mCurrentCount = mCurrentDimX;
        if (mCurrentDimY > 1) {
            mCurrentCount *= mCurrentDimY;
        }
        if (mCurrentDimZ > 1) {
            mCurrentCount *= mCurrentDimZ;
        if (t != null) {
            updateCacheInfo(t);
        }
    }

@@ -785,6 +790,7 @@ public class Allocation extends BaseObj {
        int typeID = mRS.nAllocationGetType(getID());
        mType = new Type(typeID, mRS);
        mType.updateFromNative();
        updateCacheInfo(mType);
    }

    /*