summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_renderdevice.h
AgeCommit message (Collapse)Author
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-08-24Rename CFX_DIBSource to CFX_DIBBase.Tom Sepez
It is not a source from which you can get CFX_DIBs, but rather a base class from which all DIBs inherit. Do the same thing for the CPDF_DIBSource wrapper class. Mechanical change apart from adding a one-line comment in cfx_dibbase.h Change-Id: Id2bde87813ca301d9fafc55ce08d703dfc6a7184 Reviewed-on: https://pdfium-review.googlesource.com/41352 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-04-12Clean up some CFX_RenderDevice code.Lei Zhang
- Pass matrices by const-ref instead of by pointers. - Mark one SetClip_Rect() variant as XFA-only. - Pass std::vector into DrawFillArea(). - Simplify the only DrawFillArea() caller. Change-Id: I8f7497e4d46345d50ac4cc8f3e7eef135644e7a7 Reviewed-on: https://pdfium-review.googlesource.com/30131 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-10Change CFX_RenderDevice::FillRect() to take FX_RECT by const-ref.Lei Zhang
It currently takes const FX_RECT*, but the pointer is never nullptr. Change-Id: I571e9e8dd04756bc4daa25a61a5af8d1f902914b Reviewed-on: https://pdfium-review.googlesource.com/30052 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-10Change FillRectWithBlend methods to take FX_RECT by const-ref.Lei Zhang
They currently take const FX_RECT*, but the pointer is never nullptr. Also add a comment to explain why FX_RECT is the way it is. It has the same layout as a win32 RECT. Change-Id: Icf0e4c3eb25fe03317590a736578e053b9dccf7a Reviewed-on: https://pdfium-review.googlesource.com/30051 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-09Remove RenderDeviceDriverIface::GetCTM().Lei Zhang
It has no overrides and always returns the identity matrix. Many callers that use the returned value can be simplified, because they are scaling by 1 or concatenating an identity matrix. Change-Id: I7afb7214be210d02638644dfb9b58404420c2ef2 Reviewed-on: https://pdfium-review.googlesource.com/29972 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-03Re-arrange so inline vectors come last in structs.Tom Sepez
This might make the memory tools more effective in finding OOBs. Change-Id: Id093bb0a88c37954c80d612ac00b5a168e75bdbf Reviewed-on: https://pdfium-review.googlesource.com/29550 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-03-28Remove CPDF_DefaultAppearance reference paramsDan Sinclair
This CL converts the CPDF_DefaultAppearance::GetColor methods to return instead of using reference parameters. Change-Id: I9ba6bf060a536290a83d3c9ce6e115511f28664c Reviewed-on: https://pdfium-review.googlesource.com/29410 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@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-03-06Rename core/fxcrt IFX files to IfaceDan Sinclair
This CL renames the 3 IFX files in core/fxcrt to Iface instead. Change-Id: I7cee6836650b71bc5c5729a8147fda62f0910fe3 Reviewed-on: https://pdfium-review.googlesource.com/27970 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-01-30Use unsigned for char widthchromium/3335Nicolas Pena
Bug: 806612 Change-Id: I22bd9046dd37a1b596762c46a6b29a323d6e9fa1 Reviewed-on: https://pdfium-review.googlesource.com/24410 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@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-12Move some RetainPtr getters/setters out of headers.Lei Zhang
RetainPtr operations are not trivial. Change-Id: Ic106ada69d1c023a8132a2a59db17d550fd81fa0 Reviewed-on: https://pdfium-review.googlesource.com/22911 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-10-02Removing unused definesDan Sinclair
Remove unused defines. Change-Id: Ibf10d8470f19cbf4528fe1342398a39ef15c1d12 Reviewed-on: https://pdfium-review.googlesource.com/15110 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-09-27Cleanup some font headersDan Sinclair
This CL moves some font defines to the only .cpp file they're used in and removes un-needed forward declarations from fx_font.h. Change-Id: Ic291a42d6bddfa6537111a7d42728802236e6e26 Reviewed-on: https://pdfium-review.googlesource.com/14970 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-09-27Cleanup FX macrosDan Sinclair
This CL renames the FX_OS defines to have _OS_ in their names and drops the _DESKTOP suffix. The FXM defines have been changed to just FX. Change-Id: Iab172fba541713b5f6d14fb8098baf68e3364c74 Reviewed-on: https://pdfium-review.googlesource.com/14833 Reviewed-by: Tom Sepez <tsepez@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-08-31Split IFX_Pause out of fx_basicDan Sinclair
This CL moves IFX_Pause out to its own class from fx_basic and updates includes as needed. Change-Id: Iebdd183d8c85aa17570f190f1a7d1602c0af3c8b Reviewed-on: https://pdfium-review.googlesource.com/12491 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@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-15Change a bunch of methods to take a const CFX_Matrix& param.chromium/3187Lei Zhang
Simplify some code along the way. Change-Id: I0022c8a82188192c63b9ac0bc87e9b9dbf983040 Reviewed-on: https://pdfium-review.googlesource.com/10852 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-15Remove CFDE_RenderDeviceDan Sinclair
This CL removes CFDE_RenderDevice. For most of the proxy'd calls we call the CFX_RenderDevice directly now. To set the clip rect an overload was added to accept a CFX_RectF and handle the casting to FX_RECT. The one needed method, DrawString, is move to a static on CFDE_TextOut. Change-Id: I95ea7e1fa1fd4702074b797c06423c9c9cb51db9 Reviewed-on: https://pdfium-review.googlesource.com/10951 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-25flush but do not release skia driverCary Clark
Most calls to the Skia Driver combine flushing the draw cache with deleting the driver itself. Progressive drawing needs to flush the cache to keep drawing in order, but the driver must remain for the next progressive draw. R=dsinclair@chromium.org, hnakashima@chromium.org Bug: pdfium:833 Change-Id: I311f80b2dc0ef6e4df9a3a0f082ae076cb7a591f Reviewed-on: https://pdfium-review.googlesource.com/8890 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-17Move CPWL_Utils Draw methods to CFX_RenderDeviceDan Sinclair
This CL removes the drawing code from the AP stream generation code in CPWL_Utils and places it in CFX_RenderDevice. Change-Id: I5335fc38368740ba3ddc676ee856201a358979fc Reviewed-on: https://pdfium-review.googlesource.com/7715 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-11Cleanup CFX_RenderDeviceNicolas Pena
This CL adds some helper namespace methods and cleans up methods. Change-Id: I7ef51dd1ff365d307694a10519d532698ee39211 Reviewed-on: https://pdfium-review.googlesource.com/7550 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@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-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-04-21Add CFX_RenderDevice::AutoRestorer()chromium/3078Tom Sepez
Avoid cleanup on every return path. Change-Id: I6978adb6f31020d812ac88c5d46c703d1461d373 Reviewed-on: https://pdfium-review.googlesource.com/4435 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-04Let CPDF_ImageRenderer own the CFX_ImageRendererNicolas Pena
This CL avoids some void* usage and removes CancelDIBits after making a CPDF_ImageRenderer own its CFX_ImageRenderer. Bug: pdfium:686 Change-Id: Ied205c57a858cc14d8e2c592db3444ed465b2796 Reviewed-on: https://pdfium-review.googlesource.com/3673 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-28Revert "Revert "Refcount all CFX_DIBSources (and subclasses) all the time.""Tom Sepez
This reverts commit 31b08d4cdaa17d7a03f35e087096a77036af98ec. Re-landing the patch after fixing skia build issue. Change-Id: Ie7039890088b803a6ec5ce365d70f57277459b48 Reviewed-on: https://pdfium-review.googlesource.com/3245 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-28Revert "Refcount all CFX_DIBSources (and subclasses) all the time."dsinclair
This reverts commit 0004f29bf6ee3c6060a272c79f14993e92e053c7. Reason for revert: Breaks build with skia_paths enabled (which will break the chrome roll). ../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:1858:38: error: no member named 'get' in 'CFX_RetainPtr<CFX_DIBitmap>' ../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:1861:42: error: no member named 'get' in 'CFX_RetainPtr<CFX_DIBitmap>' ../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:2987:15: error: no viable overloaded '=' ../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:2991:18: error: no viable overloaded '=' ../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:2999:17: error: no viable overloaded '=' ../../third_party/pdfium/core/fxge/skia/fx_skia_device.cpp:3001:43: error: no member named 'GetObject' in 'CFX_RetainPtr<CFX_DIBitmap>' Original change's description: > Refcount all CFX_DIBSources (and subclasses) all the time. > > There are currently several ownership models for these objects, > including ad-hoc logic for sharing and deletion, and the > now-redundant CFX_DIBitmapRef externally-counted handle to the DIBs. > > Replace them all with the internal refcount scheme. > > Change-Id: I2db399dfc19219eda384f94cc989353b78ce2872 > Reviewed-on: https://pdfium-review.googlesource.com/3166 > Reviewed-by: dsinclair <dsinclair@chromium.org> > Commit-Queue: dsinclair <dsinclair@chromium.org> > TBR=thestig@chromium.org,tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I678b1fbc5e666cf7a19372ebaff3270fb115ba5e Reviewed-on: https://pdfium-review.googlesource.com/3243 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-28Refcount all CFX_DIBSources (and subclasses) all the time.Tom Sepez
There are currently several ownership models for these objects, including ad-hoc logic for sharing and deletion, and the now-redundant CFX_DIBitmapRef externally-counted handle to the DIBs. Replace them all with the internal refcount scheme. Change-Id: I2db399dfc19219eda384f94cc989353b78ce2872 Reviewed-on: https://pdfium-review.googlesource.com/3166 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-14Replace FX_FLOAT with underlying float type.Dan Sinclair
Change-Id: I158b7d80b0ec28b742a9f2d5a96f3dde7fb3ab56 Reviewed-on: https://pdfium-review.googlesource.com/3031 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-02-16Change FXTEXT_CHARPOS to use CFX_PointFDan Sinclair
This CL updates the Origin x,y coordinates in FXTEXT_CHARPOS to be an CFX_PointF. Change-Id: I67281db2cb82687e12490145f7c99aee908e5fa8 Reviewed-on: https://pdfium-review.googlesource.com/2718 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-02-14Revert "Convert Origins to points"Dan Sinclair
This reverts commit da83d3a5cc09c4056310b3cf299dbbccd5c70d11. Reason for revert: Reverting chain to see if fixes Chrome roll. Original change's description: > Convert Origins to points > > This CL converts various OriginX, OriginY pairs into CFX_PointF objects. > > Change-Id: I9141f7fc713c710b2014d4fdcdec7dc93501f844 > Reviewed-on: https://pdfium-review.googlesource.com/2575 > Commit-Queue: dsinclair <dsinclair@chromium.org> > Reviewed-by: Nicolás Peña <npm@chromium.org> > TBR=tsepez@chromium.org,dsinclair@chromium.org,npm@chromium.org,pdfium-reviews@googlegroups.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= Change-Id: I949fb4ec712e2587e7d0ef0191c34db198b61dcc Reviewed-on: https://pdfium-review.googlesource.com/2696 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-02-13Convert Origins to pointsDan Sinclair
This CL converts various OriginX, OriginY pairs into CFX_PointF objects. Change-Id: I9141f7fc713c710b2014d4fdcdec7dc93501f844 Reviewed-on: https://pdfium-review.googlesource.com/2575 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-02-07Use enum class for PathPoint types.Nicolas Pena
This hopefully makes it less confusing what the description of a point is. Currently we have defines for the types, which is confusing because a point can only be one of the three. And it is mixed up with whether the point is closing a figure or not. Change-Id: Icd71355d69c77b3d52ca78e03bc379081ff87753 Reviewed-on: https://pdfium-review.googlesource.com/2552 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-12-06re-enable skia cachingchromium/2944caryclark
This permits consecutive path drawing or text drawing to combine if their graphics state matches. This speeds up rendering considerably when PDFium draws in many small parts. It also allows discarding changes to the clip state that have no effect from draw to draw. All corpus tests draw equivalently with caching enabled or disabled. Change the member order in CPDF_PageRenderContext so the device is flushed before the referencing annotation is deleted. Add more printf style debugging for test draws. R=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2546803003
2016-11-22handle antialiased rendering as premultipliedcaryclark
Transparencies and bitmap patterns need to be unpremultiplied after Skia renders them so that PDFium can use its own compositing. Also added some linear (i.e. axial) gradient support, although its unclear if any of the test corpus uses this feature. R=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2520073003
2016-11-17fix corpus testscaryclark
All corpus tests draw reasonably well. There are pixel differences, but no missing features or large scale errors. This was verified by running run_corpus_tests.py on skiapaths and agg build dirs, then running the skdiff tool to generate a report of the pixel difference. For example, after running $ ninja -C out/skia skdiff $ ./out/skia/skdiff /repo/pdfium/out/agg/gen/pdfium/testing/corpus/ /repo/pdfium/out/skiapaths/gen/pdfium/testing/corpus/ ~/aggskiadiffs view the report in a browser at ~/aggskiadiffs/index.html R=dsinclair@chromium.org BUG=skia:5973 Review-Url: https://codereview.chromium.org/2504863003
2016-11-02Remove FX_BOOL from coretsepez
Review-Url: https://codereview.chromium.org/2477443002
2016-09-29Move core/fxge/include to core/fxgedsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2377393002