5#ifndef CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_
6#define CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_
12#include "core/fxcrt/check_op.h"
13#include "core/fxcrt/data_vector.h"
14#include "core/fxcrt/fx_memory_wrappers.h"
15#include "core/fxcrt/retain_ptr.h"
16#include "core/fxcrt/span.h"
17#include "core/fxcrt/unowned_ptr.h"
18#include "core/fxge/cfx_fillrenderoptions.h"
19#include "core/fxge/cfx_path.h"
20#include "core/fxge/renderdevicedriver_iface.h"
21#include "third_party/skia/include/core/SkPoint.h"
22#include "third_party/skia/include/core/SkRSXform.h"
23#include "third_party/skia/include/core/SkRefCnt.h"
64 uint32_t stroke_color,
70 int top)
const override;
113 bool DrawShading(
const CPDF_ShadingPattern& pattern,
121 void Clear(uint32_t color);
130 const DataVector<SkPoint>& GetPositions()
const {
return m_positions; }
131 void SetPositionAt(size_t index,
const SkPoint& position) {
132 m_positions[index] = position;
134 const DataVector<uint16_t>& GetGlyphs()
const {
return m_glyphs; }
135 void SetGlyphAt(size_t index, uint16_t glyph) { m_glyphs[index] = glyph; }
136 const DataVector<uint32_t>& GetFontCharWidths()
const {
137 return m_fontCharWidths;
139 void SetFontCharWidthAt(size_t index, uint32_t width) {
140 m_fontCharWidths[index] = width;
142 size_t Count()
const {
143 DCHECK_EQ(m_positions.size(), m_glyphs.size());
144 return m_glyphs.size();
146 void SetCount(size_t count) {
147 m_positions.resize(count);
148 m_glyphs.resize(count);
149 m_fontCharWidths.resize(count);
153 DataVector<SkPoint> m_positions;
154 DataVector<uint16_t> m_glyphs;
156 DataVector<uint32_t> m_fontCharWidths;
160 CFX_SkiaDeviceDriver(
RetainPtr<CFX_DIBitmap> pBitmap,
163 bool bGroupKnockout);
164 explicit CFX_SkiaDeviceDriver(SkCanvas& canvas);
166 bool TryDrawText(pdfium::span<
const TextCharPos> char_pos,
182 void DrawPathImpl(
const SkPath& path,
const SkPaint& paint);
185 RetainPtr<CFX_DIBitmap> m_pBackdropBitmap;
189 RetainPtr<CFX_DIBitmap> m_pOriginalBitmap;
191 sk_sp<SkSurface> surface_;
194 bool m_bRgbByteOrder;
195 bool m_bGroupKnockout;
197 CharDetail m_charDetails;
199 DataVector<SkRSXform> m_rsxform;
uint32_t GetBits(uint32_t nBits)
FXDIB_Format GetFormat() const
void SetFormat(FXDIB_Format format)
uint32_t GetPitch() const
static bool UseSkiaRenderer()
constexpr CFX_FloatRect(float l, float b, float r, float t)
void Intersect(const CFX_FloatRect &other_rect)
FX_RECT GetOuterRect() const
int GetSubstFontItalicAngle() const
FXFT_FaceRec * GetFaceRec() const
constexpr CFX_Matrix()=default
static CFX_Matrix GetFlipMatrix(float width, float height, float left, float top)
void SetBitmap(RetainPtr< CFX_DIBitmap > bitmap)
~CFX_SkiaDeviceDriver() override
bool DrawBitsWithMask(RetainPtr< const CFX_DIBBase > bitmap, RetainPtr< const CFX_DIBBase > mask, float alpha, const CFX_Matrix &matrix, BlendMode blend_type)
void SyncInternalBitmaps() override
bool DrawDeviceText(pdfium::span< const TextCharPos > pCharPos, CFX_Font *pFont, const CFX_Matrix &mtObject2Device, float font_size, uint32_t color, const CFX_TextRenderOptions &options) override
bool MultiplyAlpha(float alpha) override
StartResult StartDIBits(RetainPtr< const CFX_DIBBase > bitmap, float alpha, uint32_t color, const CFX_Matrix &matrix, const FXDIB_ResampleOptions &options, BlendMode blend_type) override
bool FillRect(const FX_RECT &rect, uint32_t fill_color) override
bool DrawShading(const CPDF_ShadingPattern &pattern, const CFX_Matrix &matrix, const FX_RECT &clip_rect, int alpha) override
void SetGroupKnockout(bool group_knockout) override
DeviceType GetDeviceType() const override
void SaveState() override
bool MultiplyAlphaMask(RetainPtr< const CFX_DIBitmap > mask) override
static std::unique_ptr< CFX_SkiaDeviceDriver > Create(SkCanvas &canvas)
bool SetClip_PathFill(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_FillRenderOptions &fill_options) override
RetainPtr< const CFX_DIBitmap > GetBackDrop() const override
static std::unique_ptr< CFX_SkiaDeviceDriver > Create(RetainPtr< CFX_DIBitmap > pBitmap, bool bRgbByteOrder, RetainPtr< CFX_DIBitmap > pBackdropBitmap, bool bGroupKnockout)
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) override
int GetDriverType() const override
int GetDeviceCaps(int caps_id) const override
bool SetDIBits(RetainPtr< const CFX_DIBBase > bitmap, uint32_t color, const FX_RECT &src_rect, int dest_left, int dest_top, BlendMode blend_type) override
FX_RECT GetClipBox() const override
bool StretchDIBits(RetainPtr< const CFX_DIBBase > bitmap, uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT *pClipRect, const FXDIB_ResampleOptions &options, BlendMode blend_type) override
void RestoreState(bool bKeepSaved) override
bool GetDIBits(RetainPtr< CFX_DIBitmap > bitmap, int left, int top) const override
bool SetClip_PathStroke(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState) override
bool SetBitsWithMask(RetainPtr< const CFX_DIBBase > bitmap, RetainPtr< const CFX_DIBBase > mask, int dest_left, int dest_top, float alpha, BlendMode blend_type) override
void Clear(uint32_t color)
std::vector< RetainPtr< CPDF_Object > >::const_iterator const_iterator
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
float GetExponent() const
uint32_t GetOrigOutputs() const
uint32_t InputCount() const
float GetRange(int i) const
float GetDomain(int i) const
uint32_t OutputCount() const
uint32_t ReadFlag() const
uint32_t GetBitsPerSample() const
ShadingType GetShadingType() const
static bool UseInterpolateBilinear(const FXDIB_ResampleOptions &options, int dest_width, int dest_height, int src_width, int src_height)
CFX_PTemplate< float > CFX_PointF
#define FX_DATA_PARTITION_EXCEPTION(T)
#define NOTREACHED_NORETURN()
#define FXRC_ALPHA_OUTPUT
#define FXDC_PIXEL_HEIGHT
constexpr CFX_FillRenderOptions()
AliasingType aliasing_type
bool bInterpolateBilinear