summaryrefslogtreecommitdiff
path: root/core/fxge
AgeCommit message (Collapse)Author
2017-08-23Convert string Find methods to return an OptionalRyan Harrison
The Find and ReverseFind methods for WideString, WideStringC, ByteString, and ByteStringC have been converted from returning a raw FX_STRSIZE, to returning Optional<FX_STRSIZE>, so that success/failure can be indicated without using FX_STRNPOS. This allows for removing FX_STRNPOS and by association makes the conversion of FX_STRSIZE to size_t easier, since it forces checking the return value of Find to be explictly done as well as taking the error value out of the range of FX_STRSIZE. New Contains methods have been added for cases where the success or failure is all the call site to Find cared about, and the actual position was ignored. BUG=pdfium:828 Change-Id: Id827e508c8660affa68cc08a13d96121369364b7 Reviewed-on: https://pdfium-review.googlesource.com/11350 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@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-08-22Check length in CFX_Win32FontInfo::AddInstalledFontNicolas Pena
This CL is a tentative fix for the bug below. The last method in the stack trace is FontEnumProc, which calls AddInstalledFont. This problem was introduced by https://pdfium-review.googlesource.com/c/pdfium/+/10651 Bug: chromium:757388 Change-Id: If089a43367f1106a79276f6b09b6d0546b863e35 Reviewed-on: https://pdfium-review.googlesource.com/11611 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-08-21Converted CFX_FloatRect::{Init|Update}Rect() to take point objectsJane Liu
Converted CFX_FloatRect::Init() and CFX_FloatRect::UpdateRect() to take in a CFX_PointF object instead of two coordinates. Bug=pdfium:770 Change-Id: Ibcb620f192d6c086158c39f23c411777286005d0 Reviewed-on: https://pdfium-review.googlesource.com/11450 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-21Converted DrawCosmeticLine() to take point objectsJane Liu
Converted CFX_RenderDevice::DrawCosmeticLine() and IFX_RenderDeviceDriver:: DrawCosmeticLine() to take in CFX_PointF objects instead of two coordinates per point. Bug=pdfium:769 Change-Id: I6116e4106a61487184a71e79c1dca3a85e8c7c27 Reviewed-on: https://pdfium-review.googlesource.com/11410 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-17Roll build_revision to bff6ee8.Lei Zhang
Also roll buildtools_revision to f90f6a5 and update Android code that did not previously pass the Chromium style plugin. TBR=dsinclair@chromium.org Change-Id: Ifb1193cee8f68ac99a31c8d43195e4d7005eeafb Reviewed-on: https://pdfium-review.googlesource.com/11293 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-08-16Fix another unguarded string element accessRyan Harrison
BUG=chromium:754969 Change-Id: I4f92d301499c658c57393fde01f1252ea84e59a8 Reviewed-on: https://pdfium-review.googlesource.com/11250 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-08-15Change a bunch of methods to take a const CFX_Matrix& param.chromium/3187Lei Zhang
Simplify some code along the way. Change-Id: I0022c8a82188192c63b9ac0bc87e9b9dbf983040 Reviewed-on: https://pdfium-review.googlesource.com/10852 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-15Remove CFDE_RenderDeviceDan Sinclair
This CL removes CFDE_RenderDevice. For most of the proxy'd calls we call the CFX_RenderDevice directly now. To set the clip rect an overload was added to accept a CFX_RectF and handle the casting to FX_RECT. The one needed method, DrawString, is move to a static on CFDE_TextOut. Change-Id: I95ea7e1fa1fd4702074b797c06423c9c9cb51db9 Reviewed-on: https://pdfium-review.googlesource.com/10951 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-10Remove CFDE_PathDan Sinclair
This CL removes CFDE_Path. There is only one method, AddLine which is required, the rest can be removed. That method is moved to CFX_PathData which is what CFDE_Path is appending to anyway. Change-Id: If50af8cf856a9f7379791fe1999174db5fd13e38 Reviewed-on: https://pdfium-review.googlesource.com/10454 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-04Enforce recent VC++ version (2015 or later).Tom Sepez
Remove ifdef'd code for versions we know will no longer work. Change-Id: I036c80168f846df1b98e9df4972f84655e8418fb Reviewed-on: https://pdfium-review.googlesource.com/10051 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-08-04Replace CFX_ByteTextBuf with ostringstream in fx_win32_gdipext.cppHenrique Nakashima
Bug: pdfium:731 Change-Id: I95d7c16e6c30e6675a17505359b5b7ae1dd5ff12 Reviewed-on: https://pdfium-review.googlesource.com/9950 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-03APIs and tests for extracting bitmaps from image objectsJane Liu
Added FPDFImageObj_GetBitmap() that returns the bitmap of an image object, and a FPDFBitmap_GetFormat() that returns the format of a bitmap. * Fixed a small bitmap conversion bug in cfx_dibsource.cpp. * Enabled EmbedderTest::CompareBitmap() to support different formats of bitmaps. * Added an embedder test and a test PDF file with images of many different formats. Bug=pdfium:677 Change-Id: I6a72f9d969cf5f3577db9400ca33197c213622ed Reviewed-on: https://pdfium-review.googlesource.com/9690 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-08-02Replace CFX_ByteTextBuf with ostringstream in cfx_psrenderer.cpp.Henrique Nakashima
Bug: pdfium:731 Change-Id: Iac887a8d3485b5511ec7f3d809efeb8af6ea9ce7 Reviewed-on: https://pdfium-review.googlesource.com/9930 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-08-01Replace raw value for constant error value in string operationsRyan Harrison
Currently Find() and other methods that return a FX_STRSIZE return -1 to indicate error/failure. This means that there is a lot of magic numbers and magic checks floating around. The standard library for similar operations uses a npos constant. This CL implements FX_STRNPOS, and replaces usages of magic number checking. It also does some type cleanup along the way where it was obvious that FX_STRSIZE should be being used. Removing the magic numbers should make eventually changing FX_STRSIZE to be unsigned easier in the future. BUG=pdfium:828 Change-Id: I67e481e44cf2f75a1698afa8fbee4f375a74c490 Reviewed-on: https://pdfium-review.googlesource.com/9651 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-28Convert calls to Mid() to Left() or Right() if possibleRyan Harrison
The various string/byte classes support Mid(), Left(), and Right() for extracting substrings. Mid() can handle all possible cases, but Left() and Right() are useful for common cases and more explicit about what is going on. Calls like Mid(offset, length - offset) can be converted to Right(length - offset). Calls like Mid(0, length) can be converted to Left(length). If the substring being extracted does not extend all the way to one of the edges of the string, then Mid() still needs to be used. BUG=pdfium:828 Change-Id: I2ec46ad3d71aac0f7b513e103c69cbe8c854cf62 Reviewed-on: https://pdfium-review.googlesource.com/9510 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-27Remove single param Mid() method from string classesRyan Harrison
This support is being removed from CFX_ByteString, CFX_ByteStringC, CFX_WideString, and CFX_WideStringC. This standardizes all of these classes to only have one Mid method that takes in 2 params, offset and count. Count now must be positive. The old behaviour of calculating the length for the user if -1 is passed in for the count has been removed. This work is in preperation for converting these classes to not accept negative lengths anywhere and thus make the underlying size type unsigned. BUG=pdfium:828 Change-Id: I5f15e7b7b00b264231817f143e2da88ee6f69e7b Reviewed-on: https://pdfium-review.googlesource.com/9430 Reviewed-by: (OOO Jul 28 - Aug 8) dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-07-27Text Driver: add CLRF characters for new linesrbpotter
CLRF characters seem to still work with label printer drivers, and some users want to preserve these characters when printing. We cannot distinguish new lines due to CLRF characters in the original text from new lines created during layout, so just add the characters to all new lines. Bug: chromium:734850 Change-Id: I4d032a311c33e20a27b2cc1d5d0ba3eb9ef2fd41 Reviewed-on: https://pdfium-review.googlesource.com/9110 Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-07-25flush but do not release skia driverCary Clark
Most calls to the Skia Driver combine flushing the draw cache with deleting the driver itself. Progressive drawing needs to flush the cache to keep drawing in order, but the driver must remain for the next progressive draw. R=dsinclair@chromium.org, hnakashima@chromium.org Bug: pdfium:833 Change-Id: I311f80b2dc0ef6e4df9a3a0f082ae076cb7a591f Reviewed-on: https://pdfium-review.googlesource.com/8890 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-19Rename StringCs c_str() to unterminated_c_str().Tom Sepez
Since there is no guarantee of termination if the StringC was extracted from a snippet of another string. Make it more obvious that things like strlen(str.unterminated_c_str()) might be a bad idea. Change-Id: I7832248ed89ebbddf5c0bcd402aac7d40ec2adc2 Reviewed-on: https://pdfium-review.googlesource.com/8170 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-07-18colortables are unused, so remove plumbingMike Reed
Bug: Change-Id: Ic40d1fce83b6b13f638c522205a765c20f6ccd50 Reviewed-on: https://pdfium-review.googlesource.com/8090 Commit-Queue: Mike Reed <reed@google.com> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Cary Clark <caryclark@google.com>
2017-07-17Move CPWL_Utils Draw methods to CFX_RenderDeviceDan Sinclair
This CL removes the drawing code from the AP stream generation code in CPWL_Utils and places it in CFX_RenderDevice. Change-Id: I5335fc38368740ba3ddc676ee856201a358979fc Reviewed-on: https://pdfium-review.googlesource.com/7715 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-13Rename CPWL_Color to CFX_ColorDan Sinclair
This CL moves fpdfsdk/pdfwindow/cpwl_color to core/fxge/cfx_color. Change-Id: Ia95b7fba2c76a1b9a438014d3598c7aa55bbb2ab Reviewed-on: https://pdfium-review.googlesource.com/7753 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-13fix skiapaths for sparse type1 on macCary Clark
PDFium's native code reverse engineers the glyph code on Mac by taking the character code point, looking up its name in FreeType, and then finding the named glyph's index from CoreGraphics. If the FreeType glyph index and the CoreGraphics index don't match, it uses CoreGraphics' index when drawing. The IDs match except when drawing an embedded Type 1 font tha has been sparsely populated to cut down on the PDF size. R=dsinclair@chromium.org Bug: 738279 Change-Id: I16d993b611afe3b2481b36f886644524c9c351ef Reviewed-on: https://pdfium-review.googlesource.com/7650 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Cary Clark <caryclark@skia.org>
2017-07-13Index_8 no longer supported, upscale to N32Mike Reed
This should unblock the skia-roller Bug:Skia:6828 Change-Id: Id918f017ed69bea9536eb1df8c31d43eac51d680 Reviewed-on: https://pdfium-review.googlesource.com/7730 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
2017-07-12Nits in CFX_RenderDevice and CPDF_ContentParserNicolas Pena
Change-Id: I29f1c4f68356e335cd55e38014699780bf658249 Reviewed-on: https://pdfium-review.googlesource.com/7610 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-07-12support m_bGlyph_AdjustCary Clark
Skia has no direct match for a different 2x3 matrix per glyph -- if the 2x3 is a square scale with rotation, we can do that with RSX transforms. The bug used the 2x3 to do a condensed face, which we can do with SkPaint::setTextScaleX. Otherwise, we draw a character at a time. R=dsinclair@chromium.org,npm@chromium.org Bug: 736703 Change-Id: I8f14fd63ffdaee886b63d1154b771f9de092a83f Reviewed-on: https://pdfium-review.googlesource.com/7272 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-07-12Move CMYKtoRGB methods to fx_codec and clean them upNicolas Pena
This CL moves CMYKtoRGB methods to fx_codec. It also cleans them up a bit, including allowing them to return tuples instead of having non-const refs in their parameters. Change-Id: Ib3ec45102ec7eff623cd07a624e852d39bf335e4 Reviewed-on: https://pdfium-review.googlesource.com/7591 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-11Cleanup CFX_RenderDeviceNicolas Pena
This CL adds some helper namespace methods and cleans up methods. Change-Id: I7ef51dd1ff365d307694a10519d532698ee39211 Reviewed-on: https://pdfium-review.googlesource.com/7550 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-11Add Windows generic / text only printer driver support.rbpotter
BUG=chromium:734850 Change-Id: Icc0947e2e99e77a36d8963fcf0b6d3deea161d3e Reviewed-on: https://pdfium-review.googlesource.com/7194 Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-07-10Move core/fxge/ge to core/fxge.Dan Sinclair
This brings the cpp and h files together and removes the redundant ge/ path. Change-Id: I36594b8ae719d362768ba4c2e4ce173e287363eb Reviewed-on: https://pdfium-review.googlesource.com/7452 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-10Reland "typeface double delete"Dan Sinclair
This reverts commit 75e1ab05e731d99b9acdc86de47640720e848415. Reason for revert: Using the custom skia smart pointer is the correct approach over CFX_UnownedPtr. Original change's description: > Revert "typeface double delete" > > This reverts commit ddf2418ba8e5d925909d7955ac22b33f37ccce44. > > Reason for revert: not right > > Original change's description: > > typeface double delete > > > > SkTypeface was doubly deleted at pdfium teardown > > SkTypeface has two pointers but no owners. > > Making the font cache an owner fixes the bug but > > violates checkdeps rules. Let me know what to > > do about that. > > > > R=​dsinclair@chromium.org,npm@chromium.org > > Bug: 736133 > > Change-Id: I756a41258a5ac86e70139d7a587c5da9bb7a707b > > Reviewed-on: https://pdfium-review.googlesource.com/7270 > > Reviewed-by: Nicolás Peña <npm@chromium.org> > > Commit-Queue: Cary Clark <caryclark@google.com> > > TBR=dsinclair@chromium.org,caryclark@google.com,npm@chromium.org,caryclark@skia.org > > Change-Id: I255f50acf2cbaecc85b8e5ac3893c1fbc77b6492 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 736133 > Reviewed-on: https://pdfium-review.googlesource.com/7310 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=dsinclair@chromium.org,caryclark@google.com,npm@chromium.org,caryclark@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 736133 Change-Id: I0ab949e9da2fdab9559e7ffe0ceed24d8eb9b66a Reviewed-on: https://pdfium-review.googlesource.com/7510 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-07Check that there is enough data remaining in source BMP before readingchromium/3152Ryan Harrison
When reading in a BMP, after processing the header, make sure that there is enough data remaining in the source before proceeding. If not signal that the BMP is improperly formatted. BUG=chromium:738635 Change-Id: I506bc0e6db7dcd4b5984fd91a1f39516320a2037 Reviewed-on: https://pdfium-review.googlesource.com/7280 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-07-06Revert "typeface double delete"Cary Clark
This reverts commit ddf2418ba8e5d925909d7955ac22b33f37ccce44. Reason for revert: not right Original change's description: > typeface double delete > > SkTypeface was doubly deleted at pdfium teardown > SkTypeface has two pointers but no owners. > Making the font cache an owner fixes the bug but > violates checkdeps rules. Let me know what to > do about that. > > R=​dsinclair@chromium.org,npm@chromium.org > Bug: 736133 > Change-Id: I756a41258a5ac86e70139d7a587c5da9bb7a707b > Reviewed-on: https://pdfium-review.googlesource.com/7270 > Reviewed-by: Nicolás Peña <npm@chromium.org> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=dsinclair@chromium.org,caryclark@google.com,npm@chromium.org,caryclark@skia.org Change-Id: I255f50acf2cbaecc85b8e5ac3893c1fbc77b6492 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 736133 Reviewed-on: https://pdfium-review.googlesource.com/7310 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
2017-07-05typeface double deletechromium/3150Cary Clark
SkTypeface was doubly deleted at pdfium teardown SkTypeface has two pointers but no owners. Making the font cache an owner fixes the bug but violates checkdeps rules. Let me know what to do about that. R=dsinclair@chromium.org,npm@chromium.org Bug: 736133 Change-Id: I756a41258a5ac86e70139d7a587c5da9bb7a707b Reviewed-on: https://pdfium-review.googlesource.com/7270 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Cary Clark <caryclark@google.com>
2017-07-05additional clip debuggingCary Clark
Add debugging for bounding clip boxes Add debugging to dump save count (probably not useful) Make debugging output easier to find R=dsinclair@chromium.org,npm@chromium.org Bug: Change-Id: I4b985b8810c80a3061a11401e26a065d17236604 Reviewed-on: https://pdfium-review.googlesource.com/7278 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Cary Clark <caryclark@google.com>
2017-07-05maintain ClipBoxCary Clark
GetClipBox returned wrong clip bounds Found tracing through looking for other bugs. GetClipBox is used by graphics outside of Skia so it needs to be kept up to date. R=dsinclair@chromium.org,npm@chromium.org Bug: 736703 Change-Id: I2b3fdfe91053848243e5b486a2615a233654c5a9 Reviewed-on: https://pdfium-review.googlesource.com/7274 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Cary Clark <caryclark@google.com>
2017-07-05set clip rectCary Clark
clip rect should mirror existing construction Also found tracing. Keep the clip rect in sync with its expected value for compatibility. R=dsinclair@chromium.org,npm@chromium.org Bug: 736703 Change-Id: I57bab209f5e1febb5fbcd91860b43296063f1f80 Reviewed-on: https://pdfium-review.googlesource.com/7275 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Cary Clark <caryclark@google.com>
2017-07-05show original text to aid in debuggingCary Clark
disabled by default R=dsinclair@chromium.org,npm@chromium.org Bug: Change-Id: Iab08a7120d28b2d81a5e1d4768fd95a460208ebf Reviewed-on: https://pdfium-review.googlesource.com/7277 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Cary Clark <caryclark@google.com>
2017-07-05fix fuzzer generated out of rangeCary Clark
I could not get this to reproduce. It was also reported in April, but I marked it fixed because I couldn't reproduce this then, either. I suspect that the result of LineSide() is +/-inf, causing either minBounds or maxBounds in ClipAngledGradient() to be set to -1, triggering the stack buffer misread. R=dsinclair@chromium.org,npm@chromium.org Bug: 736574 Change-Id: Id828321f8c5481b862822be43d76a41dd8e74ef0 Reviewed-on: https://pdfium-review.googlesource.com/7273 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Cary Clark <caryclark@google.com>
2017-07-05clip save off by oneCary Clark
Code around this bug was altered in April to fix the off by one bug, but somehow the loop counter fix was overlooked. R=dsinclair@chromium.org,npm@chromium.org Bug: 736195 Change-Id: I583a9f2389e6111ae1b847b961afaafd5e854810 Reviewed-on: https://pdfium-review.googlesource.com/7276 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Cary Clark <caryclark@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-06-27Converting CFX_ByteTextBuf to ostringstream in cfx_fontmapper.cpp.Henrique Nakashima
Bug: pdfium:731 Change-Id: I9453f28a17dd34908e6dcc97ea27e5ee84eda2d1 Reviewed-on: https://pdfium-review.googlesource.com/7011 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-23Cleaning up fx_string_testhelpers.Henrique Nakashima
This is unused except for being a pathway for indirect deps. Change-Id: I717290235ccbc59429ad24231033382958e2a086 Reviewed-on: https://pdfium-review.googlesource.com/6910 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-06-14Fix crash when inserting empty pathNicolas Pena
The path creation method begins with an open MoveTo point. If nothing else is added, CFX_PathData::GetBoundingBox will try an OOB access in its m_Points. This CL adds a check similar to the one in CPDF_StreamContentParser::AddPathObject. Change-Id: Iec7cfe3379253c021ba7d5f276306a66009f84e2 Reviewed-on: https://pdfium-review.googlesource.com/6593 Commit-Queue: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-05-26Fix CPDF_PageRenderContext cleanupTom Sepez
Make CFX_RenderDevice, which owns the IFX_RenderDeviceDriver, responsible for restoring driver state as part of its destruction so that its callers don't have to do so out of turn. Then re-order CPDF_PageRenderContext destruction order so that the progressive renderer is destroyed before the device, and the device destroyed before the options because of unowned pointers to objects owned by these. Bug: 726755 Change-Id: I9a6f23da12140b2758b86e6f33f715ad1c679c3f Reviewed-on: https://pdfium-review.googlesource.com/6073 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-05-26Add public API for setting LineJoin and LineCap on a pathwileyrya
BUG=pdfium:718 R=npm@chromium.org Change-Id: Icdc1546c87a676a7d05330dece2c5eacd92c0c92 Reviewed-on: https://pdfium-review.googlesource.com/5951 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-05-25Mass conversion of remaining class members (non-xfa)Tom Sepez
Change-Id: I8365ba80e3395d59a3cf35dbd9d9162e86e712e3 Reviewed-on: https://pdfium-review.googlesource.com/5970 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-05-25Remove some unused definesDan Sinclair
Change-Id: Id816174391ee3a5612fb22df0b4c15fb3112cc8d Reviewed-on: https://pdfium-review.googlesource.com/5954 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>