7#include "core/fxge/win32/cgdi_printer_driver.h"
16#include "core/fxcrt/fx_memory.h"
17#include "core/fxcrt/fx_system.h"
18#include "core/fxcrt/retain_ptr.h"
19#include "core/fxge/cfx_font.h"
20#include "core/fxge/cfx_windowsrenderdevice.h"
21#include "core/fxge/dib/cfx_dibbase.h"
22#include "core/fxge/dib/cfx_dibitmap.h"
23#include "core/fxge/render_defines.h"
24#include "core/fxge/text_char_pos.h"
25#include "third_party/base/check.h"
26#include "third_party/base/check_op.h"
49 if (pSource->IsMaskFormat()) {
52 int dest_width = pSource->GetWidth();
53 int dest_height = pSource->GetHeight();
55 top - src_rect
.top, dest_width
, dest_height
,
61 if (pSource->IsAlphaFormat())
76 if (bitmap->IsMaskFormat()) {
78 if (bitmap->GetBPP() != 1 || alpha != 255) {
82 if (dest_width < 0 || dest_height < 0) {
83 bitmap = bitmap->FlipImage(dest_width < 0, dest_height < 0);
89 dest_left += dest_width;
91 dest_top += dest_height;
93 dest_width = abs(dest_width);
94 dest_height = abs(dest_height);
98 dest_width
, dest_height
, color
);
101 if (bitmap->IsAlphaFormat()) {
105 if (dest_width < 0 || dest_height < 0) {
106 bitmap = bitmap->FlipImage(dest_width < 0, dest_height < 0);
112 dest_left += dest_width;
114 dest_top += dest_height;
116 dest_width = abs(dest_width);
117 dest_height = abs(dest_height);
121 dest_height
, options
);
129 std::unique_ptr<CFX_ImageRenderer>* handle,
131 if (alpha != 1.0f || bitmap->IsAlphaFormat() ||
132 (bitmap->IsMaskFormat() && (bitmap->GetBPP() != 1))) {
137 if (fabs(matrix
.b) < 0.5f && matrix
.a != 0 && fabs(matrix
.c) < 0.5f &&
139 bool bFlipX = matrix
.a < 0;
140 bool bFlipY = matrix
.d > 0;
148 if (fabs(matrix
.a) >= 0.5f || fabs(matrix
.d) >= 0.5f)
151 const bool flip_x = matrix
.c > 0;
152 const bool flip_y = matrix
.b < 0;
153 bitmap = bitmap->SwapXY(flip_x, flip_y);
FX_RECT GetOuterRect() const
CFX_FloatRect GetUnitRect() const
bool GDI_SetDIBits(const RetainPtr< const CFX_DIBBase > &source, const FX_RECT &src_rect, int left, int top)
bool GDI_StretchDIBits(RetainPtr< const CFX_DIBBase > source, int dest_left, int dest_top, int dest_width, int dest_height, const FXDIB_ResampleOptions &options)
int GetDeviceCaps(int caps_id) const override
bool GDI_StretchBitMask(RetainPtr< const CFX_DIBBase > source, int dest_left, int dest_top, int dest_width, int dest_height, uint32_t bitmap_color)
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
bool SetDIBits(const RetainPtr< const CFX_DIBBase > &pBitmap, uint32_t color, const FX_RECT &src_rect, int left, int top, BlendMode blend_type) override
~CGdiPrinterDriver() override
int GetDeviceCaps(int caps_id) const 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 StartDIBits(RetainPtr< const CFX_DIBBase > bitmap, float alpha, uint32_t color, const CFX_Matrix &matrix, const FXDIB_ResampleOptions &options, std::unique_ptr< CFX_ImageRenderer > *handle, BlendMode blend_type) override
CGdiPrinterDriver(HDC hDC)
constexpr FX_RECT(int l, int t, int r, int b)