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_INCLUDE_FXGE_FX_GE_H_ | 7 #ifndef CORE_INCLUDE_FXGE_FX_GE_H_ |
8 #define CORE_INCLUDE_FXGE_FX_GE_H_ | 8 #define CORE_INCLUDE_FXGE_FX_GE_H_ |
9 | 9 |
10 #include "fx_dib.h" | 10 #include "fx_dib.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 FX_PATHPOINT* GetPoints() const { return m_pPoints; } | 129 FX_PATHPOINT* GetPoints() const { return m_pPoints; } |
130 | 130 |
131 void SetPointCount(int nPoints); | 131 void SetPointCount(int nPoints); |
132 void AllocPointCount(int nPoints); | 132 void AllocPointCount(int nPoints); |
133 void AddPointCount(int addPoints); | 133 void AddPointCount(int addPoints); |
134 | 134 |
135 CFX_FloatRect GetBoundingBox() const; | 135 CFX_FloatRect GetBoundingBox() const; |
136 | 136 |
137 CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const; | 137 CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const; |
138 | 138 |
139 void Transform(const CFX_AffineMatrix* pMatrix); | 139 void Transform(const CFX_Matrix* pMatrix); |
140 | 140 |
141 FX_BOOL IsRect() const; | 141 FX_BOOL IsRect() const; |
142 | 142 |
143 FX_BOOL GetZeroAreaPath(CFX_PathData& NewPath, | 143 FX_BOOL GetZeroAreaPath(CFX_PathData& NewPath, |
144 CFX_AffineMatrix* pMatrix, | 144 CFX_Matrix* pMatrix, |
145 FX_BOOL& bThin, | 145 FX_BOOL& bThin, |
146 FX_BOOL bAdjust) const; | 146 FX_BOOL bAdjust) const; |
147 | 147 |
148 FX_BOOL IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* rect) const; | 148 FX_BOOL IsRect(const CFX_Matrix* pMatrix, CFX_FloatRect* rect) const; |
149 | 149 |
150 void Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix); | 150 void Append(const CFX_PathData* pSrc, const CFX_Matrix* pMatrix); |
151 void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top); | 151 void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top); |
152 | 152 |
153 void SetPoint(int index, FX_FLOAT x, FX_FLOAT y, int flag); | 153 void SetPoint(int index, FX_FLOAT x, FX_FLOAT y, int flag); |
154 | 154 |
155 void TrimPoints(int nPoints); | 155 void TrimPoints(int nPoints); |
156 | 156 |
157 void Copy(const CFX_PathData& src); | 157 void Copy(const CFX_PathData& src); |
158 | 158 |
159 protected: | 159 protected: |
160 friend class CPDF_Path; | 160 friend class CPDF_Path; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 CFX_DIBitmap* GetBitmap() const { return m_pBitmap; } | 274 CFX_DIBitmap* GetBitmap() const { return m_pBitmap; } |
275 void SetBitmap(CFX_DIBitmap* pBitmap) { m_pBitmap = pBitmap; } | 275 void SetBitmap(CFX_DIBitmap* pBitmap) { m_pBitmap = pBitmap; } |
276 | 276 |
277 FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, | 277 FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, |
278 int width, | 278 int width, |
279 int height) const; | 279 int height) const; |
280 | 280 |
281 const FX_RECT& GetClipBox() const { return m_ClipBox; } | 281 const FX_RECT& GetClipBox() const { return m_ClipBox; } |
282 | 282 |
283 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | 283 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
284 const CFX_AffineMatrix* pObject2Device, | 284 const CFX_Matrix* pObject2Device, |
285 int fill_mode); | 285 int fill_mode); |
286 | 286 |
287 FX_BOOL SetClip_Rect(const FX_RECT* pRect); | 287 FX_BOOL SetClip_Rect(const FX_RECT* pRect); |
288 | 288 |
289 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | 289 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
290 const CFX_AffineMatrix* pObject2Device, | 290 const CFX_Matrix* pObject2Device, |
291 const CFX_GraphStateData* pGraphState); | 291 const CFX_GraphStateData* pGraphState); |
292 | 292 |
293 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 293 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
294 const CFX_AffineMatrix* pObject2Device, | 294 const CFX_Matrix* pObject2Device, |
295 const CFX_GraphStateData* pGraphState, | 295 const CFX_GraphStateData* pGraphState, |
296 FX_DWORD fill_color, | 296 FX_DWORD fill_color, |
297 FX_DWORD stroke_color, | 297 FX_DWORD stroke_color, |
298 int fill_mode, | 298 int fill_mode, |
299 int alpha_flag = 0, | 299 int alpha_flag = 0, |
300 void* pIccTransform = NULL, | 300 void* pIccTransform = NULL, |
301 int blend_type = FXDIB_BLEND_NORMAL); | 301 int blend_type = FXDIB_BLEND_NORMAL); |
302 | 302 |
303 FX_BOOL SetPixel(int x, | 303 FX_BOOL SetPixel(int x, |
304 int y, | 304 int y, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 int dest_width, | 357 int dest_width, |
358 int dest_height, | 358 int dest_height, |
359 FX_DWORD color, | 359 FX_DWORD color, |
360 FX_DWORD flags = 0, | 360 FX_DWORD flags = 0, |
361 int alpha_flag = 0, | 361 int alpha_flag = 0, |
362 void* pIccTransform = NULL); | 362 void* pIccTransform = NULL); |
363 | 363 |
364 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 364 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
365 int bitmap_alpha, | 365 int bitmap_alpha, |
366 FX_DWORD color, | 366 FX_DWORD color, |
367 const CFX_AffineMatrix* pMatrix, | 367 const CFX_Matrix* pMatrix, |
368 FX_DWORD flags, | 368 FX_DWORD flags, |
369 void*& handle, | 369 void*& handle, |
370 int alpha_flag = 0, | 370 int alpha_flag = 0, |
371 void* pIccTransform = NULL, | 371 void* pIccTransform = NULL, |
372 int blend_type = FXDIB_BLEND_NORMAL); | 372 int blend_type = FXDIB_BLEND_NORMAL); |
373 | 373 |
374 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); | 374 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); |
375 | 375 |
376 void CancelDIBits(void* handle); | 376 void CancelDIBits(void* handle); |
377 | 377 |
378 FX_BOOL DrawNormalText(int nChars, | 378 FX_BOOL DrawNormalText(int nChars, |
379 const FXTEXT_CHARPOS* pCharPos, | 379 const FXTEXT_CHARPOS* pCharPos, |
380 CFX_Font* pFont, | 380 CFX_Font* pFont, |
381 CFX_FontCache* pCache, | 381 CFX_FontCache* pCache, |
382 FX_FLOAT font_size, | 382 FX_FLOAT font_size, |
383 const CFX_AffineMatrix* pText2Device, | 383 const CFX_Matrix* pText2Device, |
384 FX_DWORD fill_color, | 384 FX_DWORD fill_color, |
385 FX_DWORD text_flags, | 385 FX_DWORD text_flags, |
386 int alpha_flag = 0, | 386 int alpha_flag = 0, |
387 void* pIccTransform = NULL); | 387 void* pIccTransform = NULL); |
388 | 388 |
389 FX_BOOL DrawTextPath(int nChars, | 389 FX_BOOL DrawTextPath(int nChars, |
390 const FXTEXT_CHARPOS* pCharPos, | 390 const FXTEXT_CHARPOS* pCharPos, |
391 CFX_Font* pFont, | 391 CFX_Font* pFont, |
392 CFX_FontCache* pCache, | 392 CFX_FontCache* pCache, |
393 FX_FLOAT font_size, | 393 FX_FLOAT font_size, |
394 const CFX_AffineMatrix* pText2User, | 394 const CFX_Matrix* pText2User, |
395 const CFX_AffineMatrix* pUser2Device, | 395 const CFX_Matrix* pUser2Device, |
396 const CFX_GraphStateData* pGraphState, | 396 const CFX_GraphStateData* pGraphState, |
397 FX_DWORD fill_color, | 397 FX_DWORD fill_color, |
398 FX_DWORD stroke_color, | 398 FX_DWORD stroke_color, |
399 CFX_PathData* pClippingPath, | 399 CFX_PathData* pClippingPath, |
400 int nFlag = 0, | 400 int nFlag = 0, |
401 int alpha_flag = 0, | 401 int alpha_flag = 0, |
402 void* pIccTransform = NULL, | 402 void* pIccTransform = NULL, |
403 int blend_type = FXDIB_BLEND_NORMAL); | 403 int blend_type = FXDIB_BLEND_NORMAL); |
404 virtual void Begin() {} | 404 virtual void Begin() {} |
405 virtual void End() {} | 405 virtual void End() {} |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 488 |
489 virtual FX_BOOL StartRendering() { return TRUE; } | 489 virtual FX_BOOL StartRendering() { return TRUE; } |
490 | 490 |
491 virtual void EndRendering() {} | 491 virtual void EndRendering() {} |
492 | 492 |
493 virtual void SaveState() = 0; | 493 virtual void SaveState() = 0; |
494 | 494 |
495 virtual void RestoreState(FX_BOOL bKeepSaved = FALSE) = 0; | 495 virtual void RestoreState(FX_BOOL bKeepSaved = FALSE) = 0; |
496 | 496 |
497 virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | 497 virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
498 const CFX_AffineMatrix* pObject2Device, | 498 const CFX_Matrix* pObject2Device, |
499 int fill_mode) = 0; | 499 int fill_mode) = 0; |
500 | 500 |
501 virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | 501 virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
502 const CFX_AffineMatrix* pObject2Device, | 502 const CFX_Matrix* pObject2Device, |
503 const CFX_GraphStateData* pGraphState) { | 503 const CFX_GraphStateData* pGraphState) { |
504 return FALSE; | 504 return FALSE; |
505 } | 505 } |
506 | 506 |
507 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, | 507 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, |
508 const CFX_AffineMatrix* pObject2Device, | 508 const CFX_Matrix* pObject2Device, |
509 const CFX_GraphStateData* pGraphState, | 509 const CFX_GraphStateData* pGraphState, |
510 FX_DWORD fill_color, | 510 FX_DWORD fill_color, |
511 FX_DWORD stroke_color, | 511 FX_DWORD stroke_color, |
512 int fill_mode, | 512 int fill_mode, |
513 int alpha_flag = 0, | 513 int alpha_flag = 0, |
514 void* pIccTransform = NULL, | 514 void* pIccTransform = NULL, |
515 int blend_type = FXDIB_BLEND_NORMAL) = 0; | 515 int blend_type = FXDIB_BLEND_NORMAL) = 0; |
516 | 516 |
517 virtual FX_BOOL SetPixel(int x, | 517 virtual FX_BOOL SetPixel(int x, |
518 int y, | 518 int y, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 int dest_height, | 569 int dest_height, |
570 const FX_RECT* pClipRect, | 570 const FX_RECT* pClipRect, |
571 FX_DWORD flags, | 571 FX_DWORD flags, |
572 int alpha_flag = 0, | 572 int alpha_flag = 0, |
573 void* pIccTransform = NULL, | 573 void* pIccTransform = NULL, |
574 int blend_type = FXDIB_BLEND_NORMAL) = 0; | 574 int blend_type = FXDIB_BLEND_NORMAL) = 0; |
575 | 575 |
576 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 576 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
577 int bitmap_alpha, | 577 int bitmap_alpha, |
578 FX_DWORD color, | 578 FX_DWORD color, |
579 const CFX_AffineMatrix* pMatrix, | 579 const CFX_Matrix* pMatrix, |
580 FX_DWORD flags, | 580 FX_DWORD flags, |
581 void*& handle, | 581 void*& handle, |
582 int alpha_flag = 0, | 582 int alpha_flag = 0, |
583 void* pIccTransform = NULL, | 583 void* pIccTransform = NULL, |
584 int blend_type = FXDIB_BLEND_NORMAL) = 0; | 584 int blend_type = FXDIB_BLEND_NORMAL) = 0; |
585 | 585 |
586 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) { | 586 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) { |
587 return FALSE; | 587 return FALSE; |
588 } | 588 } |
589 | 589 |
590 virtual void CancelDIBits(void* handle) {} | 590 virtual void CancelDIBits(void* handle) {} |
591 | 591 |
592 virtual FX_BOOL DrawDeviceText(int nChars, | 592 virtual FX_BOOL DrawDeviceText(int nChars, |
593 const FXTEXT_CHARPOS* pCharPos, | 593 const FXTEXT_CHARPOS* pCharPos, |
594 CFX_Font* pFont, | 594 CFX_Font* pFont, |
595 CFX_FontCache* pCache, | 595 CFX_FontCache* pCache, |
596 const CFX_AffineMatrix* pObject2Device, | 596 const CFX_Matrix* pObject2Device, |
597 FX_FLOAT font_size, | 597 FX_FLOAT font_size, |
598 FX_DWORD color, | 598 FX_DWORD color, |
599 int alpha_flag = 0, | 599 int alpha_flag = 0, |
600 void* pIccTransform = NULL) { | 600 void* pIccTransform = NULL) { |
601 return FALSE; | 601 return FALSE; |
602 } | 602 } |
603 | 603 |
604 virtual void* GetPlatformSurface() { return NULL; } | 604 virtual void* GetPlatformSurface() { return NULL; } |
605 | 605 |
606 virtual int GetDriverType() { return 0; } | 606 virtual int GetDriverType() { return 0; } |
(...skipping 23 matching lines...) Expand all Loading... |
630 int height, | 630 int height, |
631 FX_BOOL bCmykOutput); | 631 FX_BOOL bCmykOutput); |
632 FX_BOOL StartRendering(); | 632 FX_BOOL StartRendering(); |
633 void EndRendering(); | 633 void EndRendering(); |
634 | 634 |
635 void SaveState(); | 635 void SaveState(); |
636 | 636 |
637 void RestoreState(FX_BOOL bKeepSaved = FALSE); | 637 void RestoreState(FX_BOOL bKeepSaved = FALSE); |
638 | 638 |
639 void SetClip_PathFill(const CFX_PathData* pPathData, | 639 void SetClip_PathFill(const CFX_PathData* pPathData, |
640 const CFX_AffineMatrix* pObject2Device, | 640 const CFX_Matrix* pObject2Device, |
641 int fill_mode); | 641 int fill_mode); |
642 | 642 |
643 void SetClip_PathStroke(const CFX_PathData* pPathData, | 643 void SetClip_PathStroke(const CFX_PathData* pPathData, |
644 const CFX_AffineMatrix* pObject2Device, | 644 const CFX_Matrix* pObject2Device, |
645 const CFX_GraphStateData* pGraphState); | 645 const CFX_GraphStateData* pGraphState); |
646 | 646 |
647 FX_RECT GetClipBox() { return m_ClipBox; } | 647 FX_RECT GetClipBox() { return m_ClipBox; } |
648 | 648 |
649 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 649 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
650 const CFX_AffineMatrix* pObject2Device, | 650 const CFX_Matrix* pObject2Device, |
651 const CFX_GraphStateData* pGraphState, | 651 const CFX_GraphStateData* pGraphState, |
652 FX_DWORD fill_color, | 652 FX_DWORD fill_color, |
653 FX_DWORD stroke_color, | 653 FX_DWORD stroke_color, |
654 int fill_mode, | 654 int fill_mode, |
655 int alpha_flag = 0, | 655 int alpha_flag = 0, |
656 void* pIccTransform = NULL); | 656 void* pIccTransform = NULL); |
657 | 657 |
658 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 658 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
659 FX_DWORD color, | 659 FX_DWORD color, |
660 int dest_left, | 660 int dest_left, |
661 int dest_top, | 661 int dest_top, |
662 int alpha_flag = 0, | 662 int alpha_flag = 0, |
663 void* pIccTransform = NULL); | 663 void* pIccTransform = NULL); |
664 | 664 |
665 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 665 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
666 FX_DWORD color, | 666 FX_DWORD color, |
667 int dest_left, | 667 int dest_left, |
668 int dest_top, | 668 int dest_top, |
669 int dest_width, | 669 int dest_width, |
670 int dest_height, | 670 int dest_height, |
671 FX_DWORD flags, | 671 FX_DWORD flags, |
672 int alpha_flag = 0, | 672 int alpha_flag = 0, |
673 void* pIccTransform = NULL); | 673 void* pIccTransform = NULL); |
674 | 674 |
675 FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, | 675 FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, |
676 FX_DWORD color, | 676 FX_DWORD color, |
677 const CFX_AffineMatrix* pMatrix, | 677 const CFX_Matrix* pMatrix, |
678 FX_DWORD flags, | 678 FX_DWORD flags, |
679 int alpha_flag = 0, | 679 int alpha_flag = 0, |
680 void* pIccTransform = NULL); | 680 void* pIccTransform = NULL); |
681 | 681 |
682 FX_BOOL DrawText(int nChars, | 682 FX_BOOL DrawText(int nChars, |
683 const FXTEXT_CHARPOS* pCharPos, | 683 const FXTEXT_CHARPOS* pCharPos, |
684 CFX_Font* pFont, | 684 CFX_Font* pFont, |
685 CFX_FontCache* pCache, | 685 CFX_FontCache* pCache, |
686 const CFX_AffineMatrix* pObject2Device, | 686 const CFX_Matrix* pObject2Device, |
687 FX_FLOAT font_size, | 687 FX_FLOAT font_size, |
688 FX_DWORD color, | 688 FX_DWORD color, |
689 int alpha_flag = 0, | 689 int alpha_flag = 0, |
690 void* pIccTransform = NULL); | 690 void* pIccTransform = NULL); |
691 | 691 |
692 private: | 692 private: |
693 IFX_PSOutput* m_pOutput; | 693 IFX_PSOutput* m_pOutput; |
694 | 694 |
695 int m_PSLevel; | 695 int m_PSLevel; |
696 | 696 |
697 CFX_GraphStateData m_CurGraphState; | 697 CFX_GraphStateData m_CurGraphState; |
698 | 698 |
699 FX_BOOL m_bGraphStateSet; | 699 FX_BOOL m_bGraphStateSet; |
700 | 700 |
701 FX_BOOL m_bCmykOutput; | 701 FX_BOOL m_bCmykOutput; |
702 | 702 |
703 FX_BOOL m_bColorSet; | 703 FX_BOOL m_bColorSet; |
704 | 704 |
705 FX_DWORD m_LastColor; | 705 FX_DWORD m_LastColor; |
706 | 706 |
707 FX_RECT m_ClipBox; | 707 FX_RECT m_ClipBox; |
708 | 708 |
709 CFX_ArrayTemplate<CPSFont*> m_PSFontList; | 709 CFX_ArrayTemplate<CPSFont*> m_PSFontList; |
710 | 710 |
711 CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack; | 711 CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack; |
712 FX_BOOL m_bInited; | 712 FX_BOOL m_bInited; |
713 | 713 |
714 void OutputPath(const CFX_PathData* pPathData, | 714 void OutputPath(const CFX_PathData* pPathData, |
715 const CFX_AffineMatrix* pObject2Device); | 715 const CFX_Matrix* pObject2Device); |
716 | 716 |
717 void SetGraphState(const CFX_GraphStateData* pGraphState); | 717 void SetGraphState(const CFX_GraphStateData* pGraphState); |
718 | 718 |
719 void SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform); | 719 void SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform); |
720 | 720 |
721 void FindPSFontGlyph(CFX_FaceCache* pFaceCache, | 721 void FindPSFontGlyph(CFX_FaceCache* pFaceCache, |
722 CFX_Font* pFont, | 722 CFX_Font* pFont, |
723 const FXTEXT_CHARPOS& charpos, | 723 const FXTEXT_CHARPOS& charpos, |
724 int& ps_fontnum, | 724 int& ps_fontnum, |
725 int& ps_glyphindex); | 725 int& ps_glyphindex); |
726 | 726 |
727 void WritePSBinary(const uint8_t* data, int len); | 727 void WritePSBinary(const uint8_t* data, int len); |
728 }; | 728 }; |
729 | 729 |
730 #endif // CORE_INCLUDE_FXGE_FX_GE_H_ | 730 #endif // CORE_INCLUDE_FXGE_FX_GE_H_ |
OLD | NEW |