summaryrefslogtreecommitdiff
path: root/core/fxge/dib/cfx_imagetransformer.cpp
AgeCommit message (Collapse)Author
2017-12-08Fix an LLVM error caused by assigning a uint32_t to an int without a castAndrew Weintraub
Bug: Change-Id: I394fb3c6df95d5170302731fd33ef523a38f070c Reviewed-on: https://pdfium-review.googlesource.com/20630 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-12-05Avoid integer overflows in CPDF_FixedMatrix::Transform().Lei Zhang
Use floating point math and saturated_cast to calculate the transform. Refactor CFX_BilinearMatrix::Transform() to share common code, instead of using integer math and CheckedNumerics. BUG=chromium:791048 Change-Id: Ib3812b3b3b9373a8eb3b1dde12cb28d424e0bb3e Reviewed-on: https://pdfium-review.googlesource.com/20390 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-12-04Simplify color calculations in CFX_ImageTransformer.Lei Zhang
Change-Id: I14e614dbd0b7c1187b686bf574d14b94f04a3e7e Reviewed-on: https://pdfium-review.googlesource.com/20271 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-04Simplify code in CFX_ImageTransformer.Lei Zhang
Also fix lint errors. Change-Id: Iaf5fb440fd43d5c36b00630e16d700827c09fc7f Reviewed-on: https://pdfium-review.googlesource.com/20270 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-04Refactor CFX_ImageTransformer down sample calculations.Lei Zhang
Change-Id: Ib3aa0b6ce2fa7b2a643068cb9ffcaca9fe18d3de Reviewed-on: https://pdfium-review.googlesource.com/20258 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-04Refactor CFX_ImageTransformer bicubic calculations.Lei Zhang
Change-Id: I47c0ae6dbdf339ab7ade36b141c220b8a3fb2274 Reviewed-on: https://pdfium-review.googlesource.com/20257 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-04Refactor CFX_ImageTransformer bilinear calculations.Lei Zhang
Change-Id: Ia38329bf5622c0ae6f5c4173332d2140de08c567 Reviewed-on: https://pdfium-review.googlesource.com/20256 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-04Break out CFX_ImageTransformer color calculations.Lei Zhang
Change-Id: I5d3a01310bd5fcddbb8c39025b07a2e83ddae84f Reviewed-on: https://pdfium-review.googlesource.com/20255 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-04Break out CFX_ImageTransformer mono calculations.Lei Zhang
Change-Id: Ibd9ca20e902bbd2b62af12d25836497413912b1b Reviewed-on: https://pdfium-review.googlesource.com/20254 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-04Break out CFX_ImageTransformer alpha calculations.Lei Zhang
Change-Id: I4f221d5d6c17e8507f87d9c63b87431cc2b8f45e Reviewed-on: https://pdfium-review.googlesource.com/20253 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-04Break out CFX_ImageTransformer mask calculations.Lei Zhang
Change-Id: Iab7ff29c2ce9ed56715b5897e89da2d9d693583c Reviewed-on: https://pdfium-review.googlesource.com/20252 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-04Add functions for common code in CFX_ImageTransformer.Lei Zhang
Change-Id: I556934f61f24883e684865e4a8fc5e0519248cee Reviewed-on: https://pdfium-review.googlesource.com/20251 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-09-21Rename CFX_RetainPtr to RetainPtrDan Sinclair
This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e Reviewed-on: https://pdfium-review.googlesource.com/14616 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-31Split IFX_Pause out of fx_basicDan Sinclair
This CL moves IFX_Pause out to its own class from fx_basic and updates includes as needed. Change-Id: Iebdd183d8c85aa17570f190f1a7d1602c0af3c8b Reviewed-on: https://pdfium-review.googlesource.com/12491 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-22Converted CFX_Matrix::TransformRect() to take in constsJane Liu
Currently, all three of CFX_Matrix::TransformRect() take in rect values and modify them in place. This CL converts them to take in constant values and return the transformed values instead, and fixes all the call sites. Bug=pdfium:874 Change-Id: I9c274df3b14e9d88c100ba0530068e06e8fec32b Reviewed-on: https://pdfium-review.googlesource.com/11550 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-06-29Move Start to constructor in CFX_Image(Renderer|Transformer)chromium/3145Nicolas Pena
The bool returned by Start was not being used and the method was always called right after the constructor, so it should be in the constructor. Change-Id: I98abf9f7c11fbe42b3aa15ec5e46731198aa23d5 Reviewed-on: https://pdfium-review.googlesource.com/7151 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-06-29Change SetReverse to GetInverse in CFX_MatrixNicolas Pena
CFX_Matrix::GetInverse is much clearer. Change-Id: Id10ab1723735332e1a78de853f28415ec3a4d834 Reviewed-on: https://pdfium-review.googlesource.com/7090 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-05-18Fix typo in CFX_ImageTransformer::ContinueNicolas Pena
This CL fixes a typo introduced in: https://pdfium-review.googlesource.com/c/4495/3/core/fxge/dib/cfx_imagetransformer.cpp#395 Bug: chromium:723976 Change-Id: I629d1e61054805f768356fce44c25f40f9346beb Reviewed-on: https://pdfium-review.googlesource.com/5634 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-05-11Use clamp() in a couple more places.Lei Zhang
Change-Id: I9b7a1c101e3c73d0270f9216225e5a13d9937b97 Reviewed-on: https://pdfium-review.googlesource.com/5332 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-05-05More unused IFX_Pause parameters removedchromium/3091Dan Sinclair
Remove IFX_Pause parameters which are passed but not used. Change-Id: I51a491c7f9a429676d114a387390fac3ae65e187 Reviewed-on: https://pdfium-review.googlesource.com/4950 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-26Guard against overflow in CFX_BilinearMatrix code.Dan Sinclair
If any of the values in the matrix used to initialize the CFX_BilinearMatrix are close to INT_MAX then the numbers can overflow when multipled causing undefined behaviour. This Cl uses a pdfium::CheckedNumeric to handle the multiplications and then assigns back to the int value if valid. Bug: chromium:702041 Change-Id: Ia1895e2e39c0ac2bf099d45f97e33209cb50d134 Reviewed-on: https://pdfium-review.googlesource.com/4495 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-04Remove dib_int.hNicolas Pena
This CL removes dib_int.h by moving CStretchEngine to its own file, other classes to where they are used, and the remaining to fx_dib.h. Change-Id: Ie2d4bb39389737cd631f92b88000ea942608da21 Reviewed-on: https://pdfium-review.googlesource.com/3714 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-04-03Drop FXSYS_ from math methodsDan Sinclair
This Cl drops the FXSYS_ from math methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I85c9ff841fd9095b1434f67319847ba0cd9df7ac Reviewed-on: https://pdfium-review.googlesource.com/3598 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-03Split fx_dib part 5Nicolas Pena
Move more classes into their own files. Change-Id: Ic505be9e406eafb378235216ea19221ce172f32e Reviewed-on: https://pdfium-review.googlesource.com/3593 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-31Split fx_dib part 3Nicolas Pena
Moved CFX_ImageRenderer, CFX_ImageTransformer to their own files. Change-Id: Ic98403f62bea317600a933f79946a2a9bad30eeb Reviewed-on: https://pdfium-review.googlesource.com/3551 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>