summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-10-29Do bilinear interpolation for "huge" images.chromium/3596Lei Zhang
Simply downsampling produces really poor renderings. Use bilinear interpolation to make the rendering look better at the cost of being a bit slower. Roll DEPS for testing/corpus/ to 5a68e878 to pick up the updated test expectations from this CL. BUG=chromium:898443 Change-Id: Ifc5fa358a15e4674f431afcbe26e7ab70da58849 Reviewed-on: https://pdfium-review.googlesource.com/c/44651 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-29Fold virtual CPWL_Wnd::OnCreate into subclass constructors.Tom Sepez
All they do is twiddle their own CreateParameters. Since we now have the create paramters earlier, we need not have a special method for this. Change-Id: I5b94c578275c71516afb87bd085f5fb58b3962e2 Reviewed-on: https://pdfium-review.googlesource.com/c/44730 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-26Pass CreateParams to CPWL_Wnd constructor.chromium/3595chromium/3594Tom Sepez
The previous reshuffling means we always have the create params earlier, so pass them in at create time. Clean up two forward declarations that were not needed as noticed in the process. Change-Id: I5d3861f3c1e3508e0d25950e919859244fac5f8b Reviewed-on: https://pdfium-review.googlesource.com/c/44710 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-26Roll testing/corpus/ 502691e08..56802dad1 (1 commit)Lei Zhang
https://pdfium.googlesource.com/pdfium_tests/+log/502691e08e17..56802dad1a70 Created with: roll-dep testing/corpus BUG=chromium:898443 TBR=tsepez@chromium.org Change-Id: I21b370f0fe5331c73be7270815f50ec1cbd70c1a Reviewed-on: https://pdfium-review.googlesource.com/c/44750 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-26Convert CPWL_Wnd::m_Children to vector of unique_ptr.Tom Sepez
Still some lurking ownership issues. Remove checks for null children, since the only way a child gets into this vector is by AddChild(), and that does not operate successfully on null arguments (tries to set the parent in the child). Change-Id: Ic0be6da05d7f7bb8bf1bd19ae6ae0580d2362dfc Reviewed-on: https://pdfium-review.googlesource.com/c/44696 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-26Replace int flags with struct FXDIB_ResampleOptions.Lei Zhang
Using bit values in an int may not be reliable, since different parts of the code can interpret the bits differently. e.g. FXDIB_DOWNSAMPLE and RENDER_FORCE_DOWNSAMPLE are defined in different places, but can be used interchangeably because they just happen to have the same value. It works but is rather fragile. Instead, use a struct of bools to explicitly define what different bits mean. Remove FXDIB_DOWNSAMPLE and friends. Change-Id: I9cf0c8f94d1ed27edf8dba22b0ab0ee67f2722cc Reviewed-on: https://pdfium-review.googlesource.com/c/44650 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-26Pass unique_ptr to CPWL_Wnd::AddChild().Tom Sepez
But stop short of updating the underlying data structures. Change-Id: I7d8edc74f71725005b81359484d30caddbe958d7 Reviewed-on: https://pdfium-review.googlesource.com/c/44693 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-26Roll v8/ db22e96fb..a4f6a37da (307 commits)Lei Zhang
https://chromium.googlesource.com/v8/v8.git/+log/db22e96fb450..a4f6a37da361 Version 7.2.149 Created with: roll-dep v8 TBR=tsepez@chromium.org Change-Id: Iace7cc8e4319aca65520ecc17d49fef2623be4c8 Reviewed-on: https://pdfium-review.googlesource.com/c/44695 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-26Include platform-specific fxge sources with conditionals.Lei Zhang
Change-Id: I3d83818d3b2e1485dbb5cddbda1273b510450920 Reviewed-on: https://pdfium-review.googlesource.com/c/44694 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-26Remove pParentWnd field entirely from CreateParams.Tom Sepez
Put it into CPWL_Wnd directly, and set/clear it when a child is added/removed from a parent. Change-Id: I7a8cd0cf22dbd6173e64bec5d844df56ad373722 Reviewed-on: https://pdfium-review.googlesource.com/c/44692 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-26Fix more nits in fx_win32_gdipext.cpp.Lei Zhang
- Use reinterpret_cast in more places. - Return data from a function with pdfium::Optional and std::pair. Change-Id: Ia6b8af985ece52a20b00aa80166c61f57b7b8478 Reviewed-on: https://pdfium-review.googlesource.com/c/44630 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-26Implement CFX_RenderDevice::GetFlipMatrix().Lei Zhang
Consolidate matrix transforms from several places. Change-Id: I2febcaed69afd1cf3eabf68f27ffe24301f07ca2 Reviewed-on: https://pdfium-review.googlesource.com/c/44631 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-26cp.pParentWindow is always NULL in NewPWLWindow()Tom Sepez
Because the CreateParams come from one of the GetCreateParam() overrides, and none of these set that particual field. This implies that the caller will always own the result, since it is never handed off by an AddChild() call, which is consistent with the function return. Change-Id: I1a9f580f347e911855c695807795541282d43f3f Reviewed-on: https://pdfium-review.googlesource.com/c/44691 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-26Forward declare a bunch of classes.Lei Zhang
Then do IWYU to fix up build errors. Move some implementations out of headers to allow more forward declarations. Change-Id: Idbeb978705a21cd6fb710ca9f5e99b4ea7d93ec5 Reviewed-on: https://pdfium-review.googlesource.com/c/44632 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-26Stop transfering ownership of |this| as CPWL_Wnd::Create() side-effectTom Sepez
Instead, make it an explicit method called on the parent outside of create. Rename Create() to Realize() to be sure to catch all usages, and add the new required call. Attachment to the parent now takes place a little earlier on in the life-cycle as a result but should be ok. Precursor to converting to smart pointers. Change-Id: I45c459fcd28b5d03c428ce5809d0432506cf4ec6 Reviewed-on: https://pdfium-review.googlesource.com/c/44690 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-26Rename NewPDFWindow() => NewPWLWindow()chromium/3593Tom Sepez
The window comes from the PWL layer. The string |PDF| doesn't add a lot of information since the whole repository is about PDF. Change-Id: I396351519e68ac0c59a02806941f45d3b17e7567 Reviewed-on: https://pdfium-review.googlesource.com/c/44670 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-25Make CPWL_Wnd own its pAttachedData.Tom Sepez
This requires moving it out of CreateParams, since that must be a copyable struct, and implies that currently there is some questionable sharing going on. To resolve this, introduce a Clone() method so that each window gets its own copy. Make GetAttachedData() return a const pointer, so that callers can't free it behind our back. Tidy initializations along the way. Change-Id: Iadc97688b4692bf4fafefe8cff88af88672f7110 Reviewed-on: https://pdfium-review.googlesource.com/c/44590 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-25Simplify some code in CGdiDisplayDriver.Lei Zhang
- GDI_StretchBitMask(), which is not an override, has a flags parameter that is never used. Remove it. - StretchDIBits() checks its flags parameter and does an early return, but still continue to use it afterwards when its only possible value is 0. Replace the flags variable with 0. Change-Id: Iad63557a1c28f2b5b84260a6b5498c1d7beada7f Reviewed-on: https://pdfium-review.googlesource.com/c/44611 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-25Pass source rect parameter to SetDIBits() by const-ref.Lei Zhang
In RenderDeviceDriverIface() implementations. Change-Id: Ic5e0239a29e7fa7b70e9ef65c82df7e773f8e363 Reviewed-on: https://pdfium-review.googlesource.com/c/44610 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-25Remove rarely used GDI+ using statements.chromium/3592Lei Zhang
Change-Id: I139393e39980fa3ea0aa9389153f65e43e39cd6c Reviewed-on: https://pdfium-review.googlesource.com/c/44555 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-25Remove unused GDI+ code.Lei Zhang
Change-Id: Ie31e657b8f5630ccd5306cf37235af2944d1eee5 Reviewed-on: https://pdfium-review.googlesource.com/c/44554 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-25Change DrawBitsWithMask() to take a matrix by const-ref.Lei Zhang
In CFX_SkiaDeviceDriver. Change-Id: Ie19c258fdffc0844b2210aec484b7e71a5ba52d0 Reviewed-on: https://pdfium-review.googlesource.com/c/44553 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-25Change StartDIBits() to take a matrix by reference.Lei Zhang
In RenderDeviceDriverIface and related classes, and for related methods in the call stack. Change-Id: I420fafe70084eb3941dffc6f9f51ecbed79581de Reviewed-on: https://pdfium-review.googlesource.com/c/44552 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-25Change FXDIB_BLEND_FOO typedefs to an enum class.Lei Zhang
BUG=pdfium:1085 Change-Id: Ieb43d4588e1d689e327e428dcbbf7adba45ce178 Reviewed-on: https://pdfium-review.googlesource.com/c/44545 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-25Fix blend mode usage in CFX_ScanlineCompositor helpers.Lei Zhang
- Remove FXDIB_BLEND_NONSEPARABLE, which is not a real blend type. - Change implicit if (blend_type) conditions to check against FXDIB_BLEND_NORMAL. - Add an IsNonSeparableBlendMode() helper. Change-Id: If5c017a7851ad928d1f17688bf6e9c38f70f4e0e Reviewed-on: https://pdfium-review.googlesource.com/c/44551 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-25Initialize SkiaState members where declared.Lei Zhang
Change-Id: I7bd85d2559bf30ccae3c8595cc37e613d4d4a2a2 Reviewed-on: https://pdfium-review.googlesource.com/c/44550 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-25Initialize CFX_ImageRenderer members in the header.Lei Zhang
- Reorder to pack a bit better. - Remove |m_BlendType| which is always |FXDIB_BLEND_NORMAL|. - Change the ctor to pass the matrix by reference. Change-Id: I07870947915fd2c90f28502803eb17f18204ac92 Reviewed-on: https://pdfium-review.googlesource.com/c/44547 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-25Add android_no_v8 builder to the default try job set.Lei Zhang
TBR=tsepez@chromium.org Change-Id: I0dd27def14ddfa285d5a2d9d27b9ad4d1b031e88 Reviewed-on: https://pdfium-review.googlesource.com/c/44570 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-25Revert "Add android_nov8 builder to the default try job set."Lei Zhang
This reverts commit ea3fac00d8f29adf90752fc67b798f2956cda8a5. Reason for revert: Should be named android_no_v8 instead. Original change's description: > Add android_nov8 builder to the default try job set. > > TBR=tsepez@chromium.org > > Change-Id: I4630986f13f352aba4b57268bdf48eb1406770a6 > Reviewed-on: https://pdfium-review.googlesource.com/c/44546 > Reviewed-by: Lei Zhang <thestig@chromium.org> > Commit-Queue: Lei Zhang <thestig@chromium.org> TBR=thestig@chromium.org,tsepez@chromium.org Change-Id: I54a175af4bdcf400fbdd1a76036513a1f4a6d86b No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://pdfium-review.googlesource.com/c/44549 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-25Add android_nov8 builder to the default try job set.Lei Zhang
TBR=tsepez@chromium.org Change-Id: I4630986f13f352aba4b57268bdf48eb1406770a6 Reviewed-on: https://pdfium-review.googlesource.com/c/44546 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Fix CPLW_Wnd ownership model in CFFL_FormFiller.Tom Sepez
CFFL_FormFiller::DestroyPDFWindow() might get re-entered, so do not leave any dangling references in maps. Use unique_ptr to be more sure that we have it right. Bug: chromium:898531 Change-Id: I7b61940ff4e88c8a7e3219fefb0479f33bbbfae1 Reviewed-on: https://pdfium-review.googlesource.com/c/44542 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-24Clean up CFX_ImageTransformer parameters.Lei Zhang
- A valid matrix is always passed in, so make the parameter const-ref. Since it is not obvious who owns the passed in matrix, make a copy with the corresponding matrix member. - Since the matrix parameter is const-ref, CFX_DIBBase::TransformTo() can also have a const-ref matrix parameter. - |flags| should be uint32_t, since |m_Flags| is. - |pClips| is only used inside the ctor, so remove |m_pClip|. Change-Id: If3d58a3fd28fa72b4ac7caac15f49a8057c594db Reviewed-on: https://pdfium-review.googlesource.com/c/44541 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Remove FXDIB_BLEND_UNSUPPORTED.Lei Zhang
The blend mode is never set to this value. Change-Id: I96cbadb055137a9de45f0082c81a7b8aedb9a427 Reviewed-on: https://pdfium-review.googlesource.com/c/44544 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Initialize CPDF_GeneralState::StateData in the header.Lei Zhang
Change-Id: I7049073c09ac87ef8041bfa51740c653a67b4bd3 Reviewed-on: https://pdfium-review.googlesource.com/c/44543 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Use ASSERT() consistently. Replace assert() usage.Lei Zhang
ASSERT() is PDFium's wrapper for cross-platform wrapper for assert(). Change-Id: Ie2a98a8e1de101f93aa9bf667d6f125d11d129cd Reviewed-on: https://pdfium-review.googlesource.com/c/44539 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Assert CPDF_Image::m_pDocument is never nullptr.Lei Zhang
Remove a check that will never be true. Change-Id: I6474cb7f6549f412a368d1920fd0af90eae9a700 Reviewed-on: https://pdfium-review.googlesource.com/c/44540 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Make CPDF_PathObject::m_Path private.Lei Zhang
Change-Id: I5c42af8e9e2d6a60648d291153326aef04e4c49e Reviewed-on: https://pdfium-review.googlesource.com/c/44513 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Make CPDF_PathObject::m_FillType private.Lei Zhang
Change-Id: I69436316dd4a12ebdc3f09e7db3bf25c7495a4ce Reviewed-on: https://pdfium-review.googlesource.com/c/44512 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Make CPDF_PathObject::m_bStroke private.Lei Zhang
Remove some setters on newly constructed objects, since |m_bStroke| is already initialized to false. Change-Id: I8d04efec997226fb86091566eea96604f18680aa Reviewed-on: https://pdfium-review.googlesource.com/c/44511 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Start making CPDF_PathObject members private.Lei Zhang
Also move member initialization to the header. Change-Id: I557380ae774ddf887cefeb56df2a33e5b7cff8a4 Reviewed-on: https://pdfium-review.googlesource.com/c/44510 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Add CFX_Matrix::AsTuple().chromium/3591Lei Zhang
Change-Id: I53c1b148cb8cdc77461766fc9996a0a3ce5f4cb7 Reviewed-on: https://pdfium-review.googlesource.com/c/44536 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Implement FPDFImageObj_GetMatrix().Lei Zhang
BUG=pdfium:1183 Change-Id: I5b1051d8924264aa12534466ee51b2718b3eca67 Reviewed-on: https://pdfium-review.googlesource.com/c/44514 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Implement FPDFPageObj_GetLineCap().Lei Zhang
Add unit tests for FPDFPageObj_[GS]etLineCap(). BUG=pdfium:1186 Change-Id: I3df907713a8846fd7481300c5caf102293f381ba Reviewed-on: https://pdfium-review.googlesource.com/c/44516 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Implement FPDFPageObj_GetLineJoin().Lei Zhang
Add unit tests for FPDFPageObj_[GS]etLineJoin(). BUG=pdfium:1185 Change-Id: I10c6f0ad5cc06b2b0ac11c1142353e7a275fc79e Reviewed-on: https://pdfium-review.googlesource.com/c/44515 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Check CPDFFooObjectFromFPDFPageObject() result.Lei Zhang
Instead of checking the FPDF_OBJECT itself. Remove redundant checks and fix nits. Change-Id: Id566847d39d16331c08f0b5f3b46431716717b5c Reviewed-on: https://pdfium-review.googlesource.com/c/44535 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Be more particular about FX objects constructed from JSTom Sepez
This is back-filling some more error cases from the work from a few weeks ago. Replaces a lambda with a static CallHandler() method since the verbosity was increasing. It gets invoked if you try to make a new FXJS object from the javascript side, rather than the C++ side. Making such an object is a little tricky, since we don't give these functions names in V8, but they can be obtained via constructor property from an instance of the object. Change-Id: Ibca686e75338ac54d08a114f36f930cd424a1eb5 Reviewed-on: https://pdfium-review.googlesource.com/c/44534 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-23Pull in current Chromium IMMEDIATE_CRASH() implementation.Lei Zhang
Update CHECK() to use IMMEDIATE_CRASH(). Change-Id: I7bcc75b31a64b657940b706ae8321740c27a5071 Reviewed-on: https://pdfium-review.googlesource.com/c/44211 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-23Test color.convert() and equal() from JS (and fix comparison logic).Tom Sepez
Currently, color.equal(a, b) may not give the same result as color.equal(b, a) since arg1 is converted to be the type of arg2, and some of these conversions lose information. Instead promote to the type with the most components in the hope of preserving the most information. Better error message when there are the right number of parameters but the types are wrong. Change-Id: I1d93fa29db4fb65e0f7c07c3ba7d9ca87ebf7bc9 Reviewed-on: https://pdfium-review.googlesource.com/c/44413 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-23Split field.in into field_properties.in and field_methods.inTom Sepez
Matches the conventions of the other JavaScript tests. Change-Id: I9dc41e3964220db03f57b9ab30289e0c19b042da Reviewed-on: https://pdfium-review.googlesource.com/c/44531 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-23Remove CJS_Field::ValueIsOccur()Tom Sepez
It is never called. Change-Id: If4dd7854cbcc815f48fa289003acc203f444cc3e Reviewed-on: https://pdfium-review.googlesource.com/c/44530 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>