summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-12-07Catch stray Retains() and Releases() outside of RetainPtr<>.tsepez
The previous CLs made the code clean, so now we can mark more things private, and add friends as appropriate. Review-Url: https://codereview.chromium.org/2560783003
2016-12-07Refcount IFGAS_ streams all the time, tootsepez
IFGAS_Streams are not part of the IFX_Stream hierarchy, but can be made from such. Review-Url: https://codereview.chromium.org/2559763002
2016-12-07Fix the way to check terminal field in interactive formchromium/2945weili
Originally the key "T" was checked which was not correct since that key is optional. Now change to check "FT" as well as its parent's key since this key is also inheritable. BUG=chromium:440132 Review-Url: https://codereview.chromium.org/2554223002
2016-12-07Refcount all the IFX_ stream classes all the time.tsepez
We can remove a lot of "bOwnsStream" logic in the process. Always pass these by const reference, in case the called method wants to hang on to the stream (one exception is where we stick a raw pointer into a void* slot in a context from another layer). Review-Url: https://codereview.chromium.org/2451493002
2016-12-06re-enable skia cachingchromium/2944caryclark
This permits consecutive path drawing or text drawing to combine if their graphics state matches. This speeds up rendering considerably when PDFium draws in many small parts. It also allows discarding changes to the clip state that have no effect from draw to draw. All corpus tests draw equivalently with caching enabled or disabled. Change the member order in CPDF_PageRenderContext so the device is flushed before the referencing annotation is deleted. Add more printf style debugging for test draws. R=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2546803003
2016-12-06Fix FPDF_GetPageLabel API typo.dsinclair
The API was originally committed as FPDF_GetPagelLabel but should be FPDF_GetPageLabel. BUG=pdfium:479 Review-Url: https://codereview.chromium.org/2559513002
2016-12-06Return unique_ptrs from CFX_DIBitmap::Clone().tsepez
Because that's what clone does. Perform immediate release in some spots to avoid disrupting too much at once. Review-Url: https://codereview.chromium.org/2534953004
2016-12-05Fix a leak when TIFFRGBAImageBegin failschromium/2943npm
The method to create image can fail even after ycbcr has been set, so the current way to release is not enough. TIFFRGBAImageEnd is safe in that it checks for existence before deleting, and deletes whatever has been created. BUG=657473 Review-Url: https://codereview.chromium.org/2545723004
2016-12-05[android] Make pdfium_unittests work on Android.jbudorick
This updates test.gni to match chromium as of crrev.com/d29ecfa7dc3ed49a2a49002ab941adb57c53e923, changes how PathService::GetSourceDir behaves on Android, and specifies the runtime test data for test_support. BUG=pdfium:415 Review-Url: https://codereview.chromium.org/2541503002
2016-12-05enable skia gradients, fix bugscaryclark
Allow shading to use Skia for some gradients; linear, radial, and coons patch. The corpus uncovered a few gradient-related bugs in the Skia driver which are fixed as well. Fix corpus 11.pdf by ignoring zero area filled paths. PDFium uses CFX_PathData::GetZeroAreaPath() to determine if a path that doesn't enclosing anything should be drawn anyway, and CFX_AggDeviceDriver::GetDriverType() returns 1 so that the empty path is tweaked so that it doesn't draw too often. There are no tests in the corpus that show the utility of this approach; 11.pdf draws correctly if the zero area paths are ignored. Standardize debugging output so that a separate tool can visualize it. R=dsinclair@chromium.org, thestig@chromium.org Review-Url: https://codereview.chromium.org/2530343004
2016-12-02Rename fpdf_render_image and fpdf_render_textchromium/2942chromium/2941chromium/2940npm
Review-Url: https://codereview.chromium.org/2551593002
2016-12-02Rename IFX_Stream to IFGAS_Stream.tsepez
It's a separate hierarchy unrelated to the IFX_*Stream classes. Also rename CFX_Stream to CFGAS_Stream, and so forth. Review-Url: https://codereview.chromium.org/2535723010
2016-12-02Encode lcms files as utf-8Scott Graham
The diff isn't well displayed in Rietveld, and I had to do some interpretation here, as it wasn't clear what code page these files were pretending to use. The left quotes were 0x92, the right quote + \n had been converted to ?, and the negative infinity was 0x96. (I assume maybe Mac something.) In any case, I tried to interpret the comments and make them something sensible. In the worst case, it's "only" comments that are broken, as no actual code was modified. R=tsepez@chromium.org, brucedawson@chroium.org BUG=637203,454858 Review URL: https://codereview.chromium.org/2545593002 .
2016-12-02Tidy fx_stream.htsepez
Group related IFX_ classes. Move #defines to .cpp file that uses them. Replace loose function with static method. Review-Url: https://codereview.chromium.org/2548583004
2016-12-02Make concrete stream classes private to .cpp, part 4.tsepez
This one is more complicated because we were using stack-based instances of what should have been a Release()-only type. Review-Url: https://codereview.chromium.org/2549573003
2016-12-01Kill off fpdf_render_cache.cppchromium/2939npm
Review-Url: https://codereview.chromium.org/2550543002
2016-12-01Make concrete stream classes private to .cpp, part 3tsepez
Review-Url: https://codereview.chromium.org/2545953002
2016-12-01Make concrete stream classes private to .cpp, part 2tsepez
Fix naming to say "Stream" Review-Url: https://codereview.chromium.org/2543043002
2016-12-01Make more concrete stream classes private to .cpp filestsepez
Review-Url: https://codereview.chromium.org/2545653003
2016-12-01Kill some friends in fpdfapi.tsepez
Review-Url: https://codereview.chromium.org/2546813002
2016-12-01Move Init to constructor in CXFA_FMProgramNicolas Pena
Change-Id: I6b2d1a5b06211b32f3053aad4d7ae7501ec8d8f6 Reviewed-on: https://pdfium-review.googlesource.com/2093 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-12-01Remove fpdf_render.cppNicolas Pena
Split the remaining code into files per class. Change-Id: Idb959dbf807223a509e16c76f9626e61856a886b Reviewed-on: https://pdfium-review.googlesource.com/2094 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2016-12-01Make CPDF_ImageCacheEntry's private CFX_DIBSources unique_ptrsnpm
Review-Url: https://codereview.chromium.org/2541373002
2016-12-01Improve early return in CGifLZWDecoder::Decodenpm
|code_size_cur| could be larger than |code_size|, so |code| could be larger than |code_end|. If this happens, early return, since the Decode has failed. BUG=659417 Review-Url: https://codereview.chromium.org/2542673004
2016-12-01Protect against unexpected library create/destroytsepez
Probably won't fix bug 669797 on its own, but nice to have. Remove unimplemented static method. Review-Url: https://codereview.chromium.org/2543833002
2016-11-30Fix initial kerning when there is a horzscale setchromium/2938npm
Reasoning: the pTextAdvanceX in CPDF_TextObject::CalcPositionData is being multiplied by horz_scale in CPDF_TextObject::CalcPositionData. Then, m_pCurStates->m_TextX is updated by this amount. So multiply by the scale also when updating with initial and final kerning and when nsegs = 0. BUG=528103 Review-Url: https://codereview.chromium.org/2542743002
2016-11-30Convert loose FX_Create* functions into static methodstsepez
Also remove a bool that is always false. Review-Url: https://codereview.chromium.org/2539203002
2016-11-30Remove unused methods from CPDF_FontNicolas Pena
Removed unused methods, and GetCharSize no longer overrides. Change-Id: I29384afb4d79cfd8e8b4ede4a0b52272020bfcd9 Reviewed-on: https://pdfium-review.googlesource.com/2031 Reviewed-by: ooo 11-24 -- 12-05 (dsinclair) <dsinclair@chromium.org>
2016-11-29Add pdfium::MakeRetain<>() helper function.tsepez
Part of the work to get rid of |new|s. Stripped from a forthcoming CL. Review-Url: https://codereview.chromium.org/2536973003
2016-11-29Use unique_ptr in CFXA_FM expressions constructorschromium/2937npm
Review-Url: https://codereview.chromium.org/2534143003
2016-11-29Do not clone in CPDF_ImageCacheEntry::GetCachedBitmapnpm
Review-Url: https://codereview.chromium.org/2536903004
2016-11-28Make FDF document creation return unique_ptrstsepez
Review-Url: https://codereview.chromium.org/2538533003
2016-11-28Use CFX_MaybeOwned<> in fpdf_edit_create.cppchromium/2936tsepez
Fix missing second template parameter in cfx_maybe_owned.h Review-Url: https://codereview.chromium.org/2522313002
2016-11-28Add some methods in CPDF_ImageRenderernpm
Made a member private and added some methods to reduce code duplication Review-Url: https://codereview.chromium.org/2531643002
2016-11-28Fix crash in CFDE_CSSSyntaxParser when parsing empty urlnpm
When parsing "url('')", Subtract() should be called to correctly set m_iDatLen. But iLength will be 0 because there is no url. So I changed the ASSERT. Also replaced some non-const refs with pointers to make the code more readable. BUG=659509 Review-Url: https://codereview.chromium.org/2535663003
2016-11-28Use unique pointers in CXFA_FMParsenpm
Replaced CXFA_FMParse's returns to be unique pointers to prevent leaks. Review-Url: https://codereview.chromium.org/2530933002
2016-11-28Merge CPDF_ImageLoader with its handlenpm
Review-Url: https://codereview.chromium.org/2524403002
2016-11-28Nits in fx_ge_linuxnpm
Moved all CFX_LinuxFontInfo to the namespace. Added its constructor and destructor. And fixed includes and {}s. Review-Url: https://codereview.chromium.org/2529013002
2016-11-28Fix leak in cpdf_document_unittestnpm
Make GetPagesInDisorder be TEST_F instead of TEST for consistency... Call CPDF_ModuleMgr::Destroy() on TearDown to avoid leaks. Review-Url: https://codereview.chromium.org/2528093002
2016-11-28Replace ASSERT with error return in bmp_read_headernpm
The width and compress flag are read, so returning with error is more appropriate than having an ASSERT. BUG=659497 Review-Url: https://codereview.chromium.org/2535863002
2016-11-24Change TxtEdtEngine to return CFX_WideStringchromium/2935chromium/2934chromium/2933chromium/2932dan sinclair
This Cl updates the TxtEdtEngine and TxtEdtBuf to return CFX_WideStrings on a Get instead of taking an out param. The change is propagated out through the various Get methods that call into the edit engine. Change-Id: Iccf10a8ee06678ae3b59f3afd6e65308dacd16bd Reviewed-on: https://pdfium-review.googlesource.com/2070 Commit-Queue: ooo 11-24 -- 12-05 (dsinclair) <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2016-11-23Add CFWL_ListBox::IsMultiSelection().thestig
Review-Url: https://codereview.chromium.org/2527783004
2016-11-23Roll Clang to 0a306690.thestig
Review-Url: https://codereview.chromium.org/2528613003
2016-11-23Merge IFWL and CFWL classes.dsinclair
This CL merges the IFWL hierarchy into the CFWL hierachy. All CFWL proxy methods have been replaced by the IFWL implementations. Review-Url: https://codereview.chromium.org/2524173002
2016-11-23Rename IFWL classes which do not have CFWL equivalentsdsinclair
This CL moves the IFWL classes that do not have CFWL class buddies to have the CFWL name. This CL leaves the tree in a weird state of having CFWL be two hierarchies, one of which is intertwined with the IFWL hierarchy. This should be commited just before the CL to move the rest of IFWL to CFWL. Review-Url: https://codereview.chromium.org/2525083002
2016-11-23Roll pdfium/third_party/catapult/ 327256cb1..86352b966 (1204 commits).jbudorick
https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git/+log/327256cb1c38..86352b966b02 BUG=pdfium:415 Review-Url: https://codereview.chromium.org/2524093004
2016-11-23Add FPDF_RenderPageBitmapWithMatrix API.thestig
BUG=pdfium:522 Review-Url: https://codereview.chromium.org/2526473002
2016-11-23More unique_ptrs in CXFA_FMParse::ParseForeachExpression and avoid leaknpm
Commit a31098417852bdf13e693a6e0913e0706cf94098 accidentally caused a leak. Replaced pointers with unique_ptr to prevent this from happening. BUG=664891 Review-Url: https://codereview.chromium.org/2528543003
2016-11-23Use CFX_MaybeOwned<> in CPDF_Imagetsepez
Review-Url: https://codereview.chromium.org/2523093003
2016-11-23Add CFX_MaybeOwned<> template.tsepez
This will allow us to get rid of more .release()s of unique_ptrs, as shown by the changed cpdf_colorspace usage. Review-Url: https://codereview.chromium.org/2526903002