summaryrefslogtreecommitdiff
path: root/core/fxge/win32
AgeCommit message (Collapse)Author
2018-03-20Change ArgbToColorRef() to ArgbToAlphaAndColorRef().chromium/3377Lei Zhang
Since that is what it really returns. Add a replacement ArgbToColorRef() that only returns a FX_COLORREF, and remove a duplicate implementation. Then update callers and only use ArgbToAlphaAndColorRef() where appropriate. Also update comments to explain what FX_COLORREF is. Change-Id: I5ed3d71683898dc2b3a66395dea0ec2562c14a68 Reviewed-on: https://pdfium-review.googlesource.com/28575 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-15Rename FX_COLORREF variables from "rgb" to "bgr".Lei Zhang
FX_COLORREF should work like win32 COLORREF, which is BGR. Change-Id: I9f8bb3e2d30a64dc822ac6b8c46130358a03678a Reviewed-on: https://pdfium-review.googlesource.com/28574 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-15Fix a red-blue channel flip when rendering masks to EMF.Lei Zhang
Use BGR instead of RGB in CGdiDeviceDriver::GDI_StretchBitMask(). Many win32 GDI APIs take COLORREF as input, and COLORREF is BGR. In this case, a win32 API was being called with RGB data. BUG=chromium:821672 Change-Id: Ia530c7ef5582eed13ac7119935851cfe0ad57323 Reviewed-on: https://pdfium-review.googlesource.com/28573 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-06Rename IFX classes in core/fxge to Ifacechromium/3364Dan Sinclair
This CL renames IFX classes in core/fxge to Iface. Change-Id: I137167ddd4ff1563d8002d9501222c27183408cc Reviewed-on: https://pdfium-review.googlesource.com/27990 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-02-14Pdfium: Allow negative font sizes for PostScript printingrbpotter
Bug: chromium:806746 Change-Id: I0b642c457c55d828dd48988eadfc5fa964de1216 Reviewed-on: https://pdfium-review.googlesource.com/26630 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
2018-01-30Guard usages of tellp(). It may return -1 in error cases.Henrique Nakashima
Change-Id: I064ddcad8671b9ade2c02142a6c2c2983846e3a9 Reviewed-on: https://pdfium-review.googlesource.com/24650 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-01-30Remove not reachable branch in fxge code.Lei Zhang
BUG=chromium:805881 Change-Id: I5f920649f425d0cfc47c780b36ed70f23cbe1299 Reviewed-on: https://pdfium-review.googlesource.com/24191 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-01-30Use anonymous namespace in gdiplus code.Lei Zhang
Fix some nits as well. Change-Id: Ia52f4550c39d8072004679d764243ca9a9f7db0d Reviewed-on: https://pdfium-review.googlesource.com/24190 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-01-26Mark some fxge class members as const.Lei Zhang
Change-Id: I063690047274372b449726cd5d2c479bad0672f4 Reviewed-on: https://pdfium-review.googlesource.com/24150 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-01-18Add jumbo build support for fxge and pwl.Lei Zhang
This completes jumbo build support for non-XFA builds. BUG=pdfium:964 Change-Id: Ife4ed23f9b438623581a863685014e64a06cf0d8 Reviewed-on: https://pdfium-review.googlesource.com/22775 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-01-18Remove more unneeded includes and code from headers.Lei Zhang
Change-Id: I0a07dbc9850bef2184ed35ff04b08385fc1bdd17 Reviewed-on: https://pdfium-review.googlesource.com/22891 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-01-11Remove core/fxge/cfx_fontmgr.h from headers.Lei Zhang
Then do IWYU for CFX_FontMgr users. Change-Id: Id77529ccf45ec448c56c40412b78eb55925bd00e Reviewed-on: https://pdfium-review.googlesource.com/22531 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-06Fix ps rendering.chromium/3287Henrique Nakashima
Also fix other occurrences that were missed. Bug:pdfium:947 Change-Id: Ic7e909ff9ce3abdf91e8e9ba108c84ad28b2fd65 Reviewed-on: https://pdfium-review.googlesource.com/20472 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-11-22Call FreeLibrary() in CGdiplusExt.chromium/3276Lei Zhang
BUG=pdfium:939 Change-Id: I4204965bd8b81bea3c485fcb27adfa212cce4e69 Reviewed-on: https://pdfium-review.googlesource.com/19190 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-11-22Remove some pointless assignments to "".Lei Zhang
Or change them to clear(). Change-Id: Ia9e3e1f0d74b948cec3f8df85d205f830ac9216c Reviewed-on: https://pdfium-review.googlesource.com/19172 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-07Remove m_bFlagExact from CFX_SubstFontNicolas Pena
This CL removes the single use case from |m_bFlagExact|. This flag allows the PDF viewer to treat a substitute font with a matching name as if it was actually an embedded font, which is wrong. For all substitute fonts, it is important to follow the longer process of first obtaining the unicode from the charcode to then obtain the glyph in the substitute font that corresponds to that unicode. Bug: chromium:781785 Change-Id: Ie5958b43914e0e46334b89b7c2c55c02d0da0c11 Reviewed-on: https://pdfium-review.googlesource.com/17859 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-10-20PostScript: Do not send fonts with size <= 0 to printerschromium/3246rbpotter
Bug: chromium:767343 Change-Id: I9321e7565feb423a1283c74e91297eeaeb80083f Reviewed-on: https://pdfium-review.googlesource.com/16410 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
2017-09-27Move CFX_Font definition to cfx_font.hDan Sinclair
This CL moves the CFX_Font definition out of fx_font.h and into cfx_font.h to match the cfx_font.cpp implementation. Change-Id: Icc2fc7463fa4b9d0bec925e80b60a638136a83a1 Reviewed-on: https://pdfium-review.googlesource.com/14951 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-09-27Remove FX_STRSIZE and replace with size_tRyan Harrison
BUG=pdfium:828 Change-Id: I5c40237433ebabaeabdb43aec9cdf783e41dfe16 Reviewed-on: https://pdfium-review.googlesource.com/13230 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-09-26Remove fx_text_int.hDan Sinclair
The CFX_SizeGlyphCache is only used internally by the CFX_FaceCache. This CL moves the definition to that file and removes fx_text_int.h Change-Id: I38f26f437f0eaa72492995ae7442d5c38ed2f229 Reviewed-on: https://pdfium-review.googlesource.com/14771 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-21Move CFX_UnownedPtr to UnownedPtrDan Sinclair
This CL moves CFX_UnownedPtr to UnownedPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I6d1fa463f365e5cb3aafa8c8a7a5f7eff62ed8e0 Reviewed-on: https://pdfium-review.googlesource.com/14620 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-21Rename CFX_RetainPtr to RetainPtrDan Sinclair
This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e Reviewed-on: https://pdfium-review.googlesource.com/14616 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-21Move CFX_MaybeOwned to fxcrt::MaybeOwnedDan Sinclair
This CL moves CFX_MaybeOwned into the fxcrt namespace and removes the CFX_ prefix. The test names for maybe owned were updated to be in the MaybeOned test suite instead of the fxcrt suite. Bug: pdfium:898 Change-Id: I0c07057d66c8610e7b19133094b4507fff725e76 Reviewed-on: https://pdfium-review.googlesource.com/14470 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-09-20Forward declare codec modules in fx_codec.h.Lei Zhang
Change-Id: I020b862619f3f93f71dbb027b9e799d78744f686 Reviewed-on: https://pdfium-review.googlesource.com/14391 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-09-19Remove unneeded core/fxcodec/fx_codec.h includes.chromium/3220Lei Zhang
Change-Id: I703321108712e8c4a11a8343ecf8b1a8804c1d1a Reviewed-on: https://pdfium-review.googlesource.com/14352 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-09-18Convert string class namesRyan Harrison
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-09-06Adding in missed )Ryan Harrison
BUG=pdfium:828 Change-Id: Ifeaf19291ffd33aab63449ab52f8d2606b66c0fc Reviewed-on: https://pdfium-review.googlesource.com/13330 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-09-06Fix issue with integer types on win32 in std::minRyan Harrison
DEPS roll is failing since std::min(size_t, int) -> int doesn't make sense. min is templated on a single class, i.e. std::min(size_t, size_t) -> size_t. BUG=pdfium:828 Change-Id: Idec3ac7bdbf1d22b8c878a95bd9c44c9a94bbccf Reviewed-on: https://pdfium-review.googlesource.com/13310 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
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 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-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-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-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-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-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-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-19Move CCodec_ModuleMgr ownership to CPDF_ModuleMgr.Lei Zhang
More straight forward than CFX_GEModule owning in and CPDF_ModuleMgr holding a pointer to it. Remove assumptions that the codec modules may return nullptr, and do IWYU. Change-Id: Iba7fc3c7ec223fd6d29a1ab74ed13d35689bc5d5 Reviewed-on: https://pdfium-review.googlesource.com/5654 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-05-15Convert CPSOutput to an IFX_WriteStreamdan sinclair
This Cl updates CPSOutput to inherit from IFX_WriteStream and converts the CFX_PSRenderer to accept an IFX_WriteStream instead of a CPSOutput. Change-Id: Ibde5c7da1c2f6df0a10cb6e9a470e18fbab167b8 Reviewed-on: https://pdfium-review.googlesource.com/5431 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-11Rename render device classesDan Sinclair
This Cl renames the CFX_RenderDevice subclasses to make their usage clearer. Change-Id: Ie820b57df9a3743ce8c6893fb483b398a1f1bdbe Reviewed-on: https://pdfium-review.googlesource.com/5390 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-11Remove unused GetPlatformSurface and GetDC methodsdan sinclair
The times we need the DC we call ::GetDC to retrieve it from the platform. These methods are unused. Change-Id: If83aa9b37ae2231d8029db6f2e6d8d17f1825611 Reviewed-on: https://pdfium-review.googlesource.com/5350 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-08Remove default params in CFX_DIBSourceNicolas Pena
Change-Id: I9306afed2747e3b0054adeea1d39916cac47f5c5 Reviewed-on: https://pdfium-review.googlesource.com/5091 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-21Use unique_ptr in CFX_FolderFontInfo::m_FontListchromium/3079Tom Sepez
Avoid a string duplication along the way. Change-Id: I866c34ad1afb20b9578aeb7cabeb8a185674c884 Reviewed-on: https://pdfium-review.googlesource.com/4437 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-20Let {Argb,Cmyk}Decode return tuplesNicolas Pena
Change-Id: Ic4e766d9417f9a9ece5f9e4269d0f96e1e91639b Reviewed-on: https://pdfium-review.googlesource.com/4392 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-20core: choosen -> chosenMiklos Vajna
Change-Id: I5b78fe4238a68bb6ba56aa76b53b315ef6f8574c Reviewed-on: https://pdfium-review.googlesource.com/3730 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-19Cleanup codepage and charset definitions.Dan Sinclair
This Cl cleans up the unused defines in fx_codepage.h. The FXFONT_CHARSET_ defines are replaced with fx_codepage defines, this moves fx_codepage into core instead of xfa only. Static asserts are added to verify the public/ charsets match the fx_codepage charsets. Change-Id: Ie2f749e093de60a9a6743128a1fb087912e4cc96 Reviewed-on: https://pdfium-review.googlesource.com/4316 Commit-Queue: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>