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

Commit f7c51552 authored by Alex Sakhartchouk's avatar Alex Sakhartchouk Committed by Android (Google) Code Review
Browse files

Merge "Some cleanup"

parents e9ac4e25 98bfe5d0
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -45,7 +45,6 @@ public class FileA3D extends BaseObj {
        PROGRAM_STORE,
        PROGRAM_STORE,
        SAMPLER,
        SAMPLER,
        ANIMATION,
        ANIMATION,
        LIGHT,
        ADAPTER_1D,
        ADAPTER_1D,
        ADAPTER_2D,
        ADAPTER_2D,
        SCRIPT_C;
        SCRIPT_C;
@@ -118,8 +117,6 @@ public class FileA3D extends BaseObj {
                break;
                break;
            case ANIMATION:
            case ANIMATION:
                break;
                break;
            case LIGHT:
                break;
            case ADAPTER_1D:
            case ADAPTER_1D:
                break;
                break;
            case ADAPTER_2D:
            case ADAPTER_2D:
+0 −28
Original line number Original line Diff line number Diff line
@@ -824,34 +824,6 @@ RsAllocation rsi_AllocationCreateFromBitmap(Context *rsc, uint32_t w, uint32_t h
    return texAlloc;
    return texAlloc;
}
}


RsAllocation rsi_AllocationCreateFromBitmapBoxed(Context *rsc, uint32_t w, uint32_t h, RsElement _dst, RsElement _src, bool genMips, const void *data)
{
    const Element *srcE = static_cast<const Element *>(_src);
    const Element *dstE = static_cast<const Element *>(_dst);
    uint32_t w2 = rsHigherPow2(w);
    uint32_t h2 = rsHigherPow2(h);

    if ((w2 == w) && (h2 == h)) {
        return rsi_AllocationCreateFromBitmap(rsc, w, h, _dst, _src, genMips, data);
    }

    uint32_t bpp = srcE->getSizeBytes();
    size_t size = w2 * h2 * bpp;
    uint8_t *tmp = static_cast<uint8_t *>(malloc(size));
    memset(tmp, 0, size);

    const uint8_t * src = static_cast<const uint8_t *>(data);
    for (uint32_t y = 0; y < h; y++) {
        uint8_t * ydst = &tmp[(y + ((h2 - h) >> 1)) * w2 * bpp];
        memcpy(&ydst[((w2 - w) >> 1) * bpp], src, w * bpp);
        src += w * bpp;
    }

    RsAllocation ret = rsi_AllocationCreateFromBitmap(rsc, w2, h2, _dst, _src, genMips, tmp);
    free(tmp);
    return ret;
}

void rsi_AllocationData(Context *rsc, RsAllocation va, const void *data, uint32_t sizeBytes)
void rsi_AllocationData(Context *rsc, RsAllocation va, const void *data, uint32_t sizeBytes)
{
{
    Allocation *a = static_cast<Allocation *>(va);
    Allocation *a = static_cast<Allocation *>(va);
+1 −1
Original line number Original line Diff line number Diff line
@@ -348,7 +348,7 @@ void Context::timerPrint()




    if (props.mLogTimes) {
    if (props.mLogTimes) {
        LOGV("RS: Frame (%i),   Script %2.1f (%i),  Clear & Swap %2.1f (%i),  Idle %2.1f (%lli),  Internal %2.1f (%lli), Avg fps: %u",
        LOGV("RS: Frame (%i),   Script %2.1f%% (%i),  Swap %2.1f%% (%i),  Idle %2.1f%% (%lli),  Internal %2.1f%% (%lli), Avg fps: %u",
             mTimeMSLastFrame,
             mTimeMSLastFrame,
             100.0 * mTimers[RS_TIMER_SCRIPT] / total, mTimeMSLastScript,
             100.0 * mTimers[RS_TIMER_SCRIPT] / total, mTimeMSLastScript,
             100.0 * mTimers[RS_TIMER_CLEAR_SWAP] / total, mTimeMSLastSwap,
             100.0 * mTimers[RS_TIMER_CLEAR_SWAP] / total, mTimeMSLastSwap,
+1 −0
Original line number Original line Diff line number Diff line
@@ -72,6 +72,7 @@ public:
    //ScriptCState mScriptC;
    //ScriptCState mScriptC;
    ShaderCache mShaderCache;
    ShaderCache mShaderCache;


    RsSurfaceConfig mUserSurfaceConfig;


    //bool setupCheck();
    //bool setupCheck();
    bool checkDriver() const {return false;}
    bool checkDriver() const {return false;}
+4 −16
Original line number Original line Diff line number Diff line
@@ -609,22 +609,10 @@ void FontState::initVertexArrayBuffers()
    const Element *posElem = Element::create(mRSC, RS_TYPE_FLOAT_32, RS_KIND_USER, false, 3);
    const Element *posElem = Element::create(mRSC, RS_TYPE_FLOAT_32, RS_KIND_USER, false, 3);
    const Element *texElem = Element::create(mRSC, RS_TYPE_FLOAT_32, RS_KIND_USER, false, 2);
    const Element *texElem = Element::create(mRSC, RS_TYPE_FLOAT_32, RS_KIND_USER, false, 2);


    const Element *elemArray[2];
    mRSC->mStateElement.elementBuilderBegin();
    elemArray[0] = posElem;
    mRSC->mStateElement.elementBuilderAdd(posElem, "position", 1);
    elemArray[1] = texElem;
    mRSC->mStateElement.elementBuilderAdd(texElem, "texture0", 1);

    const Element *vertexDataElem = mRSC->mStateElement.elementBuilderCreate(mRSC);
    String8 posName("position");
    String8 texName("texture0");

    const char *nameArray[2];
    nameArray[0] = posName.string();
    nameArray[1] = texName.string();
    size_t lengths[2];
    lengths[0] = posName.size();
    lengths[1] = texName.size();
    uint32_t arraySizes[2] = {1, 1};

    const Element *vertexDataElem = Element::create(mRSC, 2, elemArray, nameArray, lengths, arraySizes);


    Type *vertexDataType = new Type(mRSC);
    Type *vertexDataType = new Type(mRSC);
    vertexDataType->setDimX(mMaxNumberOfQuads * 4);
    vertexDataType->setDimX(mMaxNumberOfQuads * 4);