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 #include "core/include/fxge/fx_ge.h" | 5 #include "core/include/fxge/fx_ge.h" |
6 | 6 |
7 #if defined(_SKIA_SUPPORT_) | 7 #if defined(_SKIA_SUPPORT_) |
8 #include "SkBlitter.h" | 8 #include "SkBlitter.h" |
9 #include "core/include/fxcodec/fx_codec.h" | 9 #include "core/include/fxcodec/fx_codec.h" |
10 #include "core/src/fxge/skia/fx_skia_blitter_new.h" | 10 #include "core/src/fxge/skia/fx_skia_blitter_new.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 if (col_end < col_start) | 280 if (col_end < col_start) |
281 return; // do nothing. | 281 return; // do nothing. |
282 dest_scan += col_start; | 282 dest_scan += col_start; |
283 int src_alpha = m_Alpha * cover_scan / 255; | 283 int src_alpha = m_Alpha * cover_scan / 255; |
284 for (int col = col_start; col < col_end; col++) { | 284 for (int col = col_start; col < col_end; col++) { |
285 int src_alpha1 = src_alpha * clip_scan[col] / 255; | 285 int src_alpha1 = src_alpha * clip_scan[col] / 255; |
286 if (!src_alpha1) { | 286 if (!src_alpha1) { |
287 dest_scan++; | 287 dest_scan++; |
288 continue; | 288 continue; |
289 } | 289 } |
290 if (src_alpha1 == 255) | 290 if (src_alpha1 == 255) { |
291 *dest_scan++ = m_Gray; | 291 *dest_scan++ = m_Gray; |
292 else { | 292 } else { |
293 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gray, src_alpha1); | 293 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gray, src_alpha1); |
294 dest_scan++; | 294 dest_scan++; |
295 } | 295 } |
296 } | 296 } |
297 } | 297 } |
298 | 298 |
299 void CFX_SkiaRenderer::CompositeSpanGray_7(uint8_t* dest_scan, | 299 void CFX_SkiaRenderer::CompositeSpanGray_7(uint8_t* dest_scan, |
300 uint8_t* ori_scan, | 300 uint8_t* ori_scan, |
301 int Bpp, | 301 int Bpp, |
302 int span_left, | 302 int span_left, |
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 void* pIccTransform) { // The alpha flag must be fill_flag if exist. | 1493 void* pIccTransform) { // The alpha flag must be fill_flag if exist. |
1494 m_pDevice = pDevice; | 1494 m_pDevice = pDevice; |
1495 m_pClipRgn = pClipRgn; | 1495 m_pClipRgn = pClipRgn; |
1496 m_bRgbByteOrder = bRgbByteOrder; | 1496 m_bRgbByteOrder = bRgbByteOrder; |
1497 m_pOriDevice = pOriDevice; | 1497 m_pOriDevice = pOriDevice; |
1498 m_pDestScan = NULL; | 1498 m_pDestScan = NULL; |
1499 m_pDestExtraAlphaScan = NULL; | 1499 m_pDestExtraAlphaScan = NULL; |
1500 m_pOriScan = NULL; | 1500 m_pOriScan = NULL; |
1501 m_pClipScan = NULL; | 1501 m_pClipScan = NULL; |
1502 composite_span = NULL; | 1502 composite_span = NULL; |
1503 if (m_pClipRgn) | 1503 if (m_pClipRgn) { |
1504 m_ClipBox = m_pClipRgn->GetBox(); | 1504 m_ClipBox = m_pClipRgn->GetBox(); |
1505 else { | 1505 } else { |
1506 m_ClipBox.left = m_ClipBox.top = 0; | 1506 m_ClipBox.left = m_ClipBox.top = 0; |
1507 m_ClipBox.right = m_pDevice->GetWidth(); | 1507 m_ClipBox.right = m_pDevice->GetWidth(); |
1508 m_ClipBox.bottom = m_pDevice->GetHeight(); | 1508 m_ClipBox.bottom = m_pDevice->GetHeight(); |
1509 } | 1509 } |
1510 m_pClipMask = NULL; | 1510 m_pClipMask = NULL; |
1511 if (m_pClipRgn && m_pClipRgn->GetType() == CFX_ClipRgn::MaskF) { | 1511 if (m_pClipRgn && m_pClipRgn->GetType() == CFX_ClipRgn::MaskF) { |
1512 m_pClipMask = m_pClipRgn->GetMask(); | 1512 m_pClipMask = m_pClipRgn->GetMask(); |
1513 m_pClipScan = m_pClipMask->GetBuffer(); | 1513 m_pClipScan = m_pClipMask->GetBuffer(); |
1514 } | 1514 } |
1515 if (m_pDevice->m_pAlphaMask) | 1515 if (m_pDevice->m_pAlphaMask) |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1800 m_pDevice = pDevice; | 1800 m_pDevice = pDevice; |
1801 m_Left = Left; | 1801 m_Left = Left; |
1802 m_Top = Top; | 1802 m_Top = Top; |
1803 if (pDevice) { | 1803 if (pDevice) { |
1804 m_dstWidth = m_Left + pDevice->GetWidth(); | 1804 m_dstWidth = m_Left + pDevice->GetWidth(); |
1805 m_dstHeight = m_Top + pDevice->GetHeight(); | 1805 m_dstHeight = m_Top + pDevice->GetHeight(); |
1806 } | 1806 } |
1807 return TRUE; | 1807 return TRUE; |
1808 } | 1808 } |
1809 #endif | 1809 #endif |
OLD | NEW |