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

Commit 31443a17 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add a workaround for simulate secondary display" into oc-dev

parents 0e6a5f8d a896306c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -970,6 +970,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
@@ -932,6 +932,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
// ----------------------------------------------------------------------------
@@ -1030,6 +1034,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
@@ -279,6 +279,9 @@ bool EglManager::makeCurrent(EGLSurface surface, EGLint* errOut) {
        }
    }
    mCurrentSurface = surface;
    if (Properties::disableVsync) {
        eglSwapInterval(mEglDisplay, 0);
    }
    return true;
}

Loading