Merge "Handle PDFium API change" into pi-dev

am: 173d0e9b34

Change-Id: Iafba2d3de659e740be244cc506e6ecf770b0e079
This commit is contained in:
Philip P. Moltmann
2018-03-20 21:47:38 +00:00
committed by android-build-merger

View File

@@ -92,20 +92,7 @@ static void nativeRenderPage(JNIEnv* env, jclass thiz, jlong documentPtr, jlong
renderFlags |= FPDF_PRINTING;
}
// PDF's coordinate system origin is left-bottom while in graphics it
// is the top-left. So, translate the PDF coordinates to ours.
SkMatrix reflectOnX = SkMatrix::MakeScale(1, -1);
SkMatrix moveUp = SkMatrix::MakeTrans(0, FPDF_GetPageHeight(page));
SkMatrix coordinateChange = SkMatrix::Concat(moveUp, reflectOnX);
// Apply the transformation
SkMatrix matrix;
if (transformPtr == 0) {
matrix = coordinateChange;
} else {
matrix = SkMatrix::Concat(*reinterpret_cast<SkMatrix*>(transformPtr), coordinateChange);
}
SkMatrix matrix = *reinterpret_cast<SkMatrix*>(transformPtr);
SkScalar transformValues[6];
if (!matrix.asAffine(transformValues)) {
jniThrowException(env, "java/lang/IllegalArgumentException",