summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page
AgeCommit message (Collapse)Author
2016-08-26Add -> operators to CFX_CountRef.chromium/2842tsepez
Allows CFX_CountRefs to behave more like pointers. Rename SetNull() to Clear() for consistency with other ptrs. Change GetPrivateCopy() into MakePrivateCopy() with no return, since the -> operators are clearer than getting an object pointer. Review-Url: https://codereview.chromium.org/2283113002
2016-08-26Make CFX_CountRef<>::m_pObject private, add accessors, fix const-ness.tsepez
Hide the CountedObj class from the rest of the code. Rename GetModify() to GetPrivateCopy(), since it turns out there are places where we modify a potentially-shared copy. Add non-const version of GetObject() to permit these. Review-Url: https://codereview.chromium.org/2287633002
2016-08-26Remove CFX_CountRef::IsNull in favor of operator booltsepez
Review-Url: https://codereview.chromium.org/2285513002
2016-08-26Rework CFX_CountRef in terms of CFX_RetainPtr.tsepez
Make use of existing ref count work rather than re-inventing it. Review-Url: https://codereview.chromium.org/2281683002
2016-08-25Tidy up CFX_PathDatatsepez
Remove friendship with CFX_Path Pack members tighter on 64-bits. Review-Url: https://codereview.chromium.org/2275883004
2016-08-23Fix stack overflow in object Clone() functionsweili
For some complex objects such as CPDF_Dictionary, CPDF_Array, CPDF_Stream, and CPDF_Reference, Clone() could be executed with infinite recursion to cause the stack overflow. Fix this by checking already cloned objects to avoid recursion. BUG=pdfium:513 Review-Url: https://codereview.chromium.org/2250533002
2016-08-18Add llvm fuzzer for CPDF_PSEnginetsepez
Put class definition into its own header file so fuzzer can find it. Fix a pair of div by 0s immediately hit by the fuzzer. Review-Url: https://codereview.chromium.org/2253193003
2016-08-10Move CFX_RenderDevice, CFX_FxgeDevice, and CFX_GraphStateData into their own ↵npm
files. This is the third CL to separate fx_ge into classes, one per file. All fx_ge.h includes had to be replaced with new includes The method definitions for CFX_FxgeDevice were not moved to a single file. These methods are defined in two folders different from fxge/ge, so they were left untouched for now. Review-Url: https://codereview.chromium.org/2223213002
2016-08-09Fix a leak with FPDFPageObj_NewImgeObj().thestig
BUG=pdfium:545 Review-Url: https://codereview.chromium.org/2194393002
2016-08-09Fix typos of the word outer.thestig
Review-Url: https://codereview.chromium.org/2226003003
2016-08-08Add CPDF_Array::IsEmpty().jaepark
Using IsEmpty() is more readable than using GetCount() == 0. Review-Url: https://codereview.chromium.org/2226113002
2016-08-08Move CFX_ClipRgn and CFX_PathData into their own files.npm
This is the second CL in an attempt to split up the classes in fxge/include/fx_ge.h into their own files. CFX_ClipRgn is moved to core/fxge/ge because it is only used in core/fxge. The header for CFX_PathData is left in core/fxge/include since it is used elsewhere. Review-Url: https://codereview.chromium.org/2216853004
2016-08-05Add CPDF_ImageObject::GetImage().thestig
And use it where appropriate. Review-Url: https://codereview.chromium.org/2224623002
2016-07-29Simplify some FPDF edit functions.thestig
Fix an unlikely memory leak in FPDFPage_InsertObject(). BUG=pdfium:545 Review-Url: https://codereview.chromium.org/2195643002
2016-07-29Cleanup CPDF_DocPageData release methods and callers.thestig
Review-Url: https://codereview.chromium.org/2194853002
2016-07-24Use actual type instead CFX_Deletableweili
Change two places that used CFX_Deletable to use actual types. This makes the type more obvious, and avoids unnecessary casts. Review-Url: https://codereview.chromium.org/2180443002
2016-07-06Change class member variables in raw pointer type into unique_ptrweili
Also did some cleanups such as removing an unused member variables and some unused structs. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2119013002
2016-06-23Improve hint table validation checks.thestig
Check required hint table dictionary entries and make sure they: - Exist. - Are of the right type. Along the way: - Fix FX_atonum() to not have a non-const pass-by-ref param. - Simplify code in CPDF_StreamContentParser. - Make CPDF_Number::IsInteger() a const method. BUG=610555 Review-Url: https://codereview.chromium.org/2095763003
2016-06-13Make code compile with clang_use_chrome_plugin (part I)weili
This change contains files in core/fpdfapi directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups; BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2060973002
2016-06-07Get rid of NULLs in core/thestig
Review-Url: https://codereview.chromium.org/2032613003
2016-06-06Remove unused PS generation code.thestig
CFX_PSRenderer, IFX_PSOutput, CPSOutput, CPSPrinterDriver. Also reland commit 2d63eaa. Review-Url: https://codereview.chromium.org/2019603002
2016-06-02Fix all the code which has duplicate variable declarationsweili
When there are duplicate variable declarations, the inner names shadow the outter ones. This is error prone and harder to read. Remove all the instances found by /analyze. BUG=chromium:613623, chromium:427616 Review-Url: https://codereview.chromium.org/2027273002
2016-06-01Relax checks added in commit 8f3a311.chromium/2760chromium/2759chromium/2758chromium/2757chromium/2756thestig
Some shading types do not use these fields. Review-Url: https://codereview.chromium.org/2027053002
2016-06-01Validate the BitsPerFlag entry in shading dictionaries.thestig
BUG=616248 Review-Url: https://codereview.chromium.org/2020183004
2016-05-31Validate a couple of fields in shading dictionaries.thestig
BUG=616246 Review-Url: https://codereview.chromium.org/2022263003
2016-05-25Remove CFX_PrivateData from CPDF_Pagetsepez
CFX_PrivateData served two purposes here: The first was to hold an opaque pointer to the corresponding page structure in the next higher layer, of which it knows no details. Introduce an empty CPDF_Page::View class to represent this higher class, so as to get type safety while preserving layering. The second was to hold an opaque render context, which it also happened to own. Make this a CFX_Deletable to help with management. Also remove an unused inheritance from CFX_PrivateData in CPDF_Annot. Review-Url: https://codereview.chromium.org/2008553008
2016-05-25get skia buildingcaryclark
Resolve changes to cpdf_shadingpattern.h that prevent Skia from building. R=thestig@chromium.org,dsinclair@chromium.org,reed@google.com BUG= Review-Url: https://codereview.chromium.org/2017463002
2016-05-23Make CPDF_Function::Load() return an unique_ptr.chromium/2750chromium/2749chromium/2748thestig
Review-Url: https://codereview.chromium.org/2000973002
2016-05-23Fix infinite recursion in CPDF_DocPageData::GetColorSpace().thestig
BUG=pdfium:497 Review-Url: https://codereview.chromium.org/2003873002
2016-05-21Get rid of CPDF_Object::GetArray().thestig
BUG=pdfium:234 Review-Url: https://codereview.chromium.org/2001783003
2016-05-20Add an enum to represent text rendering modes.thestig
Review-Url: https://codereview.chromium.org/1999553002
2016-05-20Merge GetBits32() impls into one. Put it in fxcrt.thestig
Review-Url: https://codereview.chromium.org/1990153003
2016-05-19Fix the Skia build after 9b1a0ee.thestig
Review-Url: https://codereview.chromium.org/1996533004
2016-05-19Fix Undefined-shift in CPDF_SampledFunc::v_Init().thestig
Also fix a divide by zero in CPDF_SampledFunc. Do some cleanups too. BUG=596530,613032 Review-Url: https://codereview.chromium.org/1990843004
2016-05-19Fix leak in CPDF_StreamContentParser::AddTextObject().thestig
... by using STL containers in more places. Remove dead / duplicate code as well. BUG=603904 Review-Url: https://codereview.chromium.org/1998583002
2016-05-13Make CFX_ByteString(const CFX_ByteStringC&) explicit.tsepez
Add missing helper function to CFX_ByteTextBuf to avoid the anti-pattern CFX_ByteString(sBuf.AsStringC()), using the name "Make" to indicate there's an allocation going on in this case. Change some method arguments to take pre-existing ByteStrings where possible. Review-Url: https://codereview.chromium.org/1977093002
2016-05-11Add much-needed Find() method for CFX_*StringCtsepez
BUG=pdfium:493 Review-Url: https://codereview.chromium.org/1968233002
2016-05-11Clean up CPDF_Color and some related code.thestig
- Remove dead code in CPDF_Color. - Encapsulate member variables. - Added accessors as need. - Remove unused CPDF_ColorSpace::GetMaxIndex(). - Remove redundent CPDF_StreamContentParser::GetNumber16(). Review-Url: https://codereview.chromium.org/1965243002
2016-04-28Fix stack overflow from nested arrays.thestig
BUG=pdfium:422 Review-Url: https://codereview.chromium.org/1930743003
2016-04-27Standardize on ASSERT.dsinclair
There are currently three ways to assert in the code (ASSERT, FXSYS_assert and assert). This CL standardizes on ASSERT. The benefit of ASSERT is that it can be overridden if the platform requies and we can pickup the Chromium version if it has already been defined in the build. This does change behaviour. Currently FXSYS_assert is always defined but ASSERT is only defined in debug builds. So, the FXSYS_assert's would fire in Release builds. That will no longer happen. BUG=pdfium:219 Review-Url: https://codereview.chromium.org/1914303003
2016-04-26CPDF_Document::LoadPattern() and friends always have a valid matrix.thestig
So pass by const-ref instead of by pointer. Review URL: https://codereview.chromium.org/1923153002
2016-04-26Move CPDF_Document code into cpdf_document.cpp.thestig
Review URL: https://codereview.chromium.org/1925453002
2016-04-26Remove several IPDF_ interfaces and CPDF_RenderModule.dsinclair
This CL removes the interfaces: * IPDF_ObjectRenderer * IPDF_OCContext * IPDF_RenderModule * IPDF_PageModule The CPDF_RenderModule was just wrapping new and delete calls. This Cl moves those up to the callers and removes the CPDF_RenderModule class. Review URL: https://codereview.chromium.org/1918323003
2016-04-26Clean up CPDF_Page.thestig
- Merge CPDF_Page::Load() into ctor. - Remove always nullptr param for CPDF_Page::ParseContent(). - Remove unneeded indirection in IPDF_RenderModule. - Delete CPDF_ParseOptions. - Fix up CPDF_Pattern. Review URL: https://codereview.chromium.org/1918113002
2016-04-21Add a missing initialisation for CPDF_ContentMarkItem.chromium/2717chromium/2716chromium/2715ochang
R=dsinclair@chromium.org BUG=chromium:605491 Review URL: https://codereview.chromium.org/1910143002
2016-04-14Rename CFX_ByteTextBuf::GetByteString() to AsStringC().tsepez
Do the same for CFX_WideTextBuf as well. The name is confusing because these return CFX_ByteStringC, not CFX_ByteString. The AsStringC naming gives parallelism with the string types themselves, and may help to indicate that the result is only good for the lifetime of the object being operated upon. Review URL: https://codereview.chromium.org/1886263003
2016-04-14Make CPDF_Dictionary methods take CFX_ByteString argumentstsepez
This will help avoid duplicate allocation of CFX_ByteStrings when the caller already has one. It may seem counter-intuitive that requiring the caller to pass an allocated CFX_ByteString rather than a static CFX_ByteStringC would improve the situation, but due to the idiosyncrasies of std::map, the CPDF_Dictionary methods must always do an allocation under the covers which can't be avoided. The changed callers in this CL are places where we would previously demote to CFX_ByteStringC and then allocate a a duplicate CFX_ByteString in the dictionary method. Review URL: https://codereview.chromium.org/1889863002
2016-04-13Remove implicit cast from CFX_ByteString to (const char*).tsepez
BUG= Review URL: https://codereview.chromium.org/1885973002
2016-04-12Remove ICodec_* Interfaces.dsinclair
All of the ICodec_* interfaces had a single implementation. This CL removes the interfaces and uses the concrete classes in their place. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1876023003
2016-04-12flesh out gradient shaderscaryclark
Using these webpages as guides http://www.globelegislators.org/pdfjs/test/pdfs/alphatrans.pdf http://www.antennahouse.com/antenna1/wp-content/uploads/2015/07/background-image-gradient-1.pdf flesh out the gradient shaders to include the PostScript Type 0 sampling function and to include radial gradients. This CL makes rendering these pages agree with Adobe Reader output. Some of these examples use an Extend array to clip the gradient. Skia does not currently support this natively, so construct the clip manually for now. Other PDF pages may construct gradients using alternate mechanisms -- this code will continue to be refactored as those come to light. In particular, this CL sets up the clip and matrix differently for axial gradients and radial gradients -- while it makes sense to do it one way only, I prefer to defer until I have more examples to work with. R=dsinclair@chromium.org,tsepez@chromium.org Review URL: https://codereview.chromium.org/1870463002