summaryrefslogtreecommitdiffstats
path: root/core/jni/android
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-10-07 15:09:46 -0700
committerChris Craik <ccraik@google.com>2014-10-07 15:09:46 -0700
commit4136a0aeac9bb95aa615d4fc1f12378829d26c80 (patch)
tree39bba55bfd7768983ec0e8c0479be6c3241f0d11 /core/jni/android
parentec89863adec09dbf980b2d2c90c0fa5e78ffa7a9 (diff)
downloadframeworks_base-4136a0aeac9bb95aa615d4fc1f12378829d26c80.zip
frameworks_base-4136a0aeac9bb95aa615d4fc1f12378829d26c80.tar.gz
frameworks_base-4136a0aeac9bb95aa615d4fc1f12378829d26c80.tar.bz2
Enable fast jni for simple RenderNode/Matrix/Paint operations
bug:17895119 Change-Id: Id83bfd719ec873028f0d4e7e4e4c0702f3bb3dd9
Diffstat (limited to 'core/jni/android')
-rw-r--r--core/jni/android/graphics/Matrix.cpp81
-rw-r--r--core/jni/android/graphics/Paint.cpp109
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) {