summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page
AgeCommit message (Collapse)Author
2016-08-30Make CPDF_TextState have a CPDF_TextStateData rather than inheriting one.tsepez
Review-Url: https://codereview.chromium.org/2287313004
2016-08-30More better const-ness in CFX_CountRef<>tsepez
There are a couple of places where code is calling GetObject() that should be calling GetPrivateCopy(), but works because the value may not be shared at the time. This just makes it safer. Review-Url: https://codereview.chromium.org/2290863002
2016-08-29Revert "Add -> operators to CFX_CountRef."tsepez
This reverts commit c10c23a2b1999b1cb0354fd4db9837dc63a3d833. TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2285283003
2016-08-29Revert "Replace wrapper methods in CPDF_Path with -> operator."tsepez
This reverts commit d09a09751f724ecdb1a0bc307447a3d0c212ebff. TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2291833002
2016-08-29Revert "Use ->() in CPDF_ColorState"tsepez
This reverts commit 91ddd3f7501429222f648b986a99f3959a398889. Reason for revert: may introduce sublte bugs, more thought required. TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2294553002
2016-08-29Use ->() in CPDF_ColorStatetsepez
Move methods to CPDF_ColorStateData. Move MakePrivateCopy() methods to call sites. Remove now-empty cpdf_colorstate.cpp file. Review-Url: https://codereview.chromium.org/2291763002
2016-08-29Replace wrapper methods in CPDF_Path with -> operator.tsepez
These just invoked exaclty the same methodes in the underlying xxxData class, which we can now do with just a ->() Move some methods to the xxxData class, where they belong. In doing so, put MakePrivateCopy() calls at each callsite for those methods that made a copy. Review-Url: https://codereview.chromium.org/2286983002
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