diff options
author | Svetoslav <svetoslavganov@google.com> | 2014-04-24 18:40:42 -0700 |
---|---|---|
committer | Svetoslav <svetoslavganov@google.com> | 2014-05-13 18:32:42 -0700 |
commit | 2961769ea94f69c191a2dd785b2504666c7292d0 (patch) | |
tree | e5bf30a50c60df65889a60b2c7070300a8212393 /core/jni/android/graphics/Matrix.cpp | |
parent | bee74c2b479153bb6a4b9e03f068658042a5fdfc (diff) | |
download | frameworks_base-2961769ea94f69c191a2dd785b2504666c7292d0.zip frameworks_base-2961769ea94f69c191a2dd785b2504666c7292d0.tar.gz frameworks_base-2961769ea94f69c191a2dd785b2504666c7292d0.tar.bz2 |
Adding APIs to render PDF documents.
We need to render PDF documents for two main use cases. First,
for print preview. Second, for resterizing the PDF document by
a print service before passing it to a printer which does not
natively support PDF (most consumer ones).
Adding PDF rendering APIs improves guarantees for print quality
as the same library is used for preview and rasterization. Also
print vendors do not have to license third-party rendering engines.
Last but not least as the platform uses PDF as its main print
format it should also be able to natively render it.
Change-Id: I57004a435db147663cafea40cf3296465aba7f99
Diffstat (limited to 'core/jni/android/graphics/Matrix.cpp')
-rw-r--r-- | core/jni/android/graphics/Matrix.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/jni/android/graphics/Matrix.cpp b/core/jni/android/graphics/Matrix.cpp index 23af860..cbd20e9 100644 --- a/core/jni/android/graphics/Matrix.cpp +++ b/core/jni/android/graphics/Matrix.cpp @@ -50,10 +50,17 @@ public: SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle); return obj->isIdentity() ? JNI_TRUE : JNI_FALSE; } + + static jboolean isAffine(JNIEnv* env, jobject clazz, jlong objHandle) { + SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle); + return obj->asAffine(NULL) ? JNI_TRUE : JNI_FALSE; + } + static jboolean rectStaysRect(JNIEnv* env, jobject clazz, jlong objHandle) { SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle); return obj->rectStaysRect() ? JNI_TRUE : JNI_FALSE; } + static void reset(JNIEnv* env, jobject clazz, jlong objHandle) { SkMatrix* obj = reinterpret_cast<SkMatrix*>(objHandle); obj->reset(); @@ -302,6 +309,7 @@ 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}, |