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

Commit bc948ded authored by Jason Sams's avatar Jason Sams
Browse files

Remove global IO context and integrate it into the RS context.

parent 334ea0c9
Loading
Loading
Loading
Loading
+109 −109

File changed.

Preview size limit exceeded, changes collapsed.

+5 −10
Original line number Diff line number Diff line
@@ -84,11 +84,6 @@ bool Context::runScript(Script *s, uint32_t launchID)

bool Context::runRootScript()
{
#if RS_LOG_TIMES
    struct timespec beginTime;
    clock_gettime(CLOCK_MONOTONIC, &beginTime);
#endif

    rsAssert(mRootScript->mEnviroment.mIsRoot);

    //glColor4f(1,1,1,1);
@@ -116,9 +111,10 @@ bool Context::runRootScript()
    struct timespec endTime;
    clock_gettime(CLOCK_MONOTONIC, &endTime);

    int t1 = ((unsigned long)startTime.tv_nsec - (unsigned long)beginTime.tv_nsec) / 1000 / 1000;
    int t2 = ((unsigned long)endTime.tv_nsec - (unsigned long)startTime.tv_nsec) / 1000 / 1000;
    LOGE("times  %i,  %i", t1, t2);
    uint64_t t1 = endTime.tv_nsec + ((uint64_t)endTime.tv_sec * 1000 * 1000 * 1000);
    uint64_t t2 = startTime.tv_nsec + ((uint64_t)startTime.tv_sec * 1000 * 1000 * 1000);
    int t3 = (int)((t1 - t2) / 1000 / 1000);
    LOGE("times  %i", t3);
#endif

    return ret;
@@ -143,7 +139,6 @@ void * Context::threadProc(void *vrsc)
{
     Context *rsc = static_cast<Context *>(vrsc);

     gIO = new ThreadIO();
     rsc->initEGL();

     ScriptTLSStruct *tlsStruct = new ScriptTLSStruct;
@@ -168,7 +163,7 @@ void * Context::threadProc(void *vrsc)
     rsc->mRunning = true;
     bool mDraw = true;
     while (!rsc->mExit) {
         mDraw |= gIO->playCoreCommands(rsc, !mDraw);
         mDraw |= rsc->mIO.playCoreCommands(rsc, !mDraw);
         mDraw &= (rsc->mRootScript.get() != NULL);

         if (mDraw) {
+4 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@

#include <ui/Surface.h>

#include "rsThreadIO.h"
#include "rsType.h"
#include "rsMatrix.h"
#include "rsAllocation.h"
@@ -115,6 +116,9 @@ public:
    uint32_t getWidth() const {return mWidth;}
    uint32_t getHeight() const {return mHeight;}


    ThreadIO mIO;

protected:
    Device *mDev;

+0 −2
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@
using namespace android;
using namespace android::renderscript;

ThreadIO *android::renderscript::gIO = NULL;

ThreadIO::ThreadIO()
{
    mToCore.init(16 * 1024);
+0 −3
Original line number Diff line number Diff line
@@ -43,9 +43,6 @@ public:

};

extern ThreadIO *gIO;



}
}
Loading