diff options
author | Alan Viverette <alanv@google.com> | 2015-05-15 18:31:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-15 18:31:54 +0000 |
commit | 2cc4a4755fcd41900e042c75cc47879d46acecda (patch) | |
tree | ff3306dc025499eb1b1011ce273fae3035168630 /core/jni | |
parent | 6a5f85080e1a3656fc9a4a22c71cf7bc1f9239de (diff) | |
parent | 50210d912925aef14e4ce69be82e4949122a3cd9 (diff) | |
download | frameworks_base-2cc4a4755fcd41900e042c75cc47879d46acecda.zip frameworks_base-2cc4a4755fcd41900e042c75cc47879d46acecda.tar.gz frameworks_base-2cc4a4755fcd41900e042c75cc47879d46acecda.tar.bz2 |
Merge "Adjust light source for window position" into mnc-dev
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_view_Surface.cpp | 3 | ||||
-rw-r--r-- | core/jni/android_view_ThreadedRenderer.cpp | 16 |
2 files changed, 12 insertions, 7 deletions
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp index c4cd7ff..3fa92a8 100644 --- a/core/jni/android_view_Surface.cpp +++ b/core/jni/android_view_Surface.cpp @@ -483,7 +483,8 @@ 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); + proxy->setup(0, 0, 0, 0, 0); + proxy->setLightCenter((Vector3){0, 0, 0}); return (jlong) proxy; } diff --git a/core/jni/android_view_ThreadedRenderer.cpp b/core/jni/android_view_ThreadedRenderer.cpp index 5d5465b..47132f4 100644 --- a/core/jni/android_view_ThreadedRenderer.cpp +++ b/core/jni/android_view_ThreadedRenderer.cpp @@ -290,12 +290,15 @@ 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 width, jint height, jfloat lightRadius, jint ambientShadowAlpha, jint spotShadowAlpha) { RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); - proxy->setup(width, height, (Vector3){lightX, lightY, lightZ}, lightRadius, - ambientShadowAlpha, spotShadowAlpha); + proxy->setup(width, height, lightRadius, ambientShadowAlpha, spotShadowAlpha); +} + +static void android_view_ThreadedRenderer_setLightCenter(JNIEnv* env, jobject clazz, + jlong proxyPtr, jfloat lightX, jfloat lightY, jfloat lightZ) { + RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); + proxy->setLightCenter((Vector3){lightX, lightY, lightZ}); } static void android_view_ThreadedRenderer_setOpaque(JNIEnv* env, jobject clazz, @@ -461,7 +464,8 @@ 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", "(JIIFFFFII)V", (void*) android_view_ThreadedRenderer_setup }, + { "nSetup", "(JIIFII)V", (void*) android_view_ThreadedRenderer_setup }, + { "nSetLightCenter", "(JFFF)V", (void*) android_view_ThreadedRenderer_setLightCenter }, { "nSetOpaque", "(JZ)V", (void*) android_view_ThreadedRenderer_setOpaque }, { "nSyncAndDrawFrame", "(J[JI)I", (void*) android_view_ThreadedRenderer_syncAndDrawFrame }, { "nDestroy", "(J)V", (void*) android_view_ThreadedRenderer_destroy }, |