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

Commit 7a3433a9 authored by John Reck's avatar John Reck Committed by android-build-merger
Browse files

Merge "Add a workaround for simulate secondary display" into oc-dev am: 31443a17 am: f0d39710

am: 2d41b97b

Change-Id: I4de4d39d14746691ca74e13918f3ae06476b91bc
parents 5d75c622 2d41b97b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -996,6 +996,9 @@ public final class ThreadedRenderer {
        observer.mNative = null;
    }

    /** Not actually public - internal use only. This doc to make lint happy */
    public static native void disableVsync();

    static native void setupShadersDiskCache(String cacheFile);

    private static native void nRotateProcessStatsBuffer();
+5 −0
Original line number Diff line number Diff line
@@ -926,6 +926,10 @@ static jobject android_view_ThreadedRenderer_createHardwareBitmapFromRenderNode(
    return createBitmap(env, bitmap.release(), android::bitmap::kBitmapCreateFlag_Mutable);
}

static void android_view_ThreadedRenderer_disableVsync(JNIEnv*, jclass) {
    RenderProxy::disableVsync();
}

// ----------------------------------------------------------------------------
// FrameMetricsObserver
// ----------------------------------------------------------------------------
@@ -1024,6 +1028,7 @@ static const JNINativeMethod gMethods[] = {
                (void*)android_view_ThreadedRenderer_copySurfaceInto },
    { "nCreateHardwareBitmap", "(JII)Landroid/graphics/Bitmap;",
            (void*)android_view_ThreadedRenderer_createHardwareBitmapFromRenderNode },
    { "disableVsync", "()V", (void*)android_view_ThreadedRenderer_disableVsync },
};

int register_android_view_ThreadedRenderer(JNIEnv* env) {
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ bool Properties::waitForGpuCompletion = false;
bool Properties::forceDrawFrame = false;

bool Properties::filterOutTestOverhead = false;
bool Properties::disableVsync = false;

static int property_get_int(const char* key, int defaultValue) {
    char buf[PROPERTY_VALUE_MAX] = {'\0',};
+6 −0
Original line number Diff line number Diff line
@@ -318,6 +318,12 @@ public:
    // any overhead they add
    static bool filterOutTestOverhead;

    // Workaround a device lockup in edge cases by switching to async mode
    // instead of the default vsync (b/38372997). Only system_server should hit this.
    // Any existing RenderProxy & Surface combination will be unaffected, only things
    // created after changing this.
    static bool disableVsync;

    // Used for testing only to change the render pipeline.
#ifdef HWUI_GLES_WRAP_ENABLED
    static void overrideRenderPipelineType(RenderPipelineType);
+3 −0
Original line number Diff line number Diff line
@@ -357,6 +357,9 @@ bool EglManager::makeCurrent(EGLSurface surface, EGLint* errOut) {
        }
    }
    mCurrentSurface = surface;
    if (Properties::disableVsync) {
        eglSwapInterval(mEglDisplay, 0);
    }
    return true;
}

Loading