summaryrefslogtreecommitdiff
path: root/core/fxge
AgeCommit message (Collapse)Author
2016-07-01Mac: Improve font substitution.chromium/2790chromium/2789chromium/2788chromium/2787thestig
Take the requested font weight and italicization into account when searching for fonts. For example, for a font with the face "Arial" and a weight of 700, search to see if "Arial Bold" is available. BUG=530 Review-Url: https://codereview.chromium.org/2119983002
2016-07-01Clean up CFX_MacFontInfo and surrounding code.thestig
Review-Url: https://codereview.chromium.org/2112213002
2016-06-29fix skia unit testscaryclark
Add checks to pass unit tests. R=thestig@chromium.org,dsinclair@chromium.org BUG=pdfium:525, pdfium:526, pdfium:527, pdfium:528, pdfium:529 Review-Url: https://codereview.chromium.org/2111553003
2016-06-29add local caching for skia drawscaryclark
PDFium assumes the lowest common denominator and draws many strings and paths that can be accumulated. Defer canvas->restore() calls until required because the clip changed. Defer text and path draws as long as subsequent calls concatenate additional data. Include debugging switch to allow disabling cache at compile-time while bugs are shaken out. Review-Url: https://codereview.chromium.org/2064753002
2016-06-27Fix a regression from commit f3e6851.thestig
The index calculations are wrong for a reverse iterator. Review-Url: https://codereview.chromium.org/2101723002
2016-06-22Remove some fx_dib functions with unused parameters.thestig
Review-Url: https://codereview.chromium.org/2075383002
2016-06-22Fix Skia GN build on Macweili
The build has been broken. This should make it compilable. Review-Url: https://codereview.chromium.org/2075343002
2016-06-21Use FXFONT defines in place of integers.thestig
Fix nits along the way. Review-Url: https://codereview.chromium.org/2083943003
2016-06-21Move ifx_renderdevicedriver to a separate file to shareweili
Move ifx_renderdevicedriver class to its own file to share with multiple devices to reduce code duplication. Review-Url: https://codereview.chromium.org/2078783002
2016-06-20Fix clang_use_chrome_plugin for Mac and Skia buildsweili
These changes are specific to Mac and Skia builds. They are needed for these builds to compile with clang_use_chrome_plugin. BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2081523002
2016-06-20Change func(void) to func()weili
Since PDFium is compiled as C++ code, the void keyword is not needed. BUG=pdfium:519 Review-Url: https://codereview.chromium.org/2084603003
2016-06-20Remove unused CFX_Font members.thestig
Review-Url: https://codereview.chromium.org/2077243002
2016-06-20Another round of fx_ge cleanup.thestig
- Clean up CFX_GEModule. - Remove duplicate #defines in fx_ge.h - Remove IsFontStyleFromCharCode() that always returns true. - Mark a FXTEXT_CHARPOS field as Mac only. Review-Url: https://codereview.chromium.org/2075333002
2016-06-15fix skia buildcaryclark
Add out-of-line implementations to Skia as well. R=weili@chromium.org,dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2072493002
2016-06-14Make code compile with clang_use_chrome_plugin (part II)weili
This change contains files in core directory which were not covered in part I. 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/2060913003
2016-06-13Delete Transform1bppBitmap() after commit 2f30766.thestig
It's unused and causing the build to fail. TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2060743004
2016-06-13Remove default arguments from IFX_RenderDeviceDriver.thestig
Review-Url: https://codereview.chromium.org/2059883004
2016-06-13Fix CGdiDeviceDriver::DrawLine().chromium/2769chromium/2768chromium/2767thestig
- Do the bounds check before applying the transformation. - Simplify the bounds check. - Fix nits. - Remove some nearby dead code. BUG=108144 Review-Url: https://codereview.chromium.org/2057423002
2016-06-13use pos textcaryclark
Use SkCanvas::drawPosText() to render the whole string rather than drawing glyphs one at a time. R=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2057343002
2016-06-10[Android] Add support for standalone PDFium gn build on Android.jbudorick
This pulls in the android NDK and catapult, rolls chromium/src/build/, and pulls in two .gni updates. It also fixes a few miscellaneous compile failures in android-specific code. BUG=pdfium:38 Review-Url: https://codereview.chromium.org/2059553002
2016-06-08Remove even more const casting from core.tsepez
Make the return types/arguments match reality. Review-Url: https://codereview.chromium.org/2053483002
2016-06-08update skiacaryclark
Update Skia to the last revision that passed the Chrome DEPS roll. This will help green the Skia tree so that future changes to Skia that break PDFium can be detected. R=rmistry@google.com,dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2042403004
2016-06-08Remove implicit CFX_CountedRef::operator T*()tsepez
Explicitly invoke GetObject() method instead. This avoids having code where it looks like non-pointers are assigned to pointers but works due to the cast operator. Review-Url: https://codereview.chromium.org/2045083003
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-06Get rid of unused android GetHandle() and FPF_HFONTtsepez
git grep FPF_HFONT git grep '\bGetHandle\b' show these are unused. Review-Url: https://codereview.chromium.org/2032793003
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-02The PDFium source in core/fxge/dib implements a bit-blitting backend.caryclark
This code has several disadvantages over a more modern graphics engine: - no SIMD support - no GPU support - limited quality Further, calling this code locks in the perceived resolution, so that the output cannot be scaled without additional loss. By directing all bitmap drawing through CFX_SkiaDeviceDriver::StartDIBits, Skia can handle all appropriate bitmap optimizations. To that end, SetDIBits and StretchDIBits now call StartDIBits. Other changes: Skia's bitmaps are premultiplied. PDF contains bitmaps that are unpremultiplied. PDFium appears to use premultiplied bitmaps sometimes, and unpremultiplied bitmaps elsewhere. Add a debug check for unpremultiplied bits in Skia's driver, and add a utility to premultiply PDFium's bitmaps' bits. PDFium supports a 24 bit RGB bitmap padded to a 32 bit word. Set the high byte so that Skia can treat this as an ARGB bitmap. Defer the application of the alpha value to the draw call rather than calling MultiplyAlpha where possible. Allow the destination bitmap to be alpha 8 or argb 32. Review-Url: https://codereview.chromium.org/2025043002
2016-06-01Change CFX_Font::GetPsName() to return a CFX_ByteString.thestig
So everyone can avoid doing Byte to WideString conversions. Also remove CFX_GEFont::GetPsName() and deduplicate a couple of GetPsName() calls. Review-Url: https://codereview.chromium.org/2019173002
2016-05-27Change IsGDIEnabled() to use a bool.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/2017293002 .
2016-05-27Clean up some Android/Windows code.thestig
Review-Url: https://codereview.chromium.org/2004313007
2016-05-26Remove default arguments from CFX_FxgeDevice.thestig
Remove unused dithering code. Review-Url: https://codereview.chromium.org/2010813003
2016-05-26skia: add bitmap color table supportcaryclark
Fix 2/4/8 bits per pixel bitmaps that PDFium transposes into 8 bpp indexed. R=tsepez@chromium.org,dsinclair@chromium.org,reed@google.com Review-Url: https://codereview.chromium.org/2011153002
2016-05-26Remove default arguments in CFX_RenderDevice.thestig
Review-Url: https://codereview.chromium.org/2011943004
2016-05-26Remove default argument from RestoreState() methods.thestig
Review-Url: https://codereview.chromium.org/2009803003
2016-05-25Clean up fx_ge.h and IWYU.thestig
Review-Url: https://codereview.chromium.org/2009253003
2016-05-25Remove FX_GAMMA() and friends. They do nothing.thestig
Review-Url: https://codereview.chromium.org/2017503002
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-25fix rotated and alpha bitmapscaryclark
Match the matrix supplied by PDFium to the one expected by Skia to draw bitmaps. Set up the color if the bitmap is an image mask. Additional work required to figure out when bitmap filtering should be applied. R=reed@google.com,dsinclair@chromium.org BUG= Review-Url: https://codereview.chromium.org/2004203003
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-19Remove agg from skia buildcaryclark
This removes the last vestiges of antigrain from a Skia-specific build. R=dsinclair@chromium.org,tsepez@chromium.org,thestig@chromium.org,reed@google.com Review-Url: https://codereview.chromium.org/1998623002
2016-05-19Clean up CFX_RenderDevice::DrawNormalText().thestig
Review-Url: https://codereview.chromium.org/1990583002
2016-05-17Don't use LCD antialiasing if Fontconfig doesn't support hintingthomasanderson
Some Freetype implementations (like the one packaged with Fedora) do not support hinting due to patents 6219025, 6239783, 6307566, 6225973, 6243070, 6393145, 6421054, 6282327, and 6624828; the latest one expires 10/7/19. This makes LCD antialiasing very ugly, so we instead fall back on NORMAL antialiasing. A before/after on Fedora: https://bugs.chromium.org/p/chromium/issues/detail?id=479400#c31 BUG=479400 Review-Url: https://codereview.chromium.org/1982263004
2016-05-16Fix the code that causes warningsweili
These are the left or newly added code which causes compilation warnings of "signed and unsigned comparison". Need to fix them before I re-enable the warning flag. BUG=pdfium:29 Review-Url: https://codereview.chromium.org/1986533002
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-13allow Skia to be the default graphics enginecaryclark
PDFium uses fxge to denote the graphics engine used for general rendering. When pdf_use_skia=1 is set, use Skia as the default engine instead of antigrain. R=tsepez@chromium.org,dsinclair@chromium.org Review-Url: https://codereview.chromium.org/1975143002
2016-05-12Clean up CFX_ImageTransformer.thestig
Review-Url: https://codereview.chromium.org/1973913002
2016-05-12put change to CFX_ImageStretcher in Skia as wellcaryclark
R=tsepez@chromium.org,thestig@chromium.org Review-Url: https://codereview.chromium.org/1975823002
2016-05-11Clean up CFX_ImageStretcher.thestig
Review-Url: https://codereview.chromium.org/1968273002