summaryrefslogtreecommitdiffstats
path: root/external/pdfium/0006-Add-FPDFPath_GetMatrix-and-FPDFPath_SetMatrix-APIs.patch.1
diff options
context:
space:
mode:
Diffstat (limited to 'external/pdfium/0006-Add-FPDFPath_GetMatrix-and-FPDFPath_SetMatrix-APIs.patch.1')
-rw-r--r--external/pdfium/0006-Add-FPDFPath_GetMatrix-and-FPDFPath_SetMatrix-APIs.patch.1143
1 files changed, 143 insertions, 0 deletions
diff --git a/external/pdfium/0006-Add-FPDFPath_GetMatrix-and-FPDFPath_SetMatrix-APIs.patch.1 b/external/pdfium/0006-Add-FPDFPath_GetMatrix-and-FPDFPath_SetMatrix-APIs.patch.1
new file mode 100644
index 000000000000..655d040f6888
--- /dev/null
+++ b/external/pdfium/0006-Add-FPDFPath_GetMatrix-and-FPDFPath_SetMatrix-APIs.patch.1
@@ -0,0 +1,143 @@
+From 97f4d67fbf0707feea298afa2f6471013185e066 Mon Sep 17 00:00:00 2001
+Date: Mon, 4 Jun 2018 14:47:17 +0000
+Subject: [PATCH] Add FPDFPath_GetMatrix() and FPDFPath_SetMatrix() APIs
+
+This is similar to the existing FPDFImageObj_SetMatrix(), but this
+exposes the matrix of CPDF_PathObject and provides both a getter and a
+setter.
+
+Change-Id: Ib90a64929dae1b2be3889eca57e4af822d7823be
+Reviewed-on: https://pdfium-review.googlesource.com/33670
+Reviewed-by: dsinclair <dsinclair@chromium.org>
+Commit-Queue: dsinclair <dsinclair@chromium.org>
+---
+ fpdfsdk/fpdf_edit_embeddertest.cpp | 30 +++++++++++++++++++++++
+ fpdfsdk/fpdf_editpath.cpp | 49 +++++++++++++++++++++++++++++++++++++
+ fpdfsdk/fpdf_view_c_api_test.c | 2 ++
+ public/fpdf_edit.h | 50 ++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 131 insertions(+)
+
+diff --git a/fpdfsdk/fpdf_editpath.cpp b/fpdfsdk/fpdf_editpath.cpp
+index 558a8e3de..368c37416 100644
+--- a/fpdfsdk/fpdf_editpath.cpp
++++ b/fpdfsdk/fpdf_editpath.cpp
+@@ -253,6 +253,55 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetDrawMode(FPDF_PAGEOBJECT path,
+ return true;
+ }
+
++FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetMatrix(FPDF_PAGEOBJECT path,
++ double* a,
++ double* b,
++ double* c,
++ double* d,
++ double* e,
++ double* f) {
++ if (!path || !a || !b || !c || !d || !e || !f)
++ return false;
++
++ CPDF_PathObject* pPathObj = CPDFPathObjectFromFPDFPageObject(path);
++ if (!pPathObj)
++ return false;
++
++ *a = pPathObj->m_Matrix.a;
++ *b = pPathObj->m_Matrix.b;
++ *c = pPathObj->m_Matrix.c;
++ *d = pPathObj->m_Matrix.d;
++ *e = pPathObj->m_Matrix.e;
++ *f = pPathObj->m_Matrix.f;
++
++ return true;
++}
++
++FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetMatrix(FPDF_PAGEOBJECT path,
++ double a,
++ double b,
++ double c,
++ double d,
++ double e,
++ double f) {
++ if (!path)
++ return false;
++
++ CPDF_PathObject* pPathObj = CPDFPathObjectFromFPDFPageObject(path);
++ if (!pPathObj)
++ return false;
++
++ pPathObj->m_Matrix.a = a;
++ pPathObj->m_Matrix.b = b;
++ pPathObj->m_Matrix.c = c;
++ pPathObj->m_Matrix.d = d;
++ pPathObj->m_Matrix.e = e;
++ pPathObj->m_Matrix.f = f;
++ pPathObj->SetDirty(true);
++
++ return true;
++}
++
+ FPDF_EXPORT void FPDF_CALLCONV FPDFPath_SetLineJoin(FPDF_PAGEOBJECT path,
+ int line_join) {
+ if (!path)
+diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h
+index 2faa9ecba..4c870149b 100644
+--- a/public/fpdf_edit.h
++++ b/public/fpdf_edit.h
+@@ -920,6 +920,56 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetDrawMode(FPDF_PAGEOBJECT path,
+ int* fillmode,
+ FPDF_BOOL* stroke);
+
++// Experimental API.
++// Get the transform matrix of a path.
++//
++// path - handle to a path.
++// a - matrix value.
++// b - matrix value.
++// c - matrix value.
++// d - matrix value.
++// e - matrix value.
++// f - matrix value.
++//
++// The matrix is composed as:
++// |a c e|
++// |b d f|
++// and used to scale, rotate, shear and translate the path.
++//
++// Returns TRUE on success.
++FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetMatrix(FPDF_PAGEOBJECT path,
++ double* a,
++ double* b,
++ double* c,
++ double* d,
++ double* e,
++ double* f);
++
++// Experimental API.
++// Set the transform matrix of a path.
++//
++// path - handle to a path.
++// a - matrix value.
++// b - matrix value.
++// c - matrix value.
++// d - matrix value.
++// e - matrix value.
++// f - matrix value.
++//
++// The matrix is composed as:
++// |a c e|
++// |b d f|
++// and can be used to scale, rotate, shear and translate the path.
++//
++// Returns TRUE on success.
++FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetMatrix(FPDF_PAGEOBJECT path,
++ double a,
++ double b,
++ double c,
++ double d,
++ double e,
++ double f);
++
+ // Create a new text object using one of the standard PDF fonts.
+ //
+ // document - handle to the document.
+--
+2.16.4
+