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

Commit 3f5175fc authored by John Reck's avatar John Reck
Browse files

resolved conflicts for merge of c7e6b93a to master

Change-Id: I4b791f37193727a0306214645f2f98cdf218cad0
parents 37a6ad97 c7e6b93a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -492,7 +492,9 @@ void PathCache::precache(const SkPath* path, const SkPaint* paint) {
        if (mProcessor == nullptr) {
            mProcessor = new PathProcessor(Caches::getInstance());
        }
        mProcessor->add(task);
        if (!mProcessor->add(task)) {
            mProcessor->process(task);
        }
    }
}

+6 −2
Original line number Diff line number Diff line
@@ -385,7 +385,9 @@ void TessellationCache::precacheShadows(const Matrix4* drawTransform, const Rect
    if (mShadowProcessor == nullptr) {
        mShadowProcessor = new ShadowProcessor(Caches::getInstance());
    }
    mShadowProcessor->add(task);
    if (!mShadowProcessor->add(task)) {
        mShadowProcessor->process(task);
    }

    task->incStrong(nullptr); // not using sp<>s, so manually ref while in the cache
    mShadowCache.put(key, task.get());
@@ -421,7 +423,9 @@ TessellationCache::Buffer* TessellationCache::getOrCreateBuffer(
        if (mProcessor == nullptr) {
            mProcessor = new TessellationProcessor(Caches::getInstance());
        }
        mProcessor->add(task);
        if (!mProcessor->add(task)) {
            mProcessor->process(task);
        }
        mCache.put(entry, buffer);
    }
    return buffer;
+2 −4
Original line number Diff line number Diff line
@@ -105,6 +105,8 @@ bool TaskManager::WorkerThread::threadLoop() {
bool TaskManager::WorkerThread::addTask(TaskWrapper task) {
    if (!isRunning()) {
        run(mName.string(), PRIORITY_DEFAULT);
    } else if (exitPending()) {
        return false;
    }

    Mutex::Autolock l(mLock);
@@ -120,10 +122,6 @@ size_t TaskManager::WorkerThread::getTaskCount() const {
}

void TaskManager::WorkerThread::exit() {
    {
        Mutex::Autolock l(mLock);
        mTasks.clear();
    }
    requestExit();
    mSignal.signal();
}
+2 −6
Original line number Diff line number Diff line
@@ -30,9 +30,6 @@ public:
    TaskProcessorBase() { }
    virtual ~TaskProcessorBase() { };

private:
    friend class TaskManager;

    virtual void process(const sp<TaskBase>& task) = 0;
};

@@ -44,9 +41,6 @@ public:

    bool add(const sp<Task<T> >& task);

    virtual void onProcess(const sp<Task<T> >& task) = 0;

private:
    virtual void process(const sp<TaskBase>& task) override {
        sp<Task<T> > realTask = static_cast<Task<T>* >(task.get());
        // This is the right way to do it but sp<> doesn't play nice
@@ -54,6 +48,8 @@ private:
        onProcess(realTask);
    }

    virtual void onProcess(const sp<Task<T> >& task) = 0;

    TaskManager* mManager;
};