summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorShirleen Lou <xlou@chromium.org>2017-11-18 00:13:45 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-18 00:13:45 +0000
commit07b4727a34d2f4aff851f0dc420faf617caca220 (patch)
treeb0290d7c6584be36e76a6892bd285afaf1b99461 /public
parentec2209da158750beeeaeaab5dd68e58424921c4a (diff)
downloadpdfium-07b4727a34d2f4aff851f0dc420faf617caca220.tar.xz
Make clip optional in FPDFPage_TransFormWithClip.chromium/3273
Add checks for matrix and clipRect in function FPDFPage_TransFormWithClip. If both are null, abort transformation. If either is null, skip that particular transaction. Change-Id: I65611508c064c0b929a11eace99ad532d3402138 Reviewed-on: https://pdfium-review.googlesource.com/18710 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_transformpage.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/public/fpdf_transformpage.h b/public/fpdf_transformpage.h
index f26c077bde..a6ed04a511 100644
--- a/public/fpdf_transformpage.h
+++ b/public/fpdf_transformpage.h
@@ -84,15 +84,19 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GetCropBox(FPDF_PAGE page,
float* top);
/**
-* Transform the whole page with a specified matrix, then clip the page content
-* region.
-*
-* @param[in] page - A page handle.
-* @param[in] matrix - The transform matrix.
-* @param[in] clipRect - A rectangle page area to be clipped.
-* @Note. This function will transform the whole page, and would take effect to
-* all the objects in the page.
-*/
+ * Apply transforms to |page|.
+ *
+ * If |matrix| is provided it will be applied to transform the page.
+ * If |clipRect| is provided it will be used to clip the resulting page.
+ * If neither |matrix| or |clipRect| are provided this method returns |false|.
+ * Returns |true| if transforms are applied.
+ *
+ * @param[in] page - Page handle.
+ * @param[in] matrix - Transform matrix.
+ * @param[in] clipRect - Clipping rectangle.
+ * @Note. This function will transform the whole page, and would take effect to
+ * all the objects in the page.
+ */
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFPage_TransFormWithClip(FPDF_PAGE page,
FS_MATRIX* matrix,