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

Commit 2b1847ea authored by Romain Guy's avatar Romain Guy
Browse files

Remove unused API

Change-Id: I1714fd82a64b752f0350ef4ef9179ce19e089c6a
parent d30b36d3
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
@@ -56,8 +56,6 @@ class GLES20Canvas extends HardwareCanvas {

    private DrawFilter mFilter;

    private boolean mContextLocked;

    ///////////////////////////////////////////////////////////////////////////
    // JNI
    ///////////////////////////////////////////////////////////////////////////
@@ -223,17 +221,6 @@ class GLES20Canvas extends HardwareCanvas {
    
    private static native void nFinish(int renderer);

    @Override
    public boolean acquireContext() {
        if (!mContextLocked) {
            nAcquireContext(mRenderer);
            mContextLocked = true;
        }
        return mContextLocked;
    }

    private static native void nAcquireContext(int renderer);

    @Override
    public boolean callDrawGLFunction(int drawGLFunction) {
        return nCallDrawGLFunction(mRenderer, drawGLFunction);
@@ -241,16 +228,6 @@ class GLES20Canvas extends HardwareCanvas {

    private static native boolean nCallDrawGLFunction(int renderer, int drawGLFunction);

    @Override
    public void releaseContext() {
        if (mContextLocked) {
            nReleaseContext(mRenderer);
            mContextLocked = false;
        }
    }

    private static native void nReleaseContext(int renderer);
    
    ///////////////////////////////////////////////////////////////////////////
    // Display list
    ///////////////////////////////////////////////////////////////////////////
+0 −12
Original line number Diff line number Diff line
@@ -137,21 +137,11 @@ static void android_view_GLES20Canvas_finish(JNIEnv* env, jobject clazz,
    renderer->finish();
}

static void android_view_GLES20Canvas_acquireContext(JNIEnv* env, jobject clazz,
        OpenGLRenderer* renderer) {
    renderer->acquireContext();
}

static bool android_view_GLES20Canvas_callDrawGLFunction(JNIEnv* env, jobject clazz,
        OpenGLRenderer* renderer, Functor *functor) {
    return renderer->callDrawGLFunction(functor);
}

static void android_view_GLES20Canvas_releaseContext(JNIEnv* env, jobject clazz,
        OpenGLRenderer* renderer) {
    renderer->releaseContext();
}

// ----------------------------------------------------------------------------
// State
// ----------------------------------------------------------------------------
@@ -609,8 +599,6 @@ static JNINativeMethod gMethods[] = {
    { "nPrepare",           "(IZ)V",           (void*) android_view_GLES20Canvas_prepare },
    { "nPrepareDirty",      "(IIIIIZ)V",       (void*) android_view_GLES20Canvas_prepareDirty },
    { "nFinish",            "(I)V",            (void*) android_view_GLES20Canvas_finish },
    { "nAcquireContext",    "(I)V",            (void*) android_view_GLES20Canvas_acquireContext },
    { "nReleaseContext",    "(I)V",            (void*) android_view_GLES20Canvas_releaseContext },

    { "nCallDrawGLFunction", "(II)Z",
            (void*) android_view_GLES20Canvas_callDrawGLFunction },
+0 −45
Original line number Diff line number Diff line
@@ -1595,51 +1595,6 @@ public class Canvas {
        restore();
    }

    /**
     * <p>Acquires the Canvas context. After invoking this method, the Canvas
     * context  can be modified by the caller. For instance, if you acquire
     * the context of an OpenGL Canvas you can reset the GL viewport, scissor,
     * etc.</p>
     * 
     * <p>A call to {@link #acquireContext()} should aways be followed by
     * a call to {@link #releaseContext()}, preferrably using a try block:</p>
     * 
     * <pre>
     * try {
     *     if (canvas.acquireContext()) {
     *         // Use the canvas and/or its context
     *     }
     * } finally {
     *     canvas.releaseContext();
     * }
     * </pre>
     * 
     * <p>Acquiring the context can be an expensive operation and should not
     * be done unless absolutely necessary.</p>
     * 
     * <p>Applications should never invoke this method directly.</p>
     * 
     * @return True if the context could be acquired successfully, false
     *         otherwise (if the context is already acquired for instance.)
     * 
     * @see #releaseContext() 
     * 
     * @hide
     */
    public boolean acquireContext() {
        return false;
    }

    /**
     * <p>Release the context acquired with {@link #acquireContext()}.</p>
     * 
     * @see #acquireContext() 
     * 
     * @hide
     */
    public void releaseContext() {
    }

    /**
     * Free up as much memory as possible from private caches (e.g. fonts, images)
     *
+1 −25
Original line number Diff line number Diff line
@@ -82,8 +82,6 @@ void PathHeap::flatten(SkFlattenableWriteBuffer& buffer) const {
///////////////////////////////////////////////////////////////////////////////

const char* DisplayList::OP_NAMES[] = {
    "AcquireContext",
    "ReleaseContext",
    "Save",
    "Restore",
    "RestoreToCount",
@@ -239,16 +237,6 @@ bool DisplayList::replay(OpenGLRenderer& renderer, uint32_t level) {
                needsInvalidate |= renderer.callDrawGLFunction(functor);
            }
            break;
            case AcquireContext: {
                DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]);
                renderer.acquireContext();
            }
            break;
            case ReleaseContext: {
                DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]);
                renderer.releaseContext();
            }
            break;
            case Save: {
                int rendererNum = getInt();
                DISPLAY_LIST_LOGD("%s%s %d", (char*) indent, OP_NAMES[op], rendererNum);
@@ -644,15 +632,9 @@ void DisplayListRenderer::finish() {
}

void DisplayListRenderer::interrupt() {

}
void DisplayListRenderer::resume() {

}
void DisplayListRenderer::acquireContext() {
    // TODO: probably noop instead of calling super
    addOp(DisplayList::AcquireContext);
    OpenGLRenderer::acquireContext();
void DisplayListRenderer::resume() {
}

bool DisplayListRenderer::callDrawGLFunction(Functor *functor) {
@@ -661,12 +643,6 @@ bool DisplayListRenderer::callDrawGLFunction(Functor *functor) {
    return false; // No invalidate needed at record-time
}

void DisplayListRenderer::releaseContext() {
    // TODO: probably noop instead of calling super
    addOp(DisplayList::ReleaseContext);
    OpenGLRenderer::releaseContext();
}

int DisplayListRenderer::save(int flags) {
    addOp(DisplayList::Save);
    addInt(flags);
+1 −5
Original line number Diff line number Diff line
@@ -89,9 +89,7 @@ public:
    // IMPORTANT: Update the intialization of OP_NAMES in the .cpp file
    //            when modifying this file
    enum Op {
        AcquireContext = 0,
        ReleaseContext,
        Save,
        Save = 0,
        Restore,
        RestoreToCount,
        SaveLayer,
@@ -245,8 +243,6 @@ public:
    void finish();

    bool callDrawGLFunction(Functor *functor);
    void acquireContext();
    void releaseContext();

    void interrupt();
    void resume();
Loading