diff options
author | Chris Craik <ccraik@google.com> | 2014-10-08 19:58:12 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-08 19:58:13 +0000 |
commit | 86fd9278a98260e5812569381a07145221daa33d (patch) | |
tree | 14acfb9a675087472d8de666173b71b20164747e /core/jni/android | |
parent | e19fa355854d8c88cd5fb013573c682a8c24e749 (diff) | |
parent | 4136a0aeac9bb95aa615d4fc1f12378829d26c80 (diff) | |
download | frameworks_base-86fd9278a98260e5812569381a07145221daa33d.zip frameworks_base-86fd9278a98260e5812569381a07145221daa33d.tar.gz frameworks_base-86fd9278a98260e5812569381a07145221daa33d.tar.bz2 |
Merge "Enable fast jni for simple RenderNode/Matrix/Paint operations" into lmp-mr1-dev
Diffstat (limited to 'core/jni/android')
-rw-r--r-- | core/jni/android/graphics/Matrix.cpp | 81 | ||||
-rw-r--r-- | core/jni/android/graphics/Paint.cpp | 109 |
2 files changed, 97 insertions, 93 deletions
diff --git a/core/jni/android/graphics/Matrix.cpp b/core/jni/android/graphics/Matrix.cpp index cbd20e9..01ab699 100644 --- a/core/jni/android/graphics/Matrix.cpp +++ b/core/jni/android/graphics/Matrix.cpp @@ -308,46 +308,47 @@ public: static JNINativeMethod methods[] = { {"finalizer", "(J)V", (void*) SkMatrixGlue::finalizer}, {"native_create","(J)J", (void*) SkMatrixGlue::create}, - {"native_isIdentity","(J)Z", (void*) SkMatrixGlue::isIdentity}, - {"native_isAffine","(J)Z", (void*) SkMatrixGlue::isAffine}, - {"native_rectStaysRect","(J)Z", (void*) SkMatrixGlue::rectStaysRect}, - {"native_reset","(J)V", (void*) SkMatrixGlue::reset}, - {"native_set","(JJ)V", (void*) SkMatrixGlue::set}, - {"native_setTranslate","(JFF)V", (void*) SkMatrixGlue::setTranslate}, - {"native_setScale","(JFFFF)V", (void*) SkMatrixGlue::setScale__FFFF}, - {"native_setScale","(JFF)V", (void*) SkMatrixGlue::setScale__FF}, - {"native_setRotate","(JFFF)V", (void*) SkMatrixGlue::setRotate__FFF}, - {"native_setRotate","(JF)V", (void*) SkMatrixGlue::setRotate__F}, - {"native_setSinCos","(JFFFF)V", (void*) SkMatrixGlue::setSinCos__FFFF}, - {"native_setSinCos","(JFF)V", (void*) SkMatrixGlue::setSinCos__FF}, - {"native_setSkew","(JFFFF)V", (void*) SkMatrixGlue::setSkew__FFFF}, - {"native_setSkew","(JFF)V", (void*) SkMatrixGlue::setSkew__FF}, - {"native_setConcat","(JJJ)V", (void*) SkMatrixGlue::setConcat}, - {"native_preTranslate","(JFF)V", (void*) SkMatrixGlue::preTranslate}, - {"native_preScale","(JFFFF)V", (void*) SkMatrixGlue::preScale__FFFF}, - {"native_preScale","(JFF)V", (void*) SkMatrixGlue::preScale__FF}, - {"native_preRotate","(JFFF)V", (void*) SkMatrixGlue::preRotate__FFF}, - {"native_preRotate","(JF)V", (void*) SkMatrixGlue::preRotate__F}, - {"native_preSkew","(JFFFF)V", (void*) SkMatrixGlue::preSkew__FFFF}, - {"native_preSkew","(JFF)V", (void*) SkMatrixGlue::preSkew__FF}, - {"native_preConcat","(JJ)V", (void*) SkMatrixGlue::preConcat}, - {"native_postTranslate","(JFF)V", (void*) SkMatrixGlue::postTranslate}, - {"native_postScale","(JFFFF)V", (void*) SkMatrixGlue::postScale__FFFF}, - {"native_postScale","(JFF)V", (void*) SkMatrixGlue::postScale__FF}, - {"native_postRotate","(JFFF)V", (void*) SkMatrixGlue::postRotate__FFF}, - {"native_postRotate","(JF)V", (void*) SkMatrixGlue::postRotate__F}, - {"native_postSkew","(JFFFF)V", (void*) SkMatrixGlue::postSkew__FFFF}, - {"native_postSkew","(JFF)V", (void*) SkMatrixGlue::postSkew__FF}, - {"native_postConcat","(JJ)V", (void*) SkMatrixGlue::postConcat}, - {"native_setRectToRect","(JLandroid/graphics/RectF;Landroid/graphics/RectF;I)Z", (void*) SkMatrixGlue::setRectToRect}, - {"native_setPolyToPoly","(J[FI[FII)Z", (void*) SkMatrixGlue::setPolyToPoly}, - {"native_invert","(JJ)Z", (void*) SkMatrixGlue::invert}, - {"native_mapPoints","(J[FI[FIIZ)V", (void*) SkMatrixGlue::mapPoints}, - {"native_mapRect","(JLandroid/graphics/RectF;Landroid/graphics/RectF;)Z", (void*) SkMatrixGlue::mapRect__RectFRectF}, - {"native_mapRadius","(JF)F", (void*) SkMatrixGlue::mapRadius}, - {"native_getValues","(J[F)V", (void*) SkMatrixGlue::getValues}, - {"native_setValues","(J[F)V", (void*) SkMatrixGlue::setValues}, - {"native_equals", "(JJ)Z", (void*) SkMatrixGlue::equals} + + {"native_isIdentity","!(J)Z", (void*) SkMatrixGlue::isIdentity}, + {"native_isAffine","!(J)Z", (void*) SkMatrixGlue::isAffine}, + {"native_rectStaysRect","!(J)Z", (void*) SkMatrixGlue::rectStaysRect}, + {"native_reset","!(J)V", (void*) SkMatrixGlue::reset}, + {"native_set","!(JJ)V", (void*) SkMatrixGlue::set}, + {"native_setTranslate","!(JFF)V", (void*) SkMatrixGlue::setTranslate}, + {"native_setScale","!(JFFFF)V", (void*) SkMatrixGlue::setScale__FFFF}, + {"native_setScale","!(JFF)V", (void*) SkMatrixGlue::setScale__FF}, + {"native_setRotate","!(JFFF)V", (void*) SkMatrixGlue::setRotate__FFF}, + {"native_setRotate","!(JF)V", (void*) SkMatrixGlue::setRotate__F}, + {"native_setSinCos","!(JFFFF)V", (void*) SkMatrixGlue::setSinCos__FFFF}, + {"native_setSinCos","!(JFF)V", (void*) SkMatrixGlue::setSinCos__FF}, + {"native_setSkew","!(JFFFF)V", (void*) SkMatrixGlue::setSkew__FFFF}, + {"native_setSkew","!(JFF)V", (void*) SkMatrixGlue::setSkew__FF}, + {"native_setConcat","!(JJJ)V", (void*) SkMatrixGlue::setConcat}, + {"native_preTranslate","!(JFF)V", (void*) SkMatrixGlue::preTranslate}, + {"native_preScale","!(JFFFF)V", (void*) SkMatrixGlue::preScale__FFFF}, + {"native_preScale","!(JFF)V", (void*) SkMatrixGlue::preScale__FF}, + {"native_preRotate","!(JFFF)V", (void*) SkMatrixGlue::preRotate__FFF}, + {"native_preRotate","!(JF)V", (void*) SkMatrixGlue::preRotate__F}, + {"native_preSkew","!(JFFFF)V", (void*) SkMatrixGlue::preSkew__FFFF}, + {"native_preSkew","!(JFF)V", (void*) SkMatrixGlue::preSkew__FF}, + {"native_preConcat","!(JJ)V", (void*) SkMatrixGlue::preConcat}, + {"native_postTranslate","!(JFF)V", (void*) SkMatrixGlue::postTranslate}, + {"native_postScale","!(JFFFF)V", (void*) SkMatrixGlue::postScale__FFFF}, + {"native_postScale","!(JFF)V", (void*) SkMatrixGlue::postScale__FF}, + {"native_postRotate","!(JFFF)V", (void*) SkMatrixGlue::postRotate__FFF}, + {"native_postRotate","!(JF)V", (void*) SkMatrixGlue::postRotate__F}, + {"native_postSkew","!(JFFFF)V", (void*) SkMatrixGlue::postSkew__FFFF}, + {"native_postSkew","!(JFF)V", (void*) SkMatrixGlue::postSkew__FF}, + {"native_postConcat","!(JJ)V", (void*) SkMatrixGlue::postConcat}, + {"native_setRectToRect","!(JLandroid/graphics/RectF;Landroid/graphics/RectF;I)Z", (void*) SkMatrixGlue::setRectToRect}, + {"native_setPolyToPoly","!(J[FI[FII)Z", (void*) SkMatrixGlue::setPolyToPoly}, + {"native_invert","!(JJ)Z", (void*) SkMatrixGlue::invert}, + {"native_mapPoints","!(J[FI[FIIZ)V", (void*) SkMatrixGlue::mapPoints}, + {"native_mapRect","!(JLandroid/graphics/RectF;Landroid/graphics/RectF;)Z", (void*) SkMatrixGlue::mapRect__RectFRectF}, + {"native_mapRadius","!(JF)F", (void*) SkMatrixGlue::mapRadius}, + {"native_getValues","!(J[F)V", (void*) SkMatrixGlue::getValues}, + {"native_setValues","!(J[F)V", (void*) SkMatrixGlue::setValues}, + {"native_equals", "!(JJ)Z", (void*) SkMatrixGlue::equals} }; static jfieldID sNativeInstanceField; diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp index 4bb31fc..6b02326 100644 --- a/core/jni/android/graphics/Paint.cpp +++ b/core/jni/android/graphics/Paint.cpp @@ -939,58 +939,60 @@ static JNINativeMethod methods[] = { {"finalizer", "(J)V", (void*) PaintGlue::finalizer}, {"native_init","()J", (void*) PaintGlue::init}, {"native_initWithPaint","(J)J", (void*) PaintGlue::initWithPaint}, - {"native_reset","(J)V", (void*) PaintGlue::reset}, - {"native_set","(JJ)V", (void*) PaintGlue::assign}, - {"getFlags","()I", (void*) PaintGlue::getFlags}, - {"setFlags","(I)V", (void*) PaintGlue::setFlags}, - {"getHinting","()I", (void*) PaintGlue::getHinting}, - {"setHinting","(I)V", (void*) PaintGlue::setHinting}, - {"setAntiAlias","(Z)V", (void*) PaintGlue::setAntiAlias}, - {"setSubpixelText","(Z)V", (void*) PaintGlue::setSubpixelText}, - {"setLinearText","(Z)V", (void*) PaintGlue::setLinearText}, - {"setUnderlineText","(Z)V", (void*) PaintGlue::setUnderlineText}, - {"setStrikeThruText","(Z)V", (void*) PaintGlue::setStrikeThruText}, - {"setFakeBoldText","(Z)V", (void*) PaintGlue::setFakeBoldText}, - {"setFilterBitmap","(Z)V", (void*) PaintGlue::setFilterBitmap}, - {"setDither","(Z)V", (void*) PaintGlue::setDither}, - {"native_getStyle","(J)I", (void*) PaintGlue::getStyle}, - {"native_setStyle","(JI)V", (void*) PaintGlue::setStyle}, - {"getColor","()I", (void*) PaintGlue::getColor}, - {"setColor","(I)V", (void*) PaintGlue::setColor}, - {"getAlpha","()I", (void*) PaintGlue::getAlpha}, - {"setAlpha","(I)V", (void*) PaintGlue::setAlpha}, - {"getStrokeWidth","()F", (void*) PaintGlue::getStrokeWidth}, - {"setStrokeWidth","(F)V", (void*) PaintGlue::setStrokeWidth}, - {"getStrokeMiter","()F", (void*) PaintGlue::getStrokeMiter}, - {"setStrokeMiter","(F)V", (void*) PaintGlue::setStrokeMiter}, - {"native_getStrokeCap","(J)I", (void*) PaintGlue::getStrokeCap}, - {"native_setStrokeCap","(JI)V", (void*) PaintGlue::setStrokeCap}, - {"native_getStrokeJoin","(J)I", (void*) PaintGlue::getStrokeJoin}, - {"native_setStrokeJoin","(JI)V", (void*) PaintGlue::setStrokeJoin}, - {"native_getFillPath","(JJJ)Z", (void*) PaintGlue::getFillPath}, - {"native_setShader","(JJ)J", (void*) PaintGlue::setShader}, - {"native_setColorFilter","(JJ)J", (void*) PaintGlue::setColorFilter}, - {"native_setXfermode","(JJ)J", (void*) PaintGlue::setXfermode}, - {"native_setPathEffect","(JJ)J", (void*) PaintGlue::setPathEffect}, - {"native_setMaskFilter","(JJ)J", (void*) PaintGlue::setMaskFilter}, - {"native_setTypeface","(JJ)J", (void*) PaintGlue::setTypeface}, - {"native_setRasterizer","(JJ)J", (void*) PaintGlue::setRasterizer}, - {"native_getTextAlign","(J)I", (void*) PaintGlue::getTextAlign}, - {"native_setTextAlign","(JI)V", (void*) PaintGlue::setTextAlign}, - {"native_setTextLocale","(JLjava/lang/String;)V", (void*) PaintGlue::setTextLocale}, - {"isElegantTextHeight","()Z", (void*) PaintGlue::isElegantTextHeight}, - {"setElegantTextHeight","(Z)V", (void*) PaintGlue::setElegantTextHeight}, - {"getTextSize","()F", (void*) PaintGlue::getTextSize}, - {"setTextSize","(F)V", (void*) PaintGlue::setTextSize}, - {"getTextScaleX","()F", (void*) PaintGlue::getTextScaleX}, - {"setTextScaleX","(F)V", (void*) PaintGlue::setTextScaleX}, - {"getTextSkewX","()F", (void*) PaintGlue::getTextSkewX}, - {"setTextSkewX","(F)V", (void*) PaintGlue::setTextSkewX}, - {"native_getLetterSpacing","(J)F", (void*) PaintGlue::getLetterSpacing}, - {"native_setLetterSpacing","(JF)V", (void*) PaintGlue::setLetterSpacing}, + + {"native_reset","!(J)V", (void*) PaintGlue::reset}, + {"native_set","!(JJ)V", (void*) PaintGlue::assign}, + {"getFlags","!()I", (void*) PaintGlue::getFlags}, + {"setFlags","!(I)V", (void*) PaintGlue::setFlags}, + {"getHinting","!()I", (void*) PaintGlue::getHinting}, + {"setHinting","!(I)V", (void*) PaintGlue::setHinting}, + {"setAntiAlias","!(Z)V", (void*) PaintGlue::setAntiAlias}, + {"setSubpixelText","!(Z)V", (void*) PaintGlue::setSubpixelText}, + {"setLinearText","!(Z)V", (void*) PaintGlue::setLinearText}, + {"setUnderlineText","!(Z)V", (void*) PaintGlue::setUnderlineText}, + {"setStrikeThruText","!(Z)V", (void*) PaintGlue::setStrikeThruText}, + {"setFakeBoldText","!(Z)V", (void*) PaintGlue::setFakeBoldText}, + {"setFilterBitmap","!(Z)V", (void*) PaintGlue::setFilterBitmap}, + {"setDither","!(Z)V", (void*) PaintGlue::setDither}, + {"native_getStyle","!(J)I", (void*) PaintGlue::getStyle}, + {"native_setStyle","!(JI)V", (void*) PaintGlue::setStyle}, + {"getColor","!()I", (void*) PaintGlue::getColor}, + {"setColor","!(I)V", (void*) PaintGlue::setColor}, + {"getAlpha","!()I", (void*) PaintGlue::getAlpha}, + {"setAlpha","!(I)V", (void*) PaintGlue::setAlpha}, + {"getStrokeWidth","!()F", (void*) PaintGlue::getStrokeWidth}, + {"setStrokeWidth","!(F)V", (void*) PaintGlue::setStrokeWidth}, + {"getStrokeMiter","!()F", (void*) PaintGlue::getStrokeMiter}, + {"setStrokeMiter","!(F)V", (void*) PaintGlue::setStrokeMiter}, + {"native_getStrokeCap","!(J)I", (void*) PaintGlue::getStrokeCap}, + {"native_setStrokeCap","!(JI)V", (void*) PaintGlue::setStrokeCap}, + {"native_getStrokeJoin","!(J)I", (void*) PaintGlue::getStrokeJoin}, + {"native_setStrokeJoin","!(JI)V", (void*) PaintGlue::setStrokeJoin}, + {"native_getFillPath","!(JJJ)Z", (void*) PaintGlue::getFillPath}, + {"native_setShader","!(JJ)J", (void*) PaintGlue::setShader}, + {"native_setColorFilter","!(JJ)J", (void*) PaintGlue::setColorFilter}, + {"native_setXfermode","!(JJ)J", (void*) PaintGlue::setXfermode}, + {"native_setPathEffect","!(JJ)J", (void*) PaintGlue::setPathEffect}, + {"native_setMaskFilter","!(JJ)J", (void*) PaintGlue::setMaskFilter}, + {"native_setTypeface","!(JJ)J", (void*) PaintGlue::setTypeface}, + {"native_setRasterizer","!(JJ)J", (void*) PaintGlue::setRasterizer}, + {"native_getTextAlign","!(J)I", (void*) PaintGlue::getTextAlign}, + {"native_setTextAlign","!(JI)V", (void*) PaintGlue::setTextAlign}, + {"native_setTextLocale","!(JLjava/lang/String;)V", (void*) PaintGlue::setTextLocale}, + {"isElegantTextHeight","!()Z", (void*) PaintGlue::isElegantTextHeight}, + {"setElegantTextHeight","!(Z)V", (void*) PaintGlue::setElegantTextHeight}, + {"getTextSize","!()F", (void*) PaintGlue::getTextSize}, + {"setTextSize","!(F)V", (void*) PaintGlue::setTextSize}, + {"getTextScaleX","!()F", (void*) PaintGlue::getTextScaleX}, + {"setTextScaleX","!(F)V", (void*) PaintGlue::setTextScaleX}, + {"getTextSkewX","!()F", (void*) PaintGlue::getTextSkewX}, + {"setTextSkewX","!(F)V", (void*) PaintGlue::setTextSkewX}, + {"native_getLetterSpacing","!(J)F", (void*) PaintGlue::getLetterSpacing}, + {"native_setLetterSpacing","!(JF)V", (void*) PaintGlue::setLetterSpacing}, {"native_setFontFeatureSettings","(JLjava/lang/String;)V", (void*) PaintGlue::setFontFeatureSettings}, - {"ascent","()F", (void*) PaintGlue::ascent}, - {"descent","()F", (void*) PaintGlue::descent}, + {"ascent","!()F", (void*) PaintGlue::ascent}, + {"descent","!()F", (void*) PaintGlue::descent}, + {"getFontMetrics", "(Landroid/graphics/Paint$FontMetrics;)F", (void*)PaintGlue::getFontMetrics}, {"getFontMetricsInt", "(Landroid/graphics/Paint$FontMetricsInt;)I", (void*)PaintGlue::getFontMetricsInt}, {"native_measureText","([CIII)F", (void*) PaintGlue::measureText_CIII}, @@ -1014,8 +1016,9 @@ static JNINativeMethod methods[] = { (void*) PaintGlue::getStringBounds }, {"nativeGetCharArrayBounds", "(JJ[CIIILandroid/graphics/Rect;)V", (void*) PaintGlue::getCharArrayBounds }, - {"native_setShadowLayer", "(JFFFI)V", (void*)PaintGlue::setShadowLayer}, - {"native_hasShadowLayer", "(J)Z", (void*)PaintGlue::hasShadowLayer} + + {"native_setShadowLayer", "!(JFFFI)V", (void*)PaintGlue::setShadowLayer}, + {"native_hasShadowLayer", "!(J)Z", (void*)PaintGlue::hasShadowLayer} }; static jfieldID req_fieldID(jfieldID id) { |