diff options
Diffstat (limited to 'core/jni/android/graphics/Shader.cpp')
-rw-r--r-- | core/jni/android/graphics/Shader.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/jni/android/graphics/Shader.cpp b/core/jni/android/graphics/Shader.cpp index 6591d29..d0f7591 100644 --- a/core/jni/android/graphics/Shader.cpp +++ b/core/jni/android/graphics/Shader.cpp @@ -80,11 +80,12 @@ static jlong Shader_setLocalMatrix(JNIEnv* env, jobject o, jlong shaderHandle, j /////////////////////////////////////////////////////////////////////////////////////////////// -static jlong BitmapShader_constructor(JNIEnv* env, jobject o, jlong bitmapHandle, +static jlong BitmapShader_constructor(JNIEnv* env, jobject o, jobject jbitmap, jint tileModeX, jint tileModeY) { - const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle); - SkShader* s = SkShader::CreateBitmapShader(*bitmap, + SkBitmap bitmap; + GraphicsJNI::getSkBitmap(env, jbitmap, &bitmap); + SkShader* s = SkShader::CreateBitmapShader(bitmap, (SkShader::TileMode)tileModeX, (SkShader::TileMode)tileModeY); @@ -249,7 +250,7 @@ static JNINativeMethod gShaderMethods[] = { }; static JNINativeMethod gBitmapShaderMethods[] = { - { "nativeCreate", "(JII)J", (void*)BitmapShader_constructor }, + { "nativeCreate", "(Landroid/graphics/Bitmap;II)J", (void*)BitmapShader_constructor }, }; static JNINativeMethod gLinearGradientMethods[] = { |