Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1647)

Unified Diff: core/fxge/win32/fx_win32_print.cpp

Issue 2019603002: Remove unused PS generation code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@print_clean
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxge/win32/fx_win32_device.cpp ('k') | core/fxge/win32/win32_int.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/win32/fx_win32_print.cpp
diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp
index e46beeefbd6434736211e0d3ee7b7e1c4e4143e3..08029bc351125a0edfcd4baef90de74eadf8d8d7 100644
--- a/core/fxge/win32/fx_win32_print.cpp
+++ b/core/fxge/win32/fx_win32_print.cpp
@@ -276,199 +276,4 @@ FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource,
return ret;
}
-CPSOutput::CPSOutput(HDC hDC) {
- m_hDC = hDC;
- m_pBuf = NULL;
-}
-CPSOutput::~CPSOutput() {
- FX_Free(m_pBuf);
-}
-void CPSOutput::Init() {
- m_pBuf = FX_Alloc(FX_CHAR, 1026);
-}
-void CPSOutput::OutputPS(const FX_CHAR* str, int len) {
- if (len < 0) {
- len = (int)FXSYS_strlen(str);
- }
- int sent_len = 0;
- while (len > 0) {
- int send_len = len > 1024 ? 1024 : len;
- *(uint16_t*)m_pBuf = send_len;
- FXSYS_memcpy(m_pBuf + 2, str + sent_len, send_len);
- ExtEscape(m_hDC, PASSTHROUGH, send_len + 2, m_pBuf, 0, NULL);
- sent_len += send_len;
- len -= send_len;
- }
-}
-CPSPrinterDriver::CPSPrinterDriver() {
- m_pPSOutput = NULL;
- m_bCmykOutput = FALSE;
-}
-CPSPrinterDriver::~CPSPrinterDriver() {
- EndRendering();
- delete m_pPSOutput;
-}
-FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput) {
- m_hDC = hDC;
- m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE);
- m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE);
- m_Width = ::GetDeviceCaps(m_hDC, HORZRES);
- m_Height = ::GetDeviceCaps(m_hDC, VERTRES);
- m_nBitsPerPixel = ::GetDeviceCaps(m_hDC, BITSPIXEL);
- m_pPSOutput = new CPSOutput(hDC);
- ((CPSOutput*)m_pPSOutput)->Init();
- m_PSRenderer.Init(m_pPSOutput, pslevel, m_Width, m_Height, bCmykOutput);
- m_bCmykOutput = bCmykOutput;
- HRGN hRgn = ::CreateRectRgn(0, 0, 1, 1);
- int ret = ::GetClipRgn(hDC, hRgn);
- if (ret == 1) {
- ret = ::GetRegionData(hRgn, 0, NULL);
- if (ret) {
- RGNDATA* pData = (RGNDATA*)FX_Alloc(uint8_t, ret);
- ret = ::GetRegionData(hRgn, ret, pData);
- if (ret) {
- CFX_PathData path;
- path.AllocPointCount(pData->rdh.nCount * 5);
- for (uint32_t i = 0; i < pData->rdh.nCount; i++) {
- RECT* pRect = (RECT*)(pData->Buffer + pData->rdh.nRgnSize * i);
- path.AppendRect((FX_FLOAT)pRect->left, (FX_FLOAT)pRect->bottom,
- (FX_FLOAT)pRect->right, (FX_FLOAT)pRect->top);
- }
- m_PSRenderer.SetClip_PathFill(&path, NULL, FXFILL_WINDING);
- }
- FX_Free(pData);
- }
- }
- ::DeleteObject(hRgn);
- return TRUE;
-}
-int CPSPrinterDriver::GetDeviceCaps(int caps_id) {
- switch (caps_id) {
- case FXDC_DEVICE_CLASS:
- return FXDC_PRINTER;
- case FXDC_PIXEL_WIDTH:
- return m_Width;
- case FXDC_PIXEL_HEIGHT:
- return m_Height;
- case FXDC_BITS_PIXEL:
- return m_nBitsPerPixel;
- case FXDC_RENDER_CAPS:
- return m_bCmykOutput ? FXRC_BIT_MASK | FXRC_CMYK_OUTPUT : FXRC_BIT_MASK;
- case FXDC_HORZ_SIZE:
- return m_HorzSize;
- case FXDC_VERT_SIZE:
- return m_VertSize;
- }
- return 0;
-}
-FX_BOOL CPSPrinterDriver::StartRendering() {
- return m_PSRenderer.StartRendering();
-}
-void CPSPrinterDriver::EndRendering() {
- m_PSRenderer.EndRendering();
-}
-void CPSPrinterDriver::SaveState() {
- m_PSRenderer.SaveState();
-}
-
-void CPSPrinterDriver::RestoreState(bool bKeepSaved) {
- m_PSRenderer.RestoreState(bKeepSaved);
-}
-
-FX_BOOL CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData,
- const CFX_Matrix* pObject2Device,
- int fill_mode) {
- m_PSRenderer.SetClip_PathFill(pPathData, pObject2Device, fill_mode);
- return TRUE;
-}
-FX_BOOL CPSPrinterDriver::SetClip_PathStroke(
- const CFX_PathData* pPathData,
- const CFX_Matrix* pObject2Device,
- const CFX_GraphStateData* pGraphState) {
- m_PSRenderer.SetClip_PathStroke(pPathData, pObject2Device, pGraphState);
- return TRUE;
-}
-FX_BOOL CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData,
- const CFX_Matrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- FX_ARGB fill_color,
- FX_ARGB stroke_color,
- int fill_mode,
- int alpha_flag,
- void* pIccTransform,
- int blend_type) {
- if (blend_type != FXDIB_BLEND_NORMAL) {
- return FALSE;
- }
- return m_PSRenderer.DrawPath(pPathData, pObject2Device, pGraphState,
- fill_color, stroke_color, fill_mode & 3,
- alpha_flag, pIccTransform);
-}
-FX_BOOL CPSPrinterDriver::GetClipBox(FX_RECT* pRect) {
- *pRect = m_PSRenderer.GetClipBox();
- return TRUE;
-}
-FX_BOOL CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap,
- uint32_t color,
- const FX_RECT* pSrcRect,
- int left,
- int top,
- int blend_type,
- int alpha_flag,
- void* pIccTransform) {
- if (blend_type != FXDIB_BLEND_NORMAL) {
- return FALSE;
- }
- return m_PSRenderer.SetDIBits(pBitmap, color, left, top, alpha_flag,
- pIccTransform);
-}
-FX_BOOL CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
- uint32_t color,
- int dest_left,
- int dest_top,
- int dest_width,
- int dest_height,
- const FX_RECT* pClipRect,
- uint32_t flags,
- int alpha_flag,
- void* pIccTransform,
- int blend_type) {
- if (blend_type != FXDIB_BLEND_NORMAL) {
- return FALSE;
- }
- return m_PSRenderer.StretchDIBits(pBitmap, color, dest_left, dest_top,
- dest_width, dest_height, flags, alpha_flag,
- pIccTransform);
-}
-FX_BOOL CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap,
- int bitmap_alpha,
- uint32_t color,
- const CFX_Matrix* pMatrix,
- uint32_t render_flags,
- void*& handle,
- int alpha_flag,
- void* pIccTransform,
- int blend_type) {
- if (blend_type != FXDIB_BLEND_NORMAL) {
- return FALSE;
- }
- if (bitmap_alpha < 255) {
- return FALSE;
- }
- handle = NULL;
- return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags,
- alpha_flag, pIccTransform);
-}
-FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars,
- const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont,
- CFX_FontCache* pCache,
- const CFX_Matrix* pObject2Device,
- FX_FLOAT font_size,
- uint32_t color,
- int alpha_flag,
- void* pIccTransform) {
- return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device,
- font_size, color, alpha_flag, pIccTransform);
-}
#endif
« no previous file with comments | « core/fxge/win32/fx_win32_device.cpp ('k') | core/fxge/win32/win32_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698