OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_FXGE_INCLUDE_FX_GE_H_ | 7 #ifndef CORE_FXGE_INCLUDE_FX_GE_H_ |
8 #define CORE_FXGE_INCLUDE_FX_GE_H_ | 8 #define CORE_FXGE_INCLUDE_FX_GE_H_ |
9 | 9 |
10 #include "core/fxge/include/fx_dib.h" | 10 #include "core/fxge/include/fx_dib.h" |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 FX_BOOL bRgbByteOrder = FALSE, | 426 FX_BOOL bRgbByteOrder = FALSE, |
427 CFX_DIBitmap* pOriDevice = NULL, | 427 CFX_DIBitmap* pOriDevice = NULL, |
428 FX_BOOL bGroupKnockout = FALSE); | 428 FX_BOOL bGroupKnockout = FALSE); |
429 | 429 |
430 virtual ~IFX_RenderDeviceDriver() {} | 430 virtual ~IFX_RenderDeviceDriver() {} |
431 | 431 |
432 virtual int GetDeviceCaps(int caps_id) = 0; | 432 virtual int GetDeviceCaps(int caps_id) = 0; |
433 | 433 |
434 virtual CFX_Matrix GetCTM() const { return CFX_Matrix(); } | 434 virtual CFX_Matrix GetCTM() const { return CFX_Matrix(); } |
435 | 435 |
436 virtual FX_BOOL IsPSPrintDriver() { return FALSE; } | |
437 | |
438 virtual FX_BOOL StartRendering() { return TRUE; } | 436 virtual FX_BOOL StartRendering() { return TRUE; } |
439 | 437 |
440 virtual void EndRendering() {} | 438 virtual void EndRendering() {} |
441 | 439 |
442 virtual void SaveState() = 0; | 440 virtual void SaveState() = 0; |
443 | 441 |
444 virtual void RestoreState(bool bKeepSaved) = 0; | 442 virtual void RestoreState(bool bKeepSaved) = 0; |
445 | 443 |
446 virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | 444 virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
447 const CFX_Matrix* pObject2Device, | 445 const CFX_Matrix* pObject2Device, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 554 |
557 virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, | 555 virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, |
558 const CFX_Matrix* pMatrix, | 556 const CFX_Matrix* pMatrix, |
559 const FX_RECT& clip_rect, | 557 const FX_RECT& clip_rect, |
560 int alpha, | 558 int alpha, |
561 FX_BOOL bAlphaMode) { | 559 FX_BOOL bAlphaMode) { |
562 return false; | 560 return false; |
563 } | 561 } |
564 }; | 562 }; |
565 | 563 |
566 class IFX_PSOutput { | |
567 public: | |
568 virtual void Release() = 0; | |
569 virtual void OutputPS(const FX_CHAR* str, int len) = 0; | |
570 | |
571 protected: | |
572 virtual ~IFX_PSOutput() {} | |
573 }; | |
574 | |
575 class CFX_PSRenderer { | |
576 public: | |
577 CFX_PSRenderer(); | |
578 ~CFX_PSRenderer(); | |
579 | |
580 void Init(IFX_PSOutput* pOutput, | |
581 int ps_level, | |
582 int width, | |
583 int height, | |
584 FX_BOOL bCmykOutput); | |
585 FX_BOOL StartRendering(); | |
586 void EndRendering(); | |
587 void SaveState(); | |
588 void RestoreState(bool bKeepSaved); | |
589 void SetClip_PathFill(const CFX_PathData* pPathData, | |
590 const CFX_Matrix* pObject2Device, | |
591 int fill_mode); | |
592 void SetClip_PathStroke(const CFX_PathData* pPathData, | |
593 const CFX_Matrix* pObject2Device, | |
594 const CFX_GraphStateData* pGraphState); | |
595 FX_RECT GetClipBox() { return m_ClipBox; } | |
596 FX_BOOL DrawPath(const CFX_PathData* pPathData, | |
597 const CFX_Matrix* pObject2Device, | |
598 const CFX_GraphStateData* pGraphState, | |
599 uint32_t fill_color, | |
600 uint32_t stroke_color, | |
601 int fill_mode, | |
602 int alpha_flag = 0, | |
603 void* pIccTransform = NULL); | |
604 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | |
605 uint32_t color, | |
606 int dest_left, | |
607 int dest_top, | |
608 int alpha_flag = 0, | |
609 void* pIccTransform = NULL); | |
610 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | |
611 uint32_t color, | |
612 int dest_left, | |
613 int dest_top, | |
614 int dest_width, | |
615 int dest_height, | |
616 uint32_t flags, | |
617 int alpha_flag = 0, | |
618 void* pIccTransform = NULL); | |
619 FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, | |
620 uint32_t color, | |
621 const CFX_Matrix* pMatrix, | |
622 uint32_t flags, | |
623 int alpha_flag = 0, | |
624 void* pIccTransform = NULL); | |
625 FX_BOOL DrawText(int nChars, | |
626 const FXTEXT_CHARPOS* pCharPos, | |
627 CFX_Font* pFont, | |
628 CFX_FontCache* pCache, | |
629 const CFX_Matrix* pObject2Device, | |
630 FX_FLOAT font_size, | |
631 uint32_t color, | |
632 int alpha_flag = 0, | |
633 void* pIccTransform = NULL); | |
634 | |
635 private: | |
636 void OutputPath(const CFX_PathData* pPathData, | |
637 const CFX_Matrix* pObject2Device); | |
638 void SetGraphState(const CFX_GraphStateData* pGraphState); | |
639 void SetColor(uint32_t color, int alpha_flag, void* pIccTransform); | |
640 void FindPSFontGlyph(CFX_FaceCache* pFaceCache, | |
641 CFX_Font* pFont, | |
642 const FXTEXT_CHARPOS& charpos, | |
643 int& ps_fontnum, | |
644 int& ps_glyphindex); | |
645 void WritePSBinary(const uint8_t* data, int len); | |
646 | |
647 IFX_PSOutput* m_pOutput; | |
648 int m_PSLevel; | |
649 CFX_GraphStateData m_CurGraphState; | |
650 FX_BOOL m_bGraphStateSet; | |
651 FX_BOOL m_bCmykOutput; | |
652 FX_BOOL m_bColorSet; | |
653 uint32_t m_LastColor; | |
654 FX_RECT m_ClipBox; | |
655 CFX_ArrayTemplate<CPSFont*> m_PSFontList; | |
656 CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack; | |
657 FX_BOOL m_bInited; | |
658 }; | |
659 | |
660 #endif // CORE_FXGE_INCLUDE_FX_GE_H_ | 564 #endif // CORE_FXGE_INCLUDE_FX_GE_H_ |
OLD | NEW |