diff options
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_view_SurfaceControl.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp index 20352eb..7156c0f 100644 --- a/core/jni/android_view_SurfaceControl.cpp +++ b/core/jni/android_view_SurfaceControl.cpp @@ -316,6 +316,39 @@ static void nativeSetLayerStack(JNIEnv* env, jclass clazz, jlong nativeObject, j } } +static void nativeSetBlur(JNIEnv* env, jclass clazz, jlong nativeObject, jfloat blur) { + SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); + status_t err = ctrl->setBlur(blur); + if (err < 0 && err != NO_INIT) { + doThrowIAE(env); + } +} + +static void nativeSetBlurMaskSurface(JNIEnv* env, jclass clazz, jlong nativeObject, jlong maskLayerNativeObject) { + SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); + SurfaceControl* const maskLayer = reinterpret_cast<SurfaceControl *>(maskLayerNativeObject); + status_t err = ctrl->setBlurMaskSurface(maskLayer); + if (err < 0 && err != NO_INIT) { + doThrowIAE(env); + } +} + +static void nativeSetBlurMaskSampling(JNIEnv* env, jclass clazz, jlong nativeObject, jint blurMaskSampling) { + SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); + status_t err = ctrl->setBlurMaskSampling(blurMaskSampling); + if (err < 0 && err != NO_INIT) { + doThrowIAE(env); + } +} + +static void nativeSetBlurMaskAlphaThreshold(JNIEnv* env, jclass clazz, jlong nativeObject, jfloat alpha) { + SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); + status_t err = ctrl->setBlurMaskAlphaThreshold(alpha); + if (err < 0 && err != NO_INIT) { + doThrowIAE(env); + } +} + static jobject nativeGetBuiltInDisplay(JNIEnv* env, jclass clazz, jint id) { sp<IBinder> token(SurfaceComposerClient::getBuiltInDisplay(id)); return javaObjectForIBinder(env, token); @@ -614,6 +647,14 @@ static JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeSetWindowCrop }, {"nativeSetLayerStack", "(JI)V", (void*)nativeSetLayerStack }, + {"nativeSetBlur", "(JF)V", + (void*)nativeSetBlur }, + {"nativeSetBlurMaskSurface", "(JJ)V", + (void*)nativeSetBlurMaskSurface }, + {"nativeSetBlurMaskSampling", "(JI)V", + (void*)nativeSetBlurMaskSampling }, + {"nativeSetBlurMaskAlphaThreshold", "(JF)V", + (void*)nativeSetBlurMaskAlphaThreshold }, {"nativeGetBuiltInDisplay", "(I)Landroid/os/IBinder;", (void*)nativeGetBuiltInDisplay }, {"nativeCreateDisplay", "(Ljava/lang/String;Z)Landroid/os/IBinder;", |