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 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 switch (GetFormat()) { | 1026 switch (GetFormat()) { |
1027 case FXDIB_1bppMask: { | 1027 case FXDIB_1bppMask: { |
1028 if ((*pos) & (1 << (7 - x % 8))) { | 1028 if ((*pos) & (1 << (7 - x % 8))) { |
1029 return 0xff000000; | 1029 return 0xff000000; |
1030 } | 1030 } |
1031 return 0; | 1031 return 0; |
1032 } | 1032 } |
1033 case FXDIB_1bppRgb: { | 1033 case FXDIB_1bppRgb: { |
1034 if ((*pos) & (1 << (7 - x % 8))) { | 1034 if ((*pos) & (1 << (7 - x % 8))) { |
1035 return m_pPalette ? m_pPalette[1] : 0xffffffff; | 1035 return m_pPalette ? m_pPalette[1] : 0xffffffff; |
1036 } else { | |
1037 return m_pPalette ? m_pPalette[0] : 0xff000000; | |
1038 } | 1036 } |
1039 break; | 1037 return m_pPalette ? m_pPalette[0] : 0xff000000; |
1040 } | 1038 } |
1041 case FXDIB_8bppMask: | 1039 case FXDIB_8bppMask: |
1042 return (*pos) << 24; | 1040 return (*pos) << 24; |
1043 case FXDIB_8bppRgb: | 1041 case FXDIB_8bppRgb: |
1044 return m_pPalette ? m_pPalette[*pos] : (0xff000000 | ((*pos) * 0x101
01)); | 1042 return m_pPalette ? m_pPalette[*pos] : (0xff000000 | ((*pos) * 0x101
01)); |
1045 case FXDIB_Rgb: | 1043 case FXDIB_Rgb: |
1046 case FXDIB_Rgba: | 1044 case FXDIB_Rgba: |
1047 case FXDIB_Rgb32: | 1045 case FXDIB_Rgb32: |
1048 return FXARGB_GETDIB(pos) | 0xff000000; | 1046 return FXARGB_GETDIB(pos) | 0xff000000; |
1049 case FXDIB_Argb: | 1047 case FXDIB_Argb: |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, | 1579 m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, |
1582 m_ClipBox, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_fl
ag, pIccTransform, m_BlendType); | 1580 m_ClipBox, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_fl
ag, pIccTransform, m_BlendType); |
1583 m_Status = 1; | 1581 m_Status = 1; |
1584 ret = m_Stretcher.Start(&m_Composer, pSource, dest_width, dest_height, bitma
p_clip, dib_flags); | 1582 ret = m_Stretcher.Start(&m_Composer, pSource, dest_width, dest_height, bitma
p_clip, dib_flags); |
1585 return ret; | 1583 return ret; |
1586 } | 1584 } |
1587 FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause) | 1585 FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause) |
1588 { | 1586 { |
1589 if (m_Status == 1) { | 1587 if (m_Status == 1) { |
1590 return m_Stretcher.Continue(pPause); | 1588 return m_Stretcher.Continue(pPause); |
1591 } else if (m_Status == 2) { | 1589 } |
| 1590 if (m_Status == 2) { |
1592 if (m_pTransformer->Continue(pPause)) { | 1591 if (m_pTransformer->Continue(pPause)) { |
1593 return TRUE; | 1592 return TRUE; |
1594 } | 1593 } |
1595 CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach(); | 1594 CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach(); |
1596 if (pBitmap == NULL) { | 1595 if (pBitmap == NULL) { |
1597 return FALSE; | 1596 return FALSE; |
1598 } | 1597 } |
1599 if (pBitmap->GetBuffer() == NULL) { | 1598 if (pBitmap->GetBuffer() == NULL) { |
1600 delete pBitmap; | 1599 delete pBitmap; |
1601 return FALSE; | 1600 return FALSE; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 if (!m_pBitmap->Create(width, height, src_format)) { | 1659 if (!m_pBitmap->Create(width, height, src_format)) { |
1661 delete m_pBitmap; | 1660 delete m_pBitmap; |
1662 m_pBitmap = NULL; | 1661 m_pBitmap = NULL; |
1663 return FALSE; | 1662 return FALSE; |
1664 } | 1663 } |
1665 if (pSrcPalette) { | 1664 if (pSrcPalette) { |
1666 m_pBitmap->CopyPalette(pSrcPalette); | 1665 m_pBitmap->CopyPalette(pSrcPalette); |
1667 } | 1666 } |
1668 return TRUE; | 1667 return TRUE; |
1669 } | 1668 } |
OLD | NEW |