| 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 "core/fxcodec/include/fx_codec.h" | 7 #include "core/fxcodec/include/fx_codec.h" |
| 8 #include "core/fxge/dib/dib_int.h" | 8 #include "core/fxge/dib/dib_int.h" |
| 9 #include "core/fxge/include/fx_ge.h" | 9 #include "core/fxge/include/fx_ge.h" |
| 10 | 10 |
| (...skipping 4675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4686 return TRUE; | 4686 return TRUE; |
| 4687 } | 4687 } |
| 4688 if (m_bpp == 1) { | 4688 if (m_bpp == 1) { |
| 4689 ASSERT(!IsCmykImage() && (uint8_t)(alpha_flag >> 8) == 0); | 4689 ASSERT(!IsCmykImage() && (uint8_t)(alpha_flag >> 8) == 0); |
| 4690 int left_shift = rect.left % 8; | 4690 int left_shift = rect.left % 8; |
| 4691 int right_shift = rect.right % 8; | 4691 int right_shift = rect.right % 8; |
| 4692 int new_width = rect.right / 8 - rect.left / 8; | 4692 int new_width = rect.right / 8 - rect.left / 8; |
| 4693 int index = 0; | 4693 int index = 0; |
| 4694 if (m_pPalette) { | 4694 if (m_pPalette) { |
| 4695 for (int i = 0; i < 2; i++) { | 4695 for (int i = 0; i < 2; i++) { |
| 4696 if (m_pPalette[i] == color) { | 4696 if (m_pPalette.get()[i] == color) { |
| 4697 index = i; | 4697 index = i; |
| 4698 } | 4698 } |
| 4699 } | 4699 } |
| 4700 } else { | 4700 } else { |
| 4701 index = ((uint8_t)color == 0xff) ? 1 : 0; | 4701 index = ((uint8_t)color == 0xff) ? 1 : 0; |
| 4702 } | 4702 } |
| 4703 for (int row = rect.top; row < rect.bottom; row++) { | 4703 for (int row = rect.top; row < rect.bottom; row++) { |
| 4704 uint8_t* dest_scan_top = (uint8_t*)GetScanline(row) + rect.left / 8; | 4704 uint8_t* dest_scan_top = (uint8_t*)GetScanline(row) + rect.left / 8; |
| 4705 uint8_t* dest_scan_top_r = (uint8_t*)GetScanline(row) + rect.right / 8; | 4705 uint8_t* dest_scan_top_r = (uint8_t*)GetScanline(row) + rect.right / 8; |
| 4706 uint8_t left_flag = *dest_scan_top & (255 << (8 - left_shift)); | 4706 uint8_t left_flag = *dest_scan_top & (255 << (8 - left_shift)); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5029 } | 5029 } |
| 5030 src_alpha_scan = m_pScanlineAlphaV; | 5030 src_alpha_scan = m_pScanlineAlphaV; |
| 5031 dest_alpha_scan = dest_alpha_buf; | 5031 dest_alpha_scan = dest_alpha_buf; |
| 5032 if (dest_alpha_scan) { | 5032 if (dest_alpha_scan) { |
| 5033 for (i = 0; i < m_DestHeight; i++) { | 5033 for (i = 0; i < m_DestHeight; i++) { |
| 5034 *dest_alpha_scan = *src_alpha_scan++; | 5034 *dest_alpha_scan = *src_alpha_scan++; |
| 5035 dest_alpha_scan += y_alpha_step; | 5035 dest_alpha_scan += y_alpha_step; |
| 5036 } | 5036 } |
| 5037 } | 5037 } |
| 5038 } | 5038 } |
| OLD | NEW |