diff options
author | John Reck <jreck@google.com> | 2015-05-14 07:38:07 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2015-05-14 07:38:11 -0700 |
commit | 570b2052bb8eec8c510941b0a6d77262df28b922 (patch) | |
tree | e40995ea837a4a2174f68ff6c279c55ab05fbbae /core/jni | |
parent | 7238435e9b3f133965b63abc7b352b34f9401af5 (diff) | |
parent | 951f23478d79fb232e93a750d9050adce7a67874 (diff) | |
download | frameworks_base-570b2052bb8eec8c510941b0a6d77262df28b922.zip frameworks_base-570b2052bb8eec8c510941b0a6d77262df28b922.tar.gz frameworks_base-570b2052bb8eec8c510941b0a6d77262df28b922.tar.bz2 |
DO NOT MERGE resolved conflicts for merge of 951f2347 to lmp-mr1-ub-dev
Change-Id: Ic392bf6f2cf9e9bf526b6ea63a3be7e50420e7d1
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_view_Surface.cpp | 10 | ||||
-rw-r--r-- | core/jni/android_view_ThreadedRenderer.cpp | 22 |
2 files changed, 12 insertions, 20 deletions
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp index bfa0534..7f6c50f 100644 --- a/core/jni/android_view_Surface.cpp +++ b/core/jni/android_view_Surface.cpp @@ -49,7 +49,6 @@ #include <AnimationContext.h> #include <DisplayListRenderer.h> -#include <FrameInfo.h> #include <RenderNode.h> #include <renderthread/RenderProxy.h> @@ -395,7 +394,7 @@ static jlong create(JNIEnv* env, jclass clazz, jlong rootNodePtr, jlong surfaceP proxy->initialize(surface); // Shadows can't be used via this interface, so just set the light source // to all 0s. (and width & height are unused, TODO remove them) - proxy->setup(0, 0, (Vector3){0, 0, 0}, 0, 0, 0, 1.0f); + proxy->setup(0, 0, (Vector3){0, 0, 0}, 0, 0, 0); return (jlong) proxy; } @@ -407,11 +406,8 @@ static void setSurface(JNIEnv* env, jclass clazz, jlong rendererPtr, jlong surfa static void draw(JNIEnv* env, jclass clazz, jlong rendererPtr) { RenderProxy* proxy = reinterpret_cast<RenderProxy*>(rendererPtr); - nsecs_t vsync = systemTime(CLOCK_MONOTONIC); - UiFrameInfoBuilder(proxy->frameInfo()) - .setVsync(vsync, vsync) - .addFlag(FrameInfoFlags::kSurfaceCanvas); - proxy->syncAndDrawFrame(); + nsecs_t frameTimeNs = systemTime(CLOCK_MONOTONIC); + proxy->syncAndDrawFrame(frameTimeNs, 0, 1.0f); } static void destroy(JNIEnv* env, jclass clazz, jlong rendererPtr) { diff --git a/core/jni/android_view_ThreadedRenderer.cpp b/core/jni/android_view_ThreadedRenderer.cpp index 7224f17..9b06293 100644 --- a/core/jni/android_view_ThreadedRenderer.cpp +++ b/core/jni/android_view_ThreadedRenderer.cpp @@ -283,10 +283,10 @@ static jboolean android_view_ThreadedRenderer_pauseSurface(JNIEnv* env, jobject static void android_view_ThreadedRenderer_setup(JNIEnv* env, jobject clazz, jlong proxyPtr, jint width, jint height, jfloat lightX, jfloat lightY, jfloat lightZ, jfloat lightRadius, - jint ambientShadowAlpha, jint spotShadowAlpha, jfloat density) { + jint ambientShadowAlpha, jint spotShadowAlpha) { RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); proxy->setup(width, height, (Vector3){lightX, lightY, lightZ}, lightRadius, - ambientShadowAlpha, spotShadowAlpha, density); + ambientShadowAlpha, spotShadowAlpha); } static void android_view_ThreadedRenderer_setOpaque(JNIEnv* env, jobject clazz, @@ -296,13 +296,9 @@ static void android_view_ThreadedRenderer_setOpaque(JNIEnv* env, jobject clazz, } static int android_view_ThreadedRenderer_syncAndDrawFrame(JNIEnv* env, jobject clazz, - jlong proxyPtr, jlongArray frameInfo, jint frameInfoSize) { - LOG_ALWAYS_FATAL_IF(frameInfoSize != UI_THREAD_FRAME_INFO_SIZE, - "Mismatched size expectations, given %d expected %d", - frameInfoSize, UI_THREAD_FRAME_INFO_SIZE); + jlong proxyPtr, jlong frameTimeNanos, jlong recordDuration, jfloat density) { RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); - env->GetLongArrayRegion(frameInfo, 0, frameInfoSize, proxy->frameInfo()); - return proxy->syncAndDrawFrame(); + return proxy->syncAndDrawFrame(frameTimeNanos, recordDuration, density); } static void android_view_ThreadedRenderer_destroy(JNIEnv* env, jobject clazz, @@ -397,10 +393,10 @@ static void android_view_ThreadedRenderer_notifyFramePending(JNIEnv* env, jobjec } static void android_view_ThreadedRenderer_dumpProfileInfo(JNIEnv* env, jobject clazz, - jlong proxyPtr, jobject javaFileDescriptor, jint dumpFlags) { + jlong proxyPtr, jobject javaFileDescriptor) { RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); int fd = jniGetFDFromFileDescriptor(env, javaFileDescriptor); - proxy->dumpProfileInfo(fd, dumpFlags); + proxy->dumpProfileInfo(fd); } #endif @@ -434,9 +430,9 @@ static JNINativeMethod gMethods[] = { { "nInitialize", "(JLandroid/view/Surface;)Z", (void*) android_view_ThreadedRenderer_initialize }, { "nUpdateSurface", "(JLandroid/view/Surface;)V", (void*) android_view_ThreadedRenderer_updateSurface }, { "nPauseSurface", "(JLandroid/view/Surface;)Z", (void*) android_view_ThreadedRenderer_pauseSurface }, - { "nSetup", "(JIIFFFFIIF)V", (void*) android_view_ThreadedRenderer_setup }, + { "nSetup", "(JIIFFFFII)V", (void*) android_view_ThreadedRenderer_setup }, { "nSetOpaque", "(JZ)V", (void*) android_view_ThreadedRenderer_setOpaque }, - { "nSyncAndDrawFrame", "(J[JI)I", (void*) android_view_ThreadedRenderer_syncAndDrawFrame }, + { "nSyncAndDrawFrame", "(JJJF)I", (void*) android_view_ThreadedRenderer_syncAndDrawFrame }, { "nDestroy", "(J)V", (void*) android_view_ThreadedRenderer_destroy }, { "nRegisterAnimatingRenderNode", "(JJ)V", (void*) android_view_ThreadedRenderer_registerAnimatingRenderNode }, { "nInvokeFunctor", "(JZ)V", (void*) android_view_ThreadedRenderer_invokeFunctor }, @@ -451,7 +447,7 @@ static JNINativeMethod gMethods[] = { { "nFence", "(J)V", (void*) android_view_ThreadedRenderer_fence }, { "nStopDrawing", "(J)V", (void*) android_view_ThreadedRenderer_stopDrawing }, { "nNotifyFramePending", "(J)V", (void*) android_view_ThreadedRenderer_notifyFramePending }, - { "nDumpProfileInfo", "(JLjava/io/FileDescriptor;I)V", (void*) android_view_ThreadedRenderer_dumpProfileInfo }, + { "nDumpProfileInfo", "(JLjava/io/FileDescriptor;)V", (void*) android_view_ThreadedRenderer_dumpProfileInfo }, #endif { "setupShadersDiskCache", "(Ljava/lang/String;)V", (void*) android_view_ThreadedRenderer_setupShadersDiskCache }, |