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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 | 416 |
417 protected: | 417 protected: |
418 bool m_bOwnedBitmap; | 418 bool m_bOwnedBitmap; |
419 }; | 419 }; |
420 | 420 |
421 class IFX_RenderDeviceDriver { | 421 class IFX_RenderDeviceDriver { |
422 public: | 422 public: |
423 static IFX_RenderDeviceDriver* CreateFxgeDriver( | 423 static IFX_RenderDeviceDriver* CreateFxgeDriver( |
424 CFX_DIBitmap* pBitmap, | 424 CFX_DIBitmap* pBitmap, |
425 FX_BOOL bRgbByteOrder = FALSE, | 425 FX_BOOL bRgbByteOrder = FALSE, |
426 CFX_DIBitmap* pOriDevice = NULL, | 426 CFX_DIBitmap* pOriDevice = nullptr, |
427 FX_BOOL bGroupKnockout = FALSE); | 427 FX_BOOL bGroupKnockout = FALSE); |
428 | 428 |
429 virtual ~IFX_RenderDeviceDriver() {} | 429 virtual ~IFX_RenderDeviceDriver() {} |
430 | 430 |
431 virtual int GetDeviceCaps(int caps_id) = 0; | 431 virtual int GetDeviceCaps(int caps_id) = 0; |
432 | 432 |
433 virtual CFX_Matrix GetCTM() const { return CFX_Matrix(); } | 433 virtual CFX_Matrix GetCTM() const { return CFX_Matrix(); } |
434 | 434 |
435 virtual FX_BOOL IsPSPrintDriver() { return FALSE; } | 435 virtual FX_BOOL IsPSPrintDriver() { return FALSE; } |
436 | 436 |
(...skipping 15 matching lines...) Expand all Loading... |
452 return FALSE; | 452 return FALSE; |
453 } | 453 } |
454 | 454 |
455 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, | 455 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, |
456 const CFX_Matrix* pObject2Device, | 456 const CFX_Matrix* pObject2Device, |
457 const CFX_GraphStateData* pGraphState, | 457 const CFX_GraphStateData* pGraphState, |
458 uint32_t fill_color, | 458 uint32_t fill_color, |
459 uint32_t stroke_color, | 459 uint32_t stroke_color, |
460 int fill_mode, | 460 int fill_mode, |
461 int alpha_flag = 0, | 461 int alpha_flag = 0, |
462 void* pIccTransform = NULL, | 462 void* pIccTransform = nullptr, |
463 int blend_type = FXDIB_BLEND_NORMAL) = 0; | 463 int blend_type = FXDIB_BLEND_NORMAL) = 0; |
464 | 464 |
465 virtual FX_BOOL SetPixel(int x, | 465 virtual FX_BOOL SetPixel(int x, |
466 int y, | 466 int y, |
467 uint32_t color, | 467 uint32_t color, |
468 int alpha_flag = 0, | 468 int alpha_flag = 0, |
469 void* pIccTransform = NULL) { | 469 void* pIccTransform = nullptr) { |
470 return FALSE; | 470 return FALSE; |
471 } | 471 } |
472 | 472 |
473 virtual FX_BOOL FillRect(const FX_RECT* pRect, | 473 virtual FX_BOOL FillRect(const FX_RECT* pRect, |
474 uint32_t fill_color, | 474 uint32_t fill_color, |
475 int alpha_flag = 0, | 475 int alpha_flag = 0, |
476 void* pIccTransform = NULL, | 476 void* pIccTransform = nullptr, |
477 int blend_type = FXDIB_BLEND_NORMAL) { | 477 int blend_type = FXDIB_BLEND_NORMAL) { |
478 return FALSE; | 478 return FALSE; |
479 } | 479 } |
480 | 480 |
481 virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, | 481 virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
482 FX_FLOAT y1, | 482 FX_FLOAT y1, |
483 FX_FLOAT x2, | 483 FX_FLOAT x2, |
484 FX_FLOAT y2, | 484 FX_FLOAT y2, |
485 uint32_t color, | 485 uint32_t color, |
486 int alpha_flag = 0, | 486 int alpha_flag = 0, |
487 void* pIccTransform = NULL, | 487 void* pIccTransform = nullptr, |
488 int blend_type = FXDIB_BLEND_NORMAL) { | 488 int blend_type = FXDIB_BLEND_NORMAL) { |
489 return FALSE; | 489 return FALSE; |
490 } | 490 } |
491 | 491 |
492 virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; | 492 virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; |
493 | 493 |
494 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, | 494 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, |
495 int left, | 495 int left, |
496 int top, | 496 int top, |
497 void* pIccTransform = NULL, | 497 void* pIccTransform = nullptr, |
498 FX_BOOL bDEdge = FALSE) { | 498 FX_BOOL bDEdge = FALSE) { |
499 return FALSE; | 499 return FALSE; |
500 } | 500 } |
501 virtual CFX_DIBitmap* GetBackDrop() { return NULL; } | 501 virtual CFX_DIBitmap* GetBackDrop() { return nullptr; } |
502 | 502 |
503 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 503 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
504 uint32_t color, | 504 uint32_t color, |
505 const FX_RECT* pSrcRect, | 505 const FX_RECT* pSrcRect, |
506 int dest_left, | 506 int dest_left, |
507 int dest_top, | 507 int dest_top, |
508 int blend_type, | 508 int blend_type, |
509 int alpha_flag = 0, | 509 int alpha_flag = 0, |
510 void* pIccTransform = NULL) = 0; | 510 void* pIccTransform = nullptr) = 0; |
511 | 511 |
512 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 512 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
513 uint32_t color, | 513 uint32_t color, |
514 int dest_left, | 514 int dest_left, |
515 int dest_top, | 515 int dest_top, |
516 int dest_width, | 516 int dest_width, |
517 int dest_height, | 517 int dest_height, |
518 const FX_RECT* pClipRect, | 518 const FX_RECT* pClipRect, |
519 uint32_t flags, | 519 uint32_t flags, |
520 int alpha_flag = 0, | 520 int alpha_flag = 0, |
521 void* pIccTransform = NULL, | 521 void* pIccTransform = nullptr, |
522 int blend_type = FXDIB_BLEND_NORMAL) = 0; | 522 int blend_type = FXDIB_BLEND_NORMAL) = 0; |
523 | 523 |
524 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 524 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
525 int bitmap_alpha, | 525 int bitmap_alpha, |
526 uint32_t color, | 526 uint32_t color, |
527 const CFX_Matrix* pMatrix, | 527 const CFX_Matrix* pMatrix, |
528 uint32_t flags, | 528 uint32_t flags, |
529 void*& handle, | 529 void*& handle, |
530 int alpha_flag = 0, | 530 int alpha_flag = 0, |
531 void* pIccTransform = NULL, | 531 void* pIccTransform = nullptr, |
532 int blend_type = FXDIB_BLEND_NORMAL) = 0; | 532 int blend_type = FXDIB_BLEND_NORMAL) = 0; |
533 | 533 |
534 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) { | 534 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) { |
535 return FALSE; | 535 return FALSE; |
536 } | 536 } |
537 | 537 |
538 virtual void CancelDIBits(void* handle) {} | 538 virtual void CancelDIBits(void* handle) {} |
539 | 539 |
540 virtual FX_BOOL DrawDeviceText(int nChars, | 540 virtual FX_BOOL DrawDeviceText(int nChars, |
541 const FXTEXT_CHARPOS* pCharPos, | 541 const FXTEXT_CHARPOS* pCharPos, |
542 CFX_Font* pFont, | 542 CFX_Font* pFont, |
543 CFX_FontCache* pCache, | 543 CFX_FontCache* pCache, |
544 const CFX_Matrix* pObject2Device, | 544 const CFX_Matrix* pObject2Device, |
545 FX_FLOAT font_size, | 545 FX_FLOAT font_size, |
546 uint32_t color, | 546 uint32_t color, |
547 int alpha_flag = 0, | 547 int alpha_flag = 0, |
548 void* pIccTransform = NULL) { | 548 void* pIccTransform = nullptr) { |
549 return FALSE; | 549 return FALSE; |
550 } | 550 } |
551 | 551 |
552 virtual void* GetPlatformSurface() const { return NULL; } | 552 virtual void* GetPlatformSurface() const { return nullptr; } |
553 virtual int GetDriverType() const { return 0; } | 553 virtual int GetDriverType() const { return 0; } |
554 virtual void ClearDriver() {} | 554 virtual void ClearDriver() {} |
555 | 555 |
556 virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, | 556 virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, |
557 const CFX_Matrix* pMatrix, | 557 const CFX_Matrix* pMatrix, |
558 const FX_RECT& clip_rect, | 558 const FX_RECT& clip_rect, |
559 int alpha, | 559 int alpha, |
560 FX_BOOL bAlphaMode) { | 560 FX_BOOL bAlphaMode) { |
561 return false; | 561 return false; |
562 } | 562 } |
(...skipping 29 matching lines...) Expand all Loading... |
592 const CFX_Matrix* pObject2Device, | 592 const CFX_Matrix* pObject2Device, |
593 const CFX_GraphStateData* pGraphState); | 593 const CFX_GraphStateData* pGraphState); |
594 FX_RECT GetClipBox() { return m_ClipBox; } | 594 FX_RECT GetClipBox() { return m_ClipBox; } |
595 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 595 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
596 const CFX_Matrix* pObject2Device, | 596 const CFX_Matrix* pObject2Device, |
597 const CFX_GraphStateData* pGraphState, | 597 const CFX_GraphStateData* pGraphState, |
598 uint32_t fill_color, | 598 uint32_t fill_color, |
599 uint32_t stroke_color, | 599 uint32_t stroke_color, |
600 int fill_mode, | 600 int fill_mode, |
601 int alpha_flag = 0, | 601 int alpha_flag = 0, |
602 void* pIccTransform = NULL); | 602 void* pIccTransform = nullptr); |
603 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 603 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
604 uint32_t color, | 604 uint32_t color, |
605 int dest_left, | 605 int dest_left, |
606 int dest_top, | 606 int dest_top, |
607 int alpha_flag = 0, | 607 int alpha_flag = 0, |
608 void* pIccTransform = NULL); | 608 void* pIccTransform = nullptr); |
609 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 609 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
610 uint32_t color, | 610 uint32_t color, |
611 int dest_left, | 611 int dest_left, |
612 int dest_top, | 612 int dest_top, |
613 int dest_width, | 613 int dest_width, |
614 int dest_height, | 614 int dest_height, |
615 uint32_t flags, | 615 uint32_t flags, |
616 int alpha_flag = 0, | 616 int alpha_flag = 0, |
617 void* pIccTransform = NULL); | 617 void* pIccTransform = nullptr); |
618 FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, | 618 FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, |
619 uint32_t color, | 619 uint32_t color, |
620 const CFX_Matrix* pMatrix, | 620 const CFX_Matrix* pMatrix, |
621 uint32_t flags, | 621 uint32_t flags, |
622 int alpha_flag = 0, | 622 int alpha_flag = 0, |
623 void* pIccTransform = NULL); | 623 void* pIccTransform = nullptr); |
624 FX_BOOL DrawText(int nChars, | 624 FX_BOOL DrawText(int nChars, |
625 const FXTEXT_CHARPOS* pCharPos, | 625 const FXTEXT_CHARPOS* pCharPos, |
626 CFX_Font* pFont, | 626 CFX_Font* pFont, |
627 CFX_FontCache* pCache, | 627 CFX_FontCache* pCache, |
628 const CFX_Matrix* pObject2Device, | 628 const CFX_Matrix* pObject2Device, |
629 FX_FLOAT font_size, | 629 FX_FLOAT font_size, |
630 uint32_t color, | 630 uint32_t color, |
631 int alpha_flag = 0, | 631 int alpha_flag = 0, |
632 void* pIccTransform = NULL); | 632 void* pIccTransform = nullptr); |
633 | 633 |
634 private: | 634 private: |
635 void OutputPath(const CFX_PathData* pPathData, | 635 void OutputPath(const CFX_PathData* pPathData, |
636 const CFX_Matrix* pObject2Device); | 636 const CFX_Matrix* pObject2Device); |
637 void SetGraphState(const CFX_GraphStateData* pGraphState); | 637 void SetGraphState(const CFX_GraphStateData* pGraphState); |
638 void SetColor(uint32_t color, int alpha_flag, void* pIccTransform); | 638 void SetColor(uint32_t color, int alpha_flag, void* pIccTransform); |
639 void FindPSFontGlyph(CFX_FaceCache* pFaceCache, | 639 void FindPSFontGlyph(CFX_FaceCache* pFaceCache, |
640 CFX_Font* pFont, | 640 CFX_Font* pFont, |
641 const FXTEXT_CHARPOS& charpos, | 641 const FXTEXT_CHARPOS& charpos, |
642 int& ps_fontnum, | 642 int& ps_fontnum, |
643 int& ps_glyphindex); | 643 int& ps_glyphindex); |
644 void WritePSBinary(const uint8_t* data, int len); | 644 void WritePSBinary(const uint8_t* data, int len); |
645 | 645 |
646 IFX_PSOutput* m_pOutput; | 646 IFX_PSOutput* m_pOutput; |
647 int m_PSLevel; | 647 int m_PSLevel; |
648 CFX_GraphStateData m_CurGraphState; | 648 CFX_GraphStateData m_CurGraphState; |
649 FX_BOOL m_bGraphStateSet; | 649 FX_BOOL m_bGraphStateSet; |
650 FX_BOOL m_bCmykOutput; | 650 FX_BOOL m_bCmykOutput; |
651 FX_BOOL m_bColorSet; | 651 FX_BOOL m_bColorSet; |
652 uint32_t m_LastColor; | 652 uint32_t m_LastColor; |
653 FX_RECT m_ClipBox; | 653 FX_RECT m_ClipBox; |
654 CFX_ArrayTemplate<CPSFont*> m_PSFontList; | 654 CFX_ArrayTemplate<CPSFont*> m_PSFontList; |
655 CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack; | 655 CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack; |
656 FX_BOOL m_bInited; | 656 FX_BOOL m_bInited; |
657 }; | 657 }; |
658 | 658 |
659 #endif // CORE_FXGE_INCLUDE_FX_GE_H_ | 659 #endif // CORE_FXGE_INCLUDE_FX_GE_H_ |
OLD | NEW |