summaryrefslogtreecommitdiffstats
path: root/core/jni/android/graphics/Matrix.cpp
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2014-03-31 16:52:13 -0400
committerLeon Scroggins III <scroggo@google.com>2014-04-04 14:42:39 -0400
commitcc11f15f76a62ded3e403cb2bc818c6aa5bf261c (patch)
tree1df94766a0343820a8b542d3a79705a33d9fcf59 /core/jni/android/graphics/Matrix.cpp
parent35dec44394358bac2cdf31d5e8377687a1723476 (diff)
downloadframeworks_base-cc11f15f76a62ded3e403cb2bc818c6aa5bf261c.zip
frameworks_base-cc11f15f76a62ded3e403cb2bc818c6aa5bf261c.tar.gz
frameworks_base-cc11f15f76a62ded3e403cb2bc818c6aa5bf261c.tar.bz2
Update to call new Skia APIs.
I816129d49c0118453222916f3c818eccac33663d merges a new version of Skia that updates various APIs. Call the new ones. SkBitmap::copyTo now takes an SkColorType instead of an SkBitmap::Config, so do the conversion with SkBitmapConfigToColorType or use the enum when it makes sense. Call SkImageDecoder::decodeSubset instead of (deprecated) SkImageDecoder::decodeRegion. Override SkCanvas::ClipVisitor::clipRRect in ClipCopier. In Canvas::clip calls, call SkCanvas::isClipEmpty(), which was previously called inside the clip call, to determine the return value. For various SkPaint effects, call the new factories (as the constructors have been made protected). Implement SkJavaOutputStream::bytesWritten(), overriding a new pure virtual function on SkWStream. Update Matrix calls to always return true (since SkMatrix calls no longer return a value). Depends on I816129d49c0118453222916f3c818eccac33663d (skia). Change-Id: I5cdcea827ebff587df0bbddc0965e3e0fbf48002
Diffstat (limited to 'core/jni/android/graphics/Matrix.cpp')
-rw-r--r--core/jni/android/graphics/Matrix.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/core/jni/android/graphics/Matrix.cpp b/core/jni/android/graphics/Matrix.cpp
index c400c57..d573aa8 100644
--- a/core/jni/android/graphics/Matrix.cpp
+++ b/core/jni/android/graphics/Matrix.cpp
@@ -123,129 +123,129 @@ public:
SkScalar ky_ = SkFloatToScalar(ky);
obj->setSkew(kx_, ky_);
}
- static jboolean setConcat(JNIEnv* env, jobject clazz, jlong objHandle, jlong aHandle, jlong bHandle) {
+ static void setConcat(JNIEnv* env, jobject clazz, jlong objHandle, jlong aHandle, jlong bHandle) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkMatrix* a = reinterpret_cast<SkMatrix*>(aHandle);
SkMatrix* b = reinterpret_cast<SkMatrix*>(bHandle);
- return obj->setConcat(*a, *b) ? JNI_TRUE : JNI_FALSE;
+ obj->setConcat(*a, *b);
}
- static jboolean preTranslate(JNIEnv* env, jobject clazz, jlong objHandle, jfloat dx, jfloat dy) {
+ static void preTranslate(JNIEnv* env, jobject clazz, jlong objHandle, jfloat dx, jfloat dy) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar dx_ = SkFloatToScalar(dx);
SkScalar dy_ = SkFloatToScalar(dy);
- return obj->preTranslate(dx_, dy_) ? JNI_TRUE : JNI_FALSE;
+ obj->preTranslate(dx_, dy_);
}
- static jboolean preScale__FFFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat sx, jfloat sy, jfloat px, jfloat py) {
+ static void preScale__FFFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat sx, jfloat sy, jfloat px, jfloat py) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar sx_ = SkFloatToScalar(sx);
SkScalar sy_ = SkFloatToScalar(sy);
SkScalar px_ = SkFloatToScalar(px);
SkScalar py_ = SkFloatToScalar(py);
- return obj->preScale(sx_, sy_, px_, py_) ? JNI_TRUE : JNI_FALSE;
+ obj->preScale(sx_, sy_, px_, py_);
}
- static jboolean preScale__FF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat sx, jfloat sy) {
+ static void preScale__FF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat sx, jfloat sy) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar sx_ = SkFloatToScalar(sx);
SkScalar sy_ = SkFloatToScalar(sy);
- return obj->preScale(sx_, sy_) ? JNI_TRUE : JNI_FALSE;
+ obj->preScale(sx_, sy_);
}
- static jboolean preRotate__FFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat degrees, jfloat px, jfloat py) {
+ static void preRotate__FFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat degrees, jfloat px, jfloat py) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar degrees_ = SkFloatToScalar(degrees);
SkScalar px_ = SkFloatToScalar(px);
SkScalar py_ = SkFloatToScalar(py);
- return obj->preRotate(degrees_, px_, py_) ? JNI_TRUE : JNI_FALSE;
+ obj->preRotate(degrees_, px_, py_);
}
- static jboolean preRotate__F(JNIEnv* env, jobject clazz, jlong objHandle, jfloat degrees) {
+ static void preRotate__F(JNIEnv* env, jobject clazz, jlong objHandle, jfloat degrees) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar degrees_ = SkFloatToScalar(degrees);
- return obj->preRotate(degrees_) ? JNI_TRUE : JNI_FALSE;
+ obj->preRotate(degrees_);
}
- static jboolean preSkew__FFFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat kx, jfloat ky, jfloat px, jfloat py) {
+ static void preSkew__FFFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat kx, jfloat ky, jfloat px, jfloat py) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar kx_ = SkFloatToScalar(kx);
SkScalar ky_ = SkFloatToScalar(ky);
SkScalar px_ = SkFloatToScalar(px);
SkScalar py_ = SkFloatToScalar(py);
- return obj->preSkew(kx_, ky_, px_, py_) ? JNI_TRUE : JNI_FALSE;
+ obj->preSkew(kx_, ky_, px_, py_);
}
- static jboolean preSkew__FF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat kx, jfloat ky) {
+ static void preSkew__FF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat kx, jfloat ky) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar kx_ = SkFloatToScalar(kx);
SkScalar ky_ = SkFloatToScalar(ky);
- return obj->preSkew(kx_, ky_) ? JNI_TRUE : JNI_FALSE;
+ obj->preSkew(kx_, ky_);
}
- static jboolean preConcat(JNIEnv* env, jobject clazz, jlong objHandle, jlong otherHandle) {
+ static void preConcat(JNIEnv* env, jobject clazz, jlong objHandle, jlong otherHandle) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkMatrix* other = reinterpret_cast<SkMatrix*>(otherHandle);
- return obj->preConcat(*other) ? JNI_TRUE : JNI_FALSE;
+ obj->preConcat(*other);
}
- static jboolean postTranslate(JNIEnv* env, jobject clazz, jlong objHandle, jfloat dx, jfloat dy) {
+ static void postTranslate(JNIEnv* env, jobject clazz, jlong objHandle, jfloat dx, jfloat dy) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar dx_ = SkFloatToScalar(dx);
SkScalar dy_ = SkFloatToScalar(dy);
- return obj->postTranslate(dx_, dy_) ? JNI_TRUE : JNI_FALSE;
+ obj->postTranslate(dx_, dy_);
}
- static jboolean postScale__FFFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat sx, jfloat sy, jfloat px, jfloat py) {
+ static void postScale__FFFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat sx, jfloat sy, jfloat px, jfloat py) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar sx_ = SkFloatToScalar(sx);
SkScalar sy_ = SkFloatToScalar(sy);
SkScalar px_ = SkFloatToScalar(px);
SkScalar py_ = SkFloatToScalar(py);
- return obj->postScale(sx_, sy_, px_, py_) ? JNI_TRUE : JNI_FALSE;
+ obj->postScale(sx_, sy_, px_, py_);
}
- static jboolean postScale__FF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat sx, jfloat sy) {
+ static void postScale__FF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat sx, jfloat sy) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar sx_ = SkFloatToScalar(sx);
SkScalar sy_ = SkFloatToScalar(sy);
- return obj->postScale(sx_, sy_) ? JNI_TRUE : JNI_FALSE;
+ obj->postScale(sx_, sy_);
}
- static jboolean postRotate__FFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat degrees, jfloat px, jfloat py) {
+ static void postRotate__FFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat degrees, jfloat px, jfloat py) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar degrees_ = SkFloatToScalar(degrees);
SkScalar px_ = SkFloatToScalar(px);
SkScalar py_ = SkFloatToScalar(py);
- return obj->postRotate(degrees_, px_, py_) ? JNI_TRUE : JNI_FALSE;
+ obj->postRotate(degrees_, px_, py_);
}
- static jboolean postRotate__F(JNIEnv* env, jobject clazz, jlong objHandle, jfloat degrees) {
+ static void postRotate__F(JNIEnv* env, jobject clazz, jlong objHandle, jfloat degrees) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar degrees_ = SkFloatToScalar(degrees);
- return obj->postRotate(degrees_) ? JNI_TRUE : JNI_FALSE;
+ obj->postRotate(degrees_);
}
- static jboolean postSkew__FFFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat kx, jfloat ky, jfloat px, jfloat py) {
+ static void postSkew__FFFF(JNIEnv* env, jobject clazz, jlong objHandle, jfloat kx, jfloat ky, jfloat px, jfloat py) {
SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle);
SkScalar kx_ = SkFloatToScalar(kx);
SkScalar ky_ = SkFloatToScalar(ky);
SkScalar px_ = SkFloatToScalar(px);
SkScalar py_ = SkFloatToScalar(py);
- return obj->postSkew(kx_, ky_, px_, py_) ? JNI_TRUE : JNI_FALSE;
+ obj->postSkew(kx_, ky_, px_, py_);
}
- static jboolean postSkew__FF(JNIEnv* env, jobject clazz, jlong matrixHandle, jfloat kx, jfloat ky) {
+ static void postSkew__FF(JNIEnv* env, jobject clazz, jlong matrixHandle, jfloat kx, jfloat ky) {
SkMatrix* matrix = reinterpret_cast<SkMatrix*>(matrixHandle);
SkScalar kx_ = SkFloatToScalar(kx);
SkScalar ky_ = SkFloatToScalar(ky);
- return matrix->postSkew(kx_, ky_) ? JNI_TRUE : JNI_FALSE;
+ matrix->postSkew(kx_, ky_);
}
- static jboolean postConcat(JNIEnv* env, jobject clazz, jlong matrixHandle, jlong otherHandle) {
+ static void postConcat(JNIEnv* env, jobject clazz, jlong matrixHandle, jlong otherHandle) {
SkMatrix* matrix = reinterpret_cast<SkMatrix*>(matrixHandle);
SkMatrix* other = reinterpret_cast<SkMatrix*>(otherHandle);
- return matrix->postConcat(*other) ? JNI_TRUE : JNI_FALSE;
+ matrix->postConcat(*other);
}
static jboolean setRectToRect(JNIEnv* env, jobject clazz, jlong matrixHandle, jobject src, jobject dst, jint stfHandle) {
@@ -374,23 +374,23 @@ static JNINativeMethod methods[] = {
{"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)Z", (void*) SkMatrixGlue::setConcat},
- {"native_preTranslate","(JFF)Z", (void*) SkMatrixGlue::preTranslate},
- {"native_preScale","(JFFFF)Z", (void*) SkMatrixGlue::preScale__FFFF},
- {"native_preScale","(JFF)Z", (void*) SkMatrixGlue::preScale__FF},
- {"native_preRotate","(JFFF)Z", (void*) SkMatrixGlue::preRotate__FFF},
- {"native_preRotate","(JF)Z", (void*) SkMatrixGlue::preRotate__F},
- {"native_preSkew","(JFFFF)Z", (void*) SkMatrixGlue::preSkew__FFFF},
- {"native_preSkew","(JFF)Z", (void*) SkMatrixGlue::preSkew__FF},
- {"native_preConcat","(JJ)Z", (void*) SkMatrixGlue::preConcat},
- {"native_postTranslate","(JFF)Z", (void*) SkMatrixGlue::postTranslate},
- {"native_postScale","(JFFFF)Z", (void*) SkMatrixGlue::postScale__FFFF},
- {"native_postScale","(JFF)Z", (void*) SkMatrixGlue::postScale__FF},
- {"native_postRotate","(JFFF)Z", (void*) SkMatrixGlue::postRotate__FFF},
- {"native_postRotate","(JF)Z", (void*) SkMatrixGlue::postRotate__F},
- {"native_postSkew","(JFFFF)Z", (void*) SkMatrixGlue::postSkew__FFFF},
- {"native_postSkew","(JFF)Z", (void*) SkMatrixGlue::postSkew__FF},
- {"native_postConcat","(JJ)Z", (void*) SkMatrixGlue::postConcat},
+ {"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},