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

Commit e4280baa authored by John Reck's avatar John Reck
Browse files

Implement loadSystemProperties

 Bug: 14087580

Change-Id: I7153f38c70b554a78c56a0e794da929fc401ee7a
parent f9be7794
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ public class ThreadedRenderer extends HardwareRenderer {

    @Override
    boolean loadSystemProperties() {
        return false;
        return nLoadSystemProperties(mNativeProxy);
    }

    private void updateRootDisplayList(View view, HardwareDrawCallbacks callbacks) {
@@ -306,6 +306,7 @@ public class ThreadedRenderer extends HardwareRenderer {
    private static native void nDeleteProxy(long nativeProxy);

    private static native void nSetFrameInterval(long nativeProxy, long frameIntervalNanos);
    private static native boolean nLoadSystemProperties(long nativeProxy);

    private static native boolean nInitialize(long nativeProxy, Surface window);
    private static native void nUpdateSurface(long nativeProxy, Surface window);
+7 −0
Original line number Diff line number Diff line
@@ -158,6 +158,12 @@ static void android_view_ThreadedRenderer_setFrameInterval(JNIEnv* env, jobject
    proxy->setFrameInterval(frameIntervalNanos);
}

static jboolean android_view_ThreadedRenderer_loadSystemProperties(JNIEnv* env, jobject clazz,
        jlong proxyPtr) {
    RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr);
    return proxy->loadSystemProperties();
}

static jboolean android_view_ThreadedRenderer_initialize(JNIEnv* env, jobject clazz,
        jlong proxyPtr, jobject jsurface) {
    RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr);
@@ -268,6 +274,7 @@ static JNINativeMethod gMethods[] = {
    { "nCreateProxy", "(ZJ)J", (void*) android_view_ThreadedRenderer_createProxy },
    { "nDeleteProxy", "(J)V", (void*) android_view_ThreadedRenderer_deleteProxy },
    { "nSetFrameInterval", "(JJ)V", (void*) android_view_ThreadedRenderer_setFrameInterval },
    { "nLoadSystemProperties", "(J)Z", (void*) android_view_ThreadedRenderer_loadSystemProperties },
    { "nInitialize", "(JLandroid/view/Surface;)Z", (void*) android_view_ThreadedRenderer_initialize },
    { "nUpdateSurface", "(JLandroid/view/Surface;)V", (void*) android_view_ThreadedRenderer_updateSurface },
    { "nPauseSurface", "(JLandroid/view/Surface;)V", (void*) android_view_ThreadedRenderer_pauseSurface },
+13 −0
Original line number Diff line number Diff line
@@ -98,6 +98,19 @@ void RenderProxy::setFrameInterval(nsecs_t frameIntervalNanos) {
    post(task);
}

CREATE_BRIDGE0(loadSystemProperties) {
    bool needsRedraw = false;
    if (Caches::hasInstance()) {
        needsRedraw = Caches::getInstance().initProperties();
    }
    return (void*) needsRedraw;
}

bool RenderProxy::loadSystemProperties() {
    SETUP_TASK(loadSystemProperties);
    return (bool) postAndWait(task);
}

CREATE_BRIDGE2(initialize, CanvasContext* context, EGLNativeWindowType window) {
    return (void*) args->context->initialize(args->window);
}
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ public:
    ANDROID_API virtual ~RenderProxy();

    ANDROID_API void setFrameInterval(nsecs_t frameIntervalNanos);
    ANDROID_API bool loadSystemProperties();

    ANDROID_API bool initialize(const sp<ANativeWindow>& window);
    ANDROID_API void updateSurface(const sp<ANativeWindow>& window);