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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 SkPictureRecorder* CreateRecorder(int size_x, int size_y); | 414 SkPictureRecorder* CreateRecorder(int size_x, int size_y); |
415 void PreMultiply(); | 415 void PreMultiply(); |
416 #endif | 416 #endif |
417 | 417 |
418 protected: | 418 protected: |
419 bool m_bOwnedBitmap; | 419 bool m_bOwnedBitmap; |
420 }; | 420 }; |
421 | 421 |
422 class IFX_RenderDeviceDriver { | 422 class IFX_RenderDeviceDriver { |
423 public: | 423 public: |
424 static IFX_RenderDeviceDriver* CreateFxgeDriver( | 424 static IFX_RenderDeviceDriver* CreateFxgeDriver(CFX_DIBitmap* pBitmap, |
425 CFX_DIBitmap* pBitmap, | 425 FX_BOOL bRgbByteOrder, |
426 FX_BOOL bRgbByteOrder = FALSE, | 426 CFX_DIBitmap* pOriDevice, |
427 CFX_DIBitmap* pOriDevice = nullptr, | 427 FX_BOOL bGroupKnockout); |
428 FX_BOOL bGroupKnockout = FALSE); | |
429 | 428 |
430 virtual ~IFX_RenderDeviceDriver() {} | 429 virtual ~IFX_RenderDeviceDriver() {} |
431 | 430 |
432 virtual int GetDeviceCaps(int caps_id) = 0; | 431 virtual int GetDeviceCaps(int caps_id) = 0; |
433 | 432 |
434 virtual CFX_Matrix GetCTM() const { return CFX_Matrix(); } | 433 virtual CFX_Matrix GetCTM() const { return CFX_Matrix(); } |
435 | 434 |
436 virtual FX_BOOL StartRendering() { return TRUE; } | 435 virtual FX_BOOL StartRendering() { return TRUE; } |
437 | 436 |
438 virtual void EndRendering() {} | 437 virtual void EndRendering() {} |
(...skipping 11 matching lines...) Expand all Loading... |
450 const CFX_GraphStateData* pGraphState) { | 449 const CFX_GraphStateData* pGraphState) { |
451 return FALSE; | 450 return FALSE; |
452 } | 451 } |
453 | 452 |
454 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, | 453 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, |
455 const CFX_Matrix* pObject2Device, | 454 const CFX_Matrix* pObject2Device, |
456 const CFX_GraphStateData* pGraphState, | 455 const CFX_GraphStateData* pGraphState, |
457 uint32_t fill_color, | 456 uint32_t fill_color, |
458 uint32_t stroke_color, | 457 uint32_t stroke_color, |
459 int fill_mode, | 458 int fill_mode, |
460 int alpha_flag = 0, | 459 int blend_type) = 0; |
461 void* pIccTransform = nullptr, | |
462 int blend_type = FXDIB_BLEND_NORMAL) = 0; | |
463 | 460 |
464 virtual FX_BOOL SetPixel(int x, | 461 virtual FX_BOOL SetPixel(int x, int y, uint32_t color) { return FALSE; } |
465 int y, | 462 |
466 uint32_t color, | 463 virtual FX_BOOL FillRectWithBlend(const FX_RECT* pRect, |
467 int alpha_flag = 0, | 464 uint32_t fill_color, |
468 void* pIccTransform = nullptr) { | 465 int blend_type) { |
469 return FALSE; | 466 return FALSE; |
470 } | 467 } |
471 | 468 |
472 virtual FX_BOOL FillRect(const FX_RECT* pRect, | |
473 uint32_t fill_color, | |
474 int alpha_flag = 0, | |
475 void* pIccTransform = nullptr, | |
476 int blend_type = FXDIB_BLEND_NORMAL) { | |
477 return FALSE; | |
478 } | |
479 | |
480 virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, | 469 virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
481 FX_FLOAT y1, | 470 FX_FLOAT y1, |
482 FX_FLOAT x2, | 471 FX_FLOAT x2, |
483 FX_FLOAT y2, | 472 FX_FLOAT y2, |
484 uint32_t color, | 473 uint32_t color, |
485 int alpha_flag = 0, | 474 int blend_type) { |
486 void* pIccTransform = nullptr, | |
487 int blend_type = FXDIB_BLEND_NORMAL) { | |
488 return FALSE; | 475 return FALSE; |
489 } | 476 } |
490 | 477 |
491 virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; | 478 virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; |
492 | 479 |
493 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, | 480 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top) { |
494 int left, | |
495 int top, | |
496 void* pIccTransform = nullptr, | |
497 FX_BOOL bDEdge = FALSE) { | |
498 return FALSE; | 481 return FALSE; |
499 } | 482 } |
500 virtual CFX_DIBitmap* GetBackDrop() { return nullptr; } | 483 virtual CFX_DIBitmap* GetBackDrop() { return nullptr; } |
501 | 484 |
502 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 485 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
503 uint32_t color, | 486 uint32_t color, |
504 const FX_RECT* pSrcRect, | 487 const FX_RECT* pSrcRect, |
505 int dest_left, | 488 int dest_left, |
506 int dest_top, | 489 int dest_top, |
507 int blend_type, | 490 int blend_type) = 0; |
508 int alpha_flag = 0, | |
509 void* pIccTransform = nullptr) = 0; | |
510 | 491 |
511 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 492 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
512 uint32_t color, | 493 uint32_t color, |
513 int dest_left, | 494 int dest_left, |
514 int dest_top, | 495 int dest_top, |
515 int dest_width, | 496 int dest_width, |
516 int dest_height, | 497 int dest_height, |
517 const FX_RECT* pClipRect, | 498 const FX_RECT* pClipRect, |
518 uint32_t flags, | 499 uint32_t flags, |
519 int alpha_flag = 0, | 500 int blend_type) = 0; |
520 void* pIccTransform = nullptr, | |
521 int blend_type = FXDIB_BLEND_NORMAL) = 0; | |
522 | 501 |
523 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 502 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
524 int bitmap_alpha, | 503 int bitmap_alpha, |
525 uint32_t color, | 504 uint32_t color, |
526 const CFX_Matrix* pMatrix, | 505 const CFX_Matrix* pMatrix, |
527 uint32_t flags, | 506 uint32_t flags, |
528 void*& handle, | 507 void*& handle, |
529 int alpha_flag = 0, | 508 int blend_type) = 0; |
530 void* pIccTransform = nullptr, | |
531 int blend_type = FXDIB_BLEND_NORMAL) = 0; | |
532 | 509 |
533 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) { | 510 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) { |
534 return FALSE; | 511 return FALSE; |
535 } | 512 } |
536 | 513 |
537 virtual void CancelDIBits(void* handle) {} | 514 virtual void CancelDIBits(void* handle) {} |
538 | 515 |
539 virtual FX_BOOL DrawDeviceText(int nChars, | 516 virtual FX_BOOL DrawDeviceText(int nChars, |
540 const FXTEXT_CHARPOS* pCharPos, | 517 const FXTEXT_CHARPOS* pCharPos, |
541 CFX_Font* pFont, | 518 CFX_Font* pFont, |
542 CFX_FontCache* pCache, | 519 CFX_FontCache* pCache, |
543 const CFX_Matrix* pObject2Device, | 520 const CFX_Matrix* pObject2Device, |
544 FX_FLOAT font_size, | 521 FX_FLOAT font_size, |
545 uint32_t color, | 522 uint32_t color) { |
546 int alpha_flag = 0, | |
547 void* pIccTransform = nullptr) { | |
548 return FALSE; | 523 return FALSE; |
549 } | 524 } |
550 | 525 |
551 virtual void* GetPlatformSurface() const { return nullptr; } | 526 virtual void* GetPlatformSurface() const { return nullptr; } |
552 virtual int GetDriverType() const { return 0; } | 527 virtual int GetDriverType() const { return 0; } |
553 virtual void ClearDriver() {} | 528 virtual void ClearDriver() {} |
554 | 529 |
555 virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, | 530 virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, |
556 const CFX_Matrix* pMatrix, | 531 const CFX_Matrix* pMatrix, |
557 const FX_RECT& clip_rect, | 532 const FX_RECT& clip_rect, |
558 int alpha, | 533 int alpha, |
559 FX_BOOL bAlphaMode) { | 534 FX_BOOL bAlphaMode) { |
560 return false; | 535 return false; |
561 } | 536 } |
562 }; | 537 }; |
563 | 538 |
564 #endif // CORE_FXGE_INCLUDE_FX_GE_H_ | 539 #endif // CORE_FXGE_INCLUDE_FX_GE_H_ |
OLD | NEW |