7#ifndef CORE_FXGE_CFX_RENDERDEVICE_H_
8#define CORE_FXGE_CFX_RENDERDEVICE_H_
13#include "build/build_config.h"
14#include "core/fxcrt/fx_coordinates.h"
15#include "core/fxcrt/retain_ptr.h"
16#include "core/fxcrt/unowned_ptr.h"
17#include "core/fxge/cfx_path.h"
18#include "core/fxge/dib/fx_dib.h"
19#include "core/fxge/render_defines.h"
20#include "core/fxge/renderdevicedriver_iface.h"
21#include "third_party/base/containers/span.h"
83 uint32_t stroke_color,
89 uint32_t stroke_color,
141 std::unique_ptr<CFX_ImageRenderer>* handle);
147 std::unique_ptr<CFX_ImageRenderer>* handle,
164 uint32_t stroke_color,
171 int32_t nTransparency);
174 const FX_COLORREF& color);
177 const FX_COLORREF& color,
180 const CFX_PointF& ptMoveTo,
181 const CFX_PointF& ptLineTo,
182 const FX_COLORREF& color,
191 int32_t nTransparency);
193 const std::vector<CFX_PointF>& points,
194 const FX_COLORREF& color);
197 int32_t nTransparency,
200 bool DrawShading(
const CPDF_ShadingPattern* pPattern,
212#if defined(PDF_USE_SKIA)
227 void SetDeviceDriver(std::unique_ptr<RenderDeviceDriverIface> pDriver);
229 return m_pDeviceDriver.get();
233 void InitDeviceInfo();
234 void UpdateClipBox();
235 bool DrawFillStrokePath(
const CFX_Path& path,
239 uint32_t stroke_color,
242 bool DrawCosmeticLine(
const CFX_PointF& ptMoveTo,
243 const CFX_PointF& ptLineTo,
247 void DrawZeroAreaPath(
const std::vector<CFX_Path::Point>& path,
254 bool FillRectWithBlend(
const FX_RECT& rect,
262 int m_RenderCaps = 0;
265 std::unique_ptr<RenderDeviceDriverIface> m_pDeviceDriver;
static bool UseSkiaRenderer()
bool Create(int width, int height, FXDIB_Format format, RetainPtr< CFX_DIBitmap > pBackdropBitmap)
bool Attach(RetainPtr< CFX_DIBitmap > pBitmap)
~CFX_DefaultRenderDevice() override
bool AttachWithBackdropAndGroupKnockout(RetainPtr< CFX_DIBitmap > pBitmap, RetainPtr< CFX_DIBitmap > pBackdropBitmap, bool bGroupKnockout)
bool AttachWithRgbByteOrder(RetainPtr< CFX_DIBitmap > pBitmap, bool bRgbByteOrder)
CFX_DefaultRenderDevice()
void Clear(uint32_t color)
StateRestorer(CFX_RenderDevice *pDevice)
void DrawBorder(const CFX_Matrix *pUser2Device, const CFX_FloatRect &rect, float fWidth, const CFX_Color &color, const CFX_Color &crLeftTop, const CFX_Color &crRightBottom, BorderStyle nStyle, int32_t nTransparency)
bool StretchBitMask(RetainPtr< CFX_DIBBase > bitmap, int left, int top, int dest_width, int dest_height, uint32_t color)
bool MultiplyAlpha(float alpha)
bool DrawTextPath(pdfium::span< const TextCharPos > pCharPos, CFX_Font *pFont, float font_size, const CFX_Matrix &mtText2User, const CFX_Matrix *pUser2Device, const CFX_GraphStateData *pGraphState, uint32_t fill_color, uint32_t stroke_color, CFX_Path *pClippingPath, const CFX_FillRenderOptions &fill_options)
bool SetClip_Rect(const FX_RECT &pRect)
virtual ~CFX_RenderDevice()
bool SetClip_PathFill(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_FillRenderOptions &fill_options)
bool StretchDIBits(RetainPtr< const CFX_DIBBase > bitmap, int left, int top, int dest_width, int dest_height)
bool SetClip_PathStroke(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState)
RenderDeviceDriverIface * GetDeviceDriver() const
void SetBaseClip(const FX_RECT &rect)
bool GetDIBits(const RetainPtr< CFX_DIBitmap > &pBitmap, int left, int top)
bool FillRect(const FX_RECT &rect, uint32_t color)
bool StretchDIBitsWithFlagsAndBlend(RetainPtr< const CFX_DIBBase > bitmap, int left, int top, int dest_width, int dest_height, const FXDIB_ResampleOptions &options, BlendMode blend_mode)
bool MultiplyAlphaMask(const RetainPtr< const CFX_DIBBase > &mask)
bool ContinueDIBits(CFX_ImageRenderer *handle, PauseIndicatorIface *pPause)
void DrawFillRect(const CFX_Matrix *pUser2Device, const CFX_FloatRect &rect, const FX_COLORREF &color)
RetainPtr< const CFX_DIBitmap > GetBitmap() const
void SetDeviceDriver(std::unique_ptr< RenderDeviceDriverIface > pDriver)
bool DrawShading(const CPDF_ShadingPattern *pPattern, const CFX_Matrix *pMatrix, const FX_RECT &clip_rect, int alpha, bool bAlphaMode)
static CFX_Matrix GetFlipMatrix(float width, float height, float left, float top)
void DrawFillArea(const CFX_Matrix &mtUser2Device, const std::vector< CFX_PointF > &points, const FX_COLORREF &color)
bool StartDIBits(RetainPtr< const CFX_DIBBase > bitmap, float alpha, uint32_t argb, const CFX_Matrix &matrix, const FXDIB_ResampleOptions &options, std::unique_ptr< CFX_ImageRenderer > *handle)
bool StretchBitMaskWithFlags(RetainPtr< CFX_DIBBase > bitmap, int left, int top, int dest_width, int dest_height, uint32_t argb, const FXDIB_ResampleOptions &options)
bool DrawPath(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState, uint32_t fill_color, uint32_t stroke_color, const CFX_FillRenderOptions &fill_options)
RetainPtr< CFX_DIBitmap > GetBackDrop()
void SetBitmap(RetainPtr< CFX_DIBitmap > bitmap)
void DrawShadow(const CFX_Matrix &mtUser2Device, const CFX_FloatRect &rect, int32_t nTransparency, int32_t nStartGray, int32_t nEndGray)
bool SetDIBitsWithBlend(const RetainPtr< const CFX_DIBBase > &pBitmap, int left, int top, BlendMode blend_mode)
void DrawStrokeLine(const CFX_Matrix *pUser2Device, const CFX_PointF &ptMoveTo, const CFX_PointF &ptLineTo, const FX_COLORREF &color, float fWidth)
bool StartDIBitsWithBlend(RetainPtr< const CFX_DIBBase > bitmap, float alpha, uint32_t argb, const CFX_Matrix &matrix, const FXDIB_ResampleOptions &options, std::unique_ptr< CFX_ImageRenderer > *handle, BlendMode blend_mode)
int GetRenderCaps() const
bool DrawNormalText(pdfium::span< const TextCharPos > pCharPos, CFX_Font *pFont, float font_size, const CFX_Matrix &mtText2Device, uint32_t fill_color, const CFX_TextRenderOptions &options)
bool DrawPathWithBlend(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState, uint32_t fill_color, uint32_t stroke_color, const CFX_FillRenderOptions &fill_options, BlendMode blend_type)
void DrawStrokeRect(const CFX_Matrix &mtUser2Device, const CFX_FloatRect &rect, const FX_COLORREF &color, float fWidth)
RetainPtr< CFX_DIBitmap > GetBitmap()
const FX_RECT & GetClipBox() const
int GetDeviceCaps(int id) const
void RestoreState(bool bKeepSaved)
bool SetDIBits(const RetainPtr< const CFX_DIBBase > &pBitmap, int left, int top)
bool CreateCompatibleBitmap(const RetainPtr< CFX_DIBitmap > &pDIB, int width, int height) const
DeviceType GetDeviceType() const
bool SetBitMask(const RetainPtr< CFX_DIBBase > &pBitmap, int left, int top, uint32_t argb)
void DrawFillRect(const CFX_Matrix *pUser2Device, const CFX_FloatRect &rect, const CFX_Color &color, int32_t nTransparency)
void RemoveGoodbyeObject()
void VerifySavedHelloWorldDocumentWithPassword(const char *password)
void VerifySavedModifiedHelloWorldDocumentWithPassword(const char *password)
void OpenAndVerifyHelloWorldDocumentWithPassword(const char *filename, const char *password)
void RemoveTrailerIdFromDocument()
RetainPtr< CPDF_Object > RemoveFor(ByteStringView key)
CPDF_Parser * GetParser() const
CPDF_Dictionary * GetMutableTrailerForTesting()
FPDF_DOCUMENT OpenSavedDocumentWithPassword(const char *password)
void CloseSavedDocument()
static void CompareBitmap(FPDF_BITMAP bitmap, int expected_width, int expected_height, const char *expected_md5sum)
void UnloadPage(FPDF_PAGE page)
FPDF_DOCUMENT document() const
void CloseSavedPage(FPDF_PAGE page)
FPDF_PAGE LoadPage(int page_number)
FPDF_PAGE LoadSavedPage(int page_number)
TEST_F(CPDFSecurityHandlerEmbedderTest, Unencrypted)
#define FPDF_FILLMODE_ALTERNATE
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path, int fillmode, FPDF_BOOL stroke)
FPDF_EXPORT void FPDF_CALLCONV FPDFPage_InsertObject(FPDF_PAGE page, FPDF_PAGEOBJECT page_object)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPageObj_SetFillColor(FPDF_PAGEOBJECT page_object, unsigned int R, unsigned int G, unsigned int B, unsigned int A)
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateNewRect(float x, float y, float w, float h)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_GenerateContent(FPDF_PAGE page)
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_LoadCustomDocument(FPDF_FILEACCESS *pFileAccess, FPDF_BYTESTRING password)
const char * HelloWorldChecksum()
const char * HelloWorldRemovedChecksum()