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/src/fpdfapi/fpdf_render/render_int.h" | 7 #include "core/src/fpdfapi/fpdf_render/render_int.h" |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 break; | 240 break; |
241 case FXDIB_Rgb32: | 241 case FXDIB_Rgb32: |
242 bSkip = TRUE; | 242 bSkip = TRUE; |
243 case FXDIB_Argb: | 243 case FXDIB_Argb: |
244 for (i = 0; i < m_Width; i++) { | 244 for (i = 0; i < m_Width; i++) { |
245 *dest_buf++ = m_RampB[*(src_buf++)]; | 245 *dest_buf++ = m_RampB[*(src_buf++)]; |
246 *dest_buf++ = m_RampG[*(src_buf++)]; | 246 *dest_buf++ = m_RampG[*(src_buf++)]; |
247 *dest_buf++ = m_RampR[*(src_buf++)]; | 247 *dest_buf++ = m_RampR[*(src_buf++)]; |
248 if (!bSkip) { | 248 if (!bSkip) { |
249 *dest_buf++ = *src_buf; | 249 *dest_buf++ = *src_buf; |
| 250 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| 251 } else { |
| 252 dest_buf++; |
| 253 #endif |
250 } | 254 } |
251 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | |
252 else { | |
253 dest_buf++; | |
254 } | |
255 #endif | |
256 src_buf++; | 255 src_buf++; |
257 } | 256 } |
258 break; | 257 break; |
259 default: | 258 default: |
260 break; | 259 break; |
261 } | 260 } |
262 } | 261 } |
263 void CPDF_DIBTransferFunc::TranslateDownSamples(uint8_t* dest_buf, | 262 void CPDF_DIBTransferFunc::TranslateDownSamples(uint8_t* dest_buf, |
264 const uint8_t* src_buf, | 263 const uint8_t* src_buf, |
265 int pixels, | 264 int pixels, |
(...skipping 11 matching lines...) Expand all Loading... |
277 } else { | 276 } else { |
278 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 277 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
279 if (!m_pSrc->HasAlpha()) { | 278 if (!m_pSrc->HasAlpha()) { |
280 for (int i = 0; i < pixels; i++) { | 279 for (int i = 0; i < pixels; i++) { |
281 *dest_buf++ = m_RampB[*(src_buf++)]; | 280 *dest_buf++ = m_RampB[*(src_buf++)]; |
282 *dest_buf++ = m_RampG[*(src_buf++)]; | 281 *dest_buf++ = m_RampG[*(src_buf++)]; |
283 *dest_buf++ = m_RampR[*(src_buf++)]; | 282 *dest_buf++ = m_RampR[*(src_buf++)]; |
284 dest_buf++; | 283 dest_buf++; |
285 src_buf++; | 284 src_buf++; |
286 } | 285 } |
287 } else | 286 } else { |
288 #endif | 287 #endif |
289 for (int i = 0; i < pixels; i++) { | 288 for (int i = 0; i < pixels; i++) { |
290 *dest_buf++ = m_RampB[*(src_buf++)]; | 289 *dest_buf++ = m_RampB[*(src_buf++)]; |
291 *dest_buf++ = m_RampG[*(src_buf++)]; | 290 *dest_buf++ = m_RampG[*(src_buf++)]; |
292 *dest_buf++ = m_RampR[*(src_buf++)]; | 291 *dest_buf++ = m_RampR[*(src_buf++)]; |
293 *dest_buf++ = *(src_buf++); | 292 *dest_buf++ = *(src_buf++); |
294 } | 293 } |
| 294 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| 295 } |
| 296 #endif |
295 } | 297 } |
296 } | 298 } |
297 CPDF_ImageRenderer::CPDF_ImageRenderer() { | 299 CPDF_ImageRenderer::CPDF_ImageRenderer() { |
298 m_pRenderStatus = NULL; | 300 m_pRenderStatus = NULL; |
299 m_pImageObject = NULL; | 301 m_pImageObject = NULL; |
300 m_Result = TRUE; | 302 m_Result = TRUE; |
301 m_Status = 0; | 303 m_Status = 0; |
302 m_pTransformer = NULL; | 304 m_pTransformer = NULL; |
303 m_DeviceHandle = NULL; | 305 m_DeviceHandle = NULL; |
304 m_LoadHandle = NULL; | 306 m_LoadHandle = NULL; |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 } else if (pFunc) { | 987 } else if (pFunc) { |
986 int size = dest_pitch * height; | 988 int size = dest_pitch * height; |
987 for (int i = 0; i < size; i++) { | 989 for (int i = 0; i < size; i++) { |
988 dest_buf[i] = transfers[src_buf[i]]; | 990 dest_buf[i] = transfers[src_buf[i]]; |
989 } | 991 } |
990 } else { | 992 } else { |
991 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); | 993 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); |
992 } | 994 } |
993 return pMask.release(); | 995 return pMask.release(); |
994 } | 996 } |
OLD | NEW |