| 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 #include "../../../include/fxge/fx_dib.h" | 7 #include "../../../include/fxge/fx_dib.h" |
| 8 #include "../../../include/fxge/fx_ge.h" | 8 #include "../../../include/fxge/fx_ge.h" |
| 9 #include "../../../include/fxcodec/fx_codec.h" | 9 #include "../../../include/fxcodec/fx_codec.h" |
| 10 #include "dib_int.h" | 10 #include "dib_int.h" |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 } | 440 } |
| 441 ASSERT(HasAlpha() && (m_bpp >= 24)); | 441 ASSERT(HasAlpha() && (m_bpp >= 24)); |
| 442 ASSERT(pMask->IsAlphaMask()); | 442 ASSERT(pMask->IsAlphaMask()); |
| 443 if (!HasAlpha() || !pMask->IsAlphaMask() || m_bpp < 24) { | 443 if (!HasAlpha() || !pMask->IsAlphaMask() || m_bpp < 24) { |
| 444 return FALSE; | 444 return FALSE; |
| 445 } | 445 } |
| 446 GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask-
>GetHeight(), src_left, src_top, NULL); | 446 GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask-
>GetHeight(), src_left, src_top, NULL); |
| 447 if (width == 0 || height == 0) { | 447 if (width == 0 || height == 0) { |
| 448 return TRUE; | 448 return TRUE; |
| 449 } | 449 } |
| 450 int src_pitch = pMask->GetPitch(); | |
| 451 int src_bpp = pMask->GetBPP(); | 450 int src_bpp = pMask->GetBPP(); |
| 452 int alpha; | 451 int alpha; |
| 453 FX_DWORD dst_color; | 452 FX_DWORD dst_color; |
| 454 if (alpha_flag >> 8) { | 453 if (alpha_flag >> 8) { |
| 455 alpha = alpha_flag & 0xff; | 454 alpha = alpha_flag & 0xff; |
| 456 dst_color = FXCMYK_TODIB(color); | 455 dst_color = FXCMYK_TODIB(color); |
| 457 } else { | 456 } else { |
| 458 alpha = FXARGB_A(color); | 457 alpha = FXARGB_A(color); |
| 459 dst_color = FXARGB_TODIB(color); | 458 dst_color = FXARGB_TODIB(color); |
| 460 } | 459 } |
| (...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1725 if (!m_pBitmap->Create(width, height, src_format)) { | 1724 if (!m_pBitmap->Create(width, height, src_format)) { |
| 1726 delete m_pBitmap; | 1725 delete m_pBitmap; |
| 1727 m_pBitmap = NULL; | 1726 m_pBitmap = NULL; |
| 1728 return FALSE; | 1727 return FALSE; |
| 1729 } | 1728 } |
| 1730 if (pSrcPalette) { | 1729 if (pSrcPalette) { |
| 1731 m_pBitmap->CopyPalette(pSrcPalette); | 1730 m_pBitmap->CopyPalette(pSrcPalette); |
| 1732 } | 1731 } |
| 1733 return TRUE; | 1732 return TRUE; |
| 1734 } | 1733 } |
| OLD | NEW |