diff options
author | Alan Viverette <alanv@google.com> | 2015-05-14 18:05:36 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2015-05-14 18:05:36 -0700 |
commit | 50210d912925aef14e4ce69be82e4949122a3cd9 (patch) | |
tree | ba87c37a8b2db6521df6f8c62307319bcf70a823 /core/jni | |
parent | 9cb90cbbf8fc91793dad1d1cb317079dbc7e8421 (diff) | |
download | frameworks_base-50210d912925aef14e4ce69be82e4949122a3cd9.zip frameworks_base-50210d912925aef14e4ce69be82e4949122a3cd9.tar.gz frameworks_base-50210d912925aef14e4ce69be82e4949122a3cd9.tar.bz2 |
Adjust light source for window position
Bug: 16523629
Change-Id: I2f3fed1edcac0a3cfd5034aded45e08ececfebaf
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 }, |