| 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 "../../../include/fxge/fx_ge.h" | 5 #include "../../../include/fxge/fx_ge.h" |
| 6 //#define _SKIA_SUPPORT_ | 6 //#define _SKIA_SUPPORT_ |
| 7 #if defined(_SKIA_SUPPORT_) | 7 #if defined(_SKIA_SUPPORT_) |
| 8 #include "../../../include/fxcodec/fx_codec.h" | 8 #include "../../../include/fxcodec/fx_codec.h" |
| 9 #include "SkBlitter.h" | 9 #include "SkBlitter.h" |
| 10 #include "fx_skia_blitter_new.h" | 10 #include "fx_skia_blitter_new.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 SkAlpha leftAlpha, SkAlpha rightAlpha) | 66 SkAlpha leftAlpha, SkAlpha rightAlpha) |
| 67 { | 67 { |
| 68 blitV(x++, y, height, leftAlpha); | 68 blitV(x++, y, height, leftAlpha); |
| 69 if (width > 0) { | 69 if (width > 0) { |
| 70 blitRect(x, y, width, height); | 70 blitRect(x, y, width, height); |
| 71 x += width; | 71 x += width; |
| 72 } | 72 } |
| 73 blitV(x, y, height, rightAlpha); | 73 blitV(x, y, height, rightAlpha); |
| 74 } | 74 } |
| 75 /*----------------------------------------------------------------------
-----------------------------*/ | 75 /*----------------------------------------------------------------------
-----------------------------*/ |
| 76 » void CFX_SkiaRenderer::CompositeSpan1bpp_0(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, | 76 » void CFX_SkiaRenderer::CompositeSpan1bpp_0(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 77 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 77 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 78 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 78 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 79 » » » FX_LPBYTE dest_extra_alpha_scan) | 79 » » » uint8_t* dest_extra_alpha_scan) |
| 80 { | 80 { |
| 81 ASSERT(!m_bRgbByteOrder); | 81 ASSERT(!m_bRgbByteOrder); |
| 82 ASSERT(!m_pDevice->IsCmykImage()); | 82 ASSERT(!m_pDevice->IsCmykImage()); |
| 83 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft/8; | 83 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft/8; |
| 84 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 84 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 85 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 85 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 86 if (col_end < col_start) return; // do nothing. | 86 if (col_end < col_start) return; // do nothing. |
| 87 dest_scan += col_start/8; | 87 dest_scan += col_start/8; |
| 88 | 88 |
| 89 int index = 0; | 89 int index = 0; |
| 90 if (m_pDevice->GetPalette() == NULL) | 90 if (m_pDevice->GetPalette() == NULL) |
| 91 index = ((uint8_t)m_Color == 0xff) ? 1 : 0; | 91 index = ((uint8_t)m_Color == 0xff) ? 1 : 0; |
| 92 else { | 92 else { |
| 93 for (int i = 0; i < 2; i ++) | 93 for (int i = 0; i < 2; i ++) |
| 94 if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) ==
m_Color) | 94 if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) ==
m_Color) |
| 95 index = i; | 95 index = i; |
| 96 } | 96 } |
| 97 » » FX_LPBYTE dest_scan1 = dest_scan; | 97 » » uint8_t* dest_scan1 = dest_scan; |
| 98 int src_alpha = m_Alpha * cover_scan / 255; | 98 int src_alpha = m_Alpha * cover_scan / 255; |
| 99 for (int col = col_start; col < col_end; col ++) { | 99 for (int col = col_start; col < col_end; col ++) { |
| 100 if (src_alpha) { | 100 if (src_alpha) { |
| 101 if (!index) | 101 if (!index) |
| 102 *dest_scan1 &= ~(1 << (7 - (col+span_lef
t)%8)); | 102 *dest_scan1 &= ~(1 << (7 - (col+span_lef
t)%8)); |
| 103 else | 103 else |
| 104 *dest_scan1|= 1 << (7 - (col+span_left)%
8); | 104 *dest_scan1|= 1 << (7 - (col+span_left)%
8); |
| 105 } | 105 } |
| 106 dest_scan1 = dest_scan+(span_left%8+col-col_start+1)/8; | 106 dest_scan1 = dest_scan+(span_left%8+col-col_start+1)/8; |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 » void CFX_SkiaRenderer::CompositeSpan1bpp_4(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, | 109 » void CFX_SkiaRenderer::CompositeSpan1bpp_4(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 110 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 110 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 111 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 111 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 112 » » » FX_LPBYTE dest_extra_alpha_scan) | 112 » » » uint8_t* dest_extra_alpha_scan) |
| 113 { | 113 { |
| 114 ASSERT(!m_bRgbByteOrder); | 114 ASSERT(!m_bRgbByteOrder); |
| 115 ASSERT(!m_pDevice->IsCmykImage()); | 115 ASSERT(!m_pDevice->IsCmykImage()); |
| 116 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft/8; | 116 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft/8; |
| 117 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; | 117 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; |
| 118 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 118 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 119 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 119 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 120 if (col_end < col_start) return; // do nothing. | 120 if (col_end < col_start) return; // do nothing. |
| 121 dest_scan += col_start/8; | 121 dest_scan += col_start/8; |
| 122 | 122 |
| 123 int index = 0; | 123 int index = 0; |
| 124 if (m_pDevice->GetPalette() == NULL) | 124 if (m_pDevice->GetPalette() == NULL) |
| 125 index = ((uint8_t)m_Color == 0xff) ? 1 : 0; | 125 index = ((uint8_t)m_Color == 0xff) ? 1 : 0; |
| 126 else { | 126 else { |
| 127 for (int i = 0; i < 2; i ++) | 127 for (int i = 0; i < 2; i ++) |
| 128 if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) ==
m_Color) | 128 if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) ==
m_Color) |
| 129 index = i; | 129 index = i; |
| 130 } | 130 } |
| 131 » » FX_LPBYTE dest_scan1 = dest_scan; | 131 » » uint8_t* dest_scan1 = dest_scan; |
| 132 int src_alpha = m_Alpha * cover_scan / 255; | 132 int src_alpha = m_Alpha * cover_scan / 255; |
| 133 for (int col = col_start; col < col_end; col ++) { | 133 for (int col = col_start; col < col_end; col ++) { |
| 134 int src_alpha1 = src_alpha * clip_scan[col] / 255; | 134 int src_alpha1 = src_alpha * clip_scan[col] / 255; |
| 135 if (src_alpha1) { | 135 if (src_alpha1) { |
| 136 if (!index) | 136 if (!index) |
| 137 *dest_scan1 &= ~(1 << (7 - (col+span_lef
t)%8)); | 137 *dest_scan1 &= ~(1 << (7 - (col+span_lef
t)%8)); |
| 138 else | 138 else |
| 139 *dest_scan1|= 1 << (7 - (col+span_left)%
8); | 139 *dest_scan1|= 1 << (7 - (col+span_left)%
8); |
| 140 } | 140 } |
| 141 dest_scan1 = dest_scan+(span_left%8+col-col_start+1)/8; | 141 dest_scan1 = dest_scan+(span_left%8+col-col_start+1)/8; |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 /*----------------------------------------------------------------------
-------------------------------*/ | 144 /*----------------------------------------------------------------------
-------------------------------*/ |
| 145 » void CFX_SkiaRenderer::CompositeSpanGray_2(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, | 145 » void CFX_SkiaRenderer::CompositeSpanGray_2(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 146 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 146 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 147 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 147 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 148 » » » FX_LPBYTE dest_extra_alpha_scan) | 148 » » » uint8_t* dest_extra_alpha_scan) |
| 149 { | 149 { |
| 150 ASSERT(!m_pDevice->IsCmykImage()); | 150 ASSERT(!m_pDevice->IsCmykImage()); |
| 151 ASSERT(!m_bRgbByteOrder); | 151 ASSERT(!m_bRgbByteOrder); |
| 152 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft; | 152 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft; |
| 153 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 153 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 154 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 154 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 155 if (col_end < col_start) return; // do nothing. | 155 if (col_end < col_start) return; // do nothing. |
| 156 dest_scan += col_start; | 156 dest_scan += col_start; |
| 157 if (cover_scan == 255 && m_Alpha == 255) { | 157 if (cover_scan == 255 && m_Alpha == 255) { |
| 158 FXSYS_memset32(dest_scan, FXARGB_MAKE(m_Gray, m_Gray, m_
Gray, m_Gray), col_end - col_start); | 158 FXSYS_memset32(dest_scan, FXARGB_MAKE(m_Gray, m_Gray, m_
Gray, m_Gray), col_end - col_start); |
| 159 return; | 159 return; |
| 160 } | 160 } |
| 161 int src_alpha = m_Alpha * cover_scan / 255; | 161 int src_alpha = m_Alpha * cover_scan / 255; |
| 162 for (int col = col_start; col < col_end; col ++) { | 162 for (int col = col_start; col < col_end; col ++) { |
| 163 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gray, src_a
lpha); | 163 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gray, src_a
lpha); |
| 164 dest_scan++; | 164 dest_scan++; |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 » void CFX_SkiaRenderer::CompositeSpanGray_3(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, | 167 » void CFX_SkiaRenderer::CompositeSpanGray_3(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 168 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 168 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 169 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 169 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 170 » » » FX_LPBYTE dest_extra_alpha_scan) | 170 » » » uint8_t* dest_extra_alpha_scan) |
| 171 { | 171 { |
| 172 ASSERT(!m_pDevice->IsCmykImage()); | 172 ASSERT(!m_pDevice->IsCmykImage()); |
| 173 ASSERT(!m_bRgbByteOrder); | 173 ASSERT(!m_bRgbByteOrder); |
| 174 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft; | 174 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft; |
| 175 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span
_left; | 175 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span
_left; |
| 176 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 176 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 177 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 177 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 178 if (col_end < col_start) return; // do nothing. | 178 if (col_end < col_start) return; // do nothing. |
| 179 dest_scan += col_start; | 179 dest_scan += col_start; |
| 180 ori_scan += col_start; | 180 ori_scan += col_start; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 200 for (int col = col_start; col < col_end; col ++)
{ | 200 for (int col = col_start; col < col_end; col ++)
{ |
| 201 int gray = FXDIB_ALPHA_MERGE(*ori_scan++
, m_Gray, src_alpha); | 201 int gray = FXDIB_ALPHA_MERGE(*ori_scan++
, m_Gray, src_alpha); |
| 202 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, gray, cover_scan); | 202 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, gray, cover_scan); |
| 203 dest_scan++; | 203 dest_scan++; |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 #endif | 206 #endif |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 | 209 |
| 210 » void CFX_SkiaRenderer::CompositeSpanGray_6(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, | 210 » void CFX_SkiaRenderer::CompositeSpanGray_6(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 211 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 211 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 212 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 212 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 213 » » » FX_LPBYTE dest_extra_alpha_scan) | 213 » » » uint8_t* dest_extra_alpha_scan) |
| 214 { | 214 { |
| 215 ASSERT(!m_bRgbByteOrder); | 215 ASSERT(!m_bRgbByteOrder); |
| 216 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft; | 216 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft; |
| 217 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; | 217 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; |
| 218 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 218 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 219 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 219 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 220 if (col_end < col_start) return; // do nothing. | 220 if (col_end < col_start) return; // do nothing. |
| 221 dest_scan += col_start; | 221 dest_scan += col_start; |
| 222 int src_alpha = m_Alpha * cover_scan / 255; | 222 int src_alpha = m_Alpha * cover_scan / 255; |
| 223 for (int col = col_start; col < col_end; col ++) { | 223 for (int col = col_start; col < col_end; col ++) { |
| 224 int src_alpha1 = src_alpha * clip_scan[col] / 255; | 224 int src_alpha1 = src_alpha * clip_scan[col] / 255; |
| 225 if (!src_alpha1) { | 225 if (!src_alpha1) { |
| 226 dest_scan ++; | 226 dest_scan ++; |
| 227 continue; | 227 continue; |
| 228 } | 228 } |
| 229 if (src_alpha1 == 255) | 229 if (src_alpha1 == 255) |
| 230 *dest_scan++ = m_Gray; | 230 *dest_scan++ = m_Gray; |
| 231 else { | 231 else { |
| 232 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gra
y, src_alpha1); | 232 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gra
y, src_alpha1); |
| 233 dest_scan ++; | 233 dest_scan ++; |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 } | 236 } |
| 237 | 237 |
| 238 » void CFX_SkiaRenderer::CompositeSpanGray_7(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, | 238 » void CFX_SkiaRenderer::CompositeSpanGray_7(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 239 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 239 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 240 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 240 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 241 » » » FX_LPBYTE dest_extra_alpha_scan) | 241 » » » uint8_t* dest_extra_alpha_scan) |
| 242 { | 242 { |
| 243 ASSERT(!m_pDevice->IsCmykImage()); | 243 ASSERT(!m_pDevice->IsCmykImage()); |
| 244 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft; | 244 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft; |
| 245 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span
_left; | 245 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span
_left; |
| 246 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; | 246 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; |
| 247 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 247 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 248 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 248 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 249 if (col_end < col_start) return; // do nothing. | 249 if (col_end < col_start) return; // do nothing. |
| 250 dest_scan += col_start; | 250 dest_scan += col_start; |
| 251 ori_scan += col_start; | 251 ori_scan += col_start; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 288 } |
| 289 int gray = FXDIB_ALPHA_MERGE(*ori_scan++, m_Gray
, src_alpha); | 289 int gray = FXDIB_ALPHA_MERGE(*ori_scan++, m_Gray
, src_alpha); |
| 290 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray,
cover_scan); | 290 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray,
cover_scan); |
| 291 dest_scan++; | 291 dest_scan++; |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 #endif | 294 #endif |
| 295 } | 295 } |
| 296 /*----------------------------------------------------------------------
----------------------------*/ | 296 /*----------------------------------------------------------------------
----------------------------*/ |
| 297 | 297 |
| 298 » void CFX_SkiaRenderer::CompositeSpanARGB_2(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, | 298 » void CFX_SkiaRenderer::CompositeSpanARGB_2(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 299 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 299 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 300 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 300 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 301 » » » FX_LPBYTE dest_extra_alpha_scan) | 301 » » » uint8_t* dest_extra_alpha_scan) |
| 302 { | 302 { |
| 303 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); | 303 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); |
| 304 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 304 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 305 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 305 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 306 if (col_end < col_start) return; // do nothing. | 306 if (col_end < col_start) return; // do nothing. |
| 307 dest_scan += col_start<<2; | 307 dest_scan += col_start<<2; |
| 308 if (m_Alpha == 255 && cover_scan == 255) { | 308 if (m_Alpha == 255 && cover_scan == 255) { |
| 309 FXSYS_memset32(dest_scan, m_Color, (col_end - col_start)
<<2); | 309 FXSYS_memset32(dest_scan, m_Color, (col_end - col_start)
<<2); |
| 310 return; | 310 return; |
| 311 } | 311 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 336 int alpha_ratio = src_alpha*255/dest_alpha; | 336 int alpha_ratio = src_alpha*255/dest_alpha; |
| 337 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha
_ratio); | 337 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha
_ratio); |
| 338 dest_scan ++; | 338 dest_scan ++; |
| 339 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, alph
a_ratio); | 339 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, alph
a_ratio); |
| 340 dest_scan ++; | 340 dest_scan ++; |
| 341 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, alpha_
ratio); | 341 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, alpha_
ratio); |
| 342 dest_scan += 2; | 342 dest_scan += 2; |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 | 345 |
| 346 » void CFX_SkiaRenderer::CompositeSpanARGB_3(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, | 346 » void CFX_SkiaRenderer::CompositeSpanARGB_3(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 347 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 347 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 348 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 348 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 349 » » » FX_LPBYTE dest_extra_alpha_scan) | 349 » » » uint8_t* dest_extra_alpha_scan) |
| 350 { | 350 { |
| 351 ASSERT(!m_pDevice->IsCmykImage()); | 351 ASSERT(!m_pDevice->IsCmykImage()); |
| 352 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); | 352 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); |
| 353 //ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (s
pan_left<<2); | 353 //ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (s
pan_left<<2); |
| 354 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 354 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 355 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 355 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 356 if (col_end < col_start) return; // do nothing. | 356 if (col_end < col_start) return; // do nothing. |
| 357 dest_scan += col_start << 2; | 357 dest_scan += col_start << 2; |
| 358 //ori_scan += col_start << 2; | 358 //ori_scan += col_start << 2; |
| 359 | 359 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 385 // alpha cover color cover | 385 // alpha cover color cover |
| 386 dest_scan[3] = FXDIB_ALPHA_MERGE(dest_scan[3], m_Alpha,
cover_scan); | 386 dest_scan[3] = FXDIB_ALPHA_MERGE(dest_scan[3], m_Alpha,
cover_scan); |
| 387 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, cover
_scan); | 387 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, cover
_scan); |
| 388 dest_scan ++; | 388 dest_scan ++; |
| 389 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, cove
r_scan); | 389 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, cove
r_scan); |
| 390 dest_scan ++; | 390 dest_scan ++; |
| 391 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, cover_
scan); | 391 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, cover_
scan); |
| 392 dest_scan += 2; | 392 dest_scan += 2; |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 » void CFX_SkiaRenderer::CompositeSpanARGB_6(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, | 395 » void CFX_SkiaRenderer::CompositeSpanARGB_6(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 396 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 396 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 397 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 397 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 398 » » » FX_LPBYTE dest_extra_alpha_scan) | 398 » » » uint8_t* dest_extra_alpha_scan) |
| 399 { | 399 { |
| 400 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); | 400 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); |
| 401 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; | 401 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; |
| 402 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 402 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 403 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 403 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 404 if (col_end < col_start) return; // do nothing. | 404 if (col_end < col_start) return; // do nothing. |
| 405 dest_scan += col_start << 2; | 405 dest_scan += col_start << 2; |
| 406 #if 1 | 406 #if 1 |
| 407 int src_alpha = m_Alpha * cover_scan / 255; | 407 int src_alpha = m_Alpha * cover_scan / 255; |
| 408 for (int col = col_start; col < col_end; col ++) { | 408 for (int col = col_start; col < col_end; col ++) { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, alpha_ratio); | 500 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, alpha_ratio); |
| 501 dest_scan ++; | 501 dest_scan ++; |
| 502 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, alpha_ratio); | 502 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, alpha_ratio); |
| 503 dest_scan += 2; | 503 dest_scan += 2; |
| 504 } | 504 } |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 #endif | 507 #endif |
| 508 } | 508 } |
| 509 | 509 |
| 510 » void CFX_SkiaRenderer::CompositeSpanARGB_7(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, | 510 » void CFX_SkiaRenderer::CompositeSpanARGB_7(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 511 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 511 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 512 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 512 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 513 » » » FX_LPBYTE dest_extra_alpha_scan) | 513 » » » uint8_t* dest_extra_alpha_scan) |
| 514 { | 514 { |
| 515 ASSERT(!m_pDevice->IsCmykImage()); | 515 ASSERT(!m_pDevice->IsCmykImage()); |
| 516 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); | 516 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); |
| 517 //ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (s
pan_left<<2); | 517 //ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (s
pan_left<<2); |
| 518 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; | 518 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; |
| 519 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 519 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 520 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 520 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 521 if (col_end < col_start) return; // do nothing. | 521 if (col_end < col_start) return; // do nothing. |
| 522 dest_scan += col_start << 2; | 522 dest_scan += col_start << 2; |
| 523 //ori_scan += col_start << 2; | 523 //ori_scan += col_start << 2; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 550 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, cover
_scan); | 550 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, cover
_scan); |
| 551 dest_scan ++; | 551 dest_scan ++; |
| 552 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, cove
r_scan); | 552 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, cove
r_scan); |
| 553 dest_scan ++; | 553 dest_scan ++; |
| 554 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, cover_
scan); | 554 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, cover_
scan); |
| 555 dest_scan += 2; | 555 dest_scan += 2; |
| 556 } | 556 } |
| 557 } | 557 } |
| 558 | 558 |
| 559 /*----------------------------------------------------------------------
-------------------------------------*/ | 559 /*----------------------------------------------------------------------
-------------------------------------*/ |
| 560 » void CFX_SkiaRenderer::CompositeSpanRGB32_2(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, | 560 » void CFX_SkiaRenderer::CompositeSpanRGB32_2(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 561 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 561 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 562 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 562 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 563 » » » FX_LPBYTE dest_extra_alpha_scan) | 563 » » » uint8_t* dest_extra_alpha_scan) |
| 564 { | 564 { |
| 565 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); | 565 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); |
| 566 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 566 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 567 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 567 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 568 if (col_end < col_start) return; // do nothing. | 568 if (col_end < col_start) return; // do nothing. |
| 569 dest_scan += (col_start << 2); | 569 dest_scan += (col_start << 2); |
| 570 if (m_Alpha == 255 && cover_scan == 255) { | 570 if (m_Alpha == 255 && cover_scan == 255) { |
| 571 FXSYS_memset32(dest_scan, m_Color, (col_end - col_start)
<<2); | 571 FXSYS_memset32(dest_scan, m_Color, (col_end - col_start)
<<2); |
| 572 return; | 572 return; |
| 573 } | 573 } |
| 574 int src_alpha; | 574 int src_alpha; |
| 575 #if 0 | 575 #if 0 |
| 576 if (m_bFullCover) | 576 if (m_bFullCover) |
| 577 src_alpha = m_Alpha; | 577 src_alpha = m_Alpha; |
| 578 else | 578 else |
| 579 #endif | 579 #endif |
| 580 src_alpha = m_Alpha * cover_scan / 255; | 580 src_alpha = m_Alpha * cover_scan / 255; |
| 581 for (int col = col_start; col < col_end; col ++) { | 581 for (int col = col_start; col < col_end; col ++) { |
| 582 // Dest format: Rgb32 | 582 // Dest format: Rgb32 |
| 583 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, src_a
lpha); | 583 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, src_a
lpha); |
| 584 dest_scan ++; | 584 dest_scan ++; |
| 585 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, src_
alpha); | 585 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, src_
alpha); |
| 586 dest_scan ++; | 586 dest_scan ++; |
| 587 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, src_al
pha); | 587 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, src_al
pha); |
| 588 dest_scan += 2; | 588 dest_scan += 2; |
| 589 } | 589 } |
| 590 } | 590 } |
| 591 » void CFX_SkiaRenderer::CompositeSpanRGB32_3(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, | 591 » void CFX_SkiaRenderer::CompositeSpanRGB32_3(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 592 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 592 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 593 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 593 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 594 » » » FX_LPBYTE dest_extra_alpha_scan) | 594 » » » uint8_t* dest_extra_alpha_scan) |
| 595 { | 595 { |
| 596 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); | 596 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); |
| 597 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (spa
n_left<<2); | 597 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (spa
n_left<<2); |
| 598 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 598 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 599 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 599 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 600 if (col_end < col_start) return; // do nothing. | 600 if (col_end < col_start) return; // do nothing. |
| 601 dest_scan += col_start << 2; | 601 dest_scan += col_start << 2; |
| 602 ori_scan += col_start << 2; | 602 ori_scan += col_start << 2; |
| 603 if (m_Alpha == 255 && cover_scan == 255) { | 603 if (m_Alpha == 255 && cover_scan == 255) { |
| 604 FXSYS_memset32(dest_scan, m_Color, (col_end - col_start)
<<2); | 604 FXSYS_memset32(dest_scan, m_Color, (col_end - col_start)
<<2); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 620 int r = FXDIB_ALPHA_MERGE(*ori_scan, m_Red, src_alpha); | 620 int r = FXDIB_ALPHA_MERGE(*ori_scan, m_Red, src_alpha); |
| 621 ori_scan += 2; | 621 ori_scan += 2; |
| 622 *dest_scan = FXDIB_ALPHA_MERGE( *dest_scan, b, cover_sca
n); | 622 *dest_scan = FXDIB_ALPHA_MERGE( *dest_scan, b, cover_sca
n); |
| 623 dest_scan ++; | 623 dest_scan ++; |
| 624 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, cover_scan
); | 624 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, cover_scan
); |
| 625 dest_scan ++; | 625 dest_scan ++; |
| 626 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, cover_scan
); | 626 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, cover_scan
); |
| 627 dest_scan += 2; | 627 dest_scan += 2; |
| 628 } | 628 } |
| 629 } | 629 } |
| 630 » void CFX_SkiaRenderer::CompositeSpanRGB32_6(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, | 630 » void CFX_SkiaRenderer::CompositeSpanRGB32_6(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 631 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 631 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 632 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 632 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 633 » » » FX_LPBYTE dest_extra_alpha_scan) | 633 » » » uint8_t* dest_extra_alpha_scan) |
| 634 { | 634 { |
| 635 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); | 635 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); |
| 636 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; | 636 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; |
| 637 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 637 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 638 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 638 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 639 if (col_end < col_start) return; // do nothing. | 639 if (col_end < col_start) return; // do nothing. |
| 640 dest_scan += col_start << 2; | 640 dest_scan += col_start << 2; |
| 641 #if 1 | 641 #if 1 |
| 642 int src_alpha = m_Alpha * cover_scan / 255; | 642 int src_alpha = m_Alpha * cover_scan / 255; |
| 643 for (int col = col_start; col < col_end; col ++) { | 643 for (int col = col_start; col < col_end; col ++) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 dest_scan ++; | 698 dest_scan ++; |
| 699 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, src_alpha1); | 699 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, src_alpha1); |
| 700 dest_scan ++; | 700 dest_scan ++; |
| 701 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, src_alpha1); | 701 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, src_alpha1); |
| 702 dest_scan += 2; | 702 dest_scan += 2; |
| 703 } | 703 } |
| 704 } | 704 } |
| 705 } | 705 } |
| 706 #endif | 706 #endif |
| 707 } | 707 } |
| 708 » void CFX_SkiaRenderer::CompositeSpanRGB32_7(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, | 708 » void CFX_SkiaRenderer::CompositeSpanRGB32_7(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 709 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 709 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 710 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 710 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 711 » » » FX_LPBYTE dest_extra_alpha_scan) | 711 » » » uint8_t* dest_extra_alpha_scan) |
| 712 { | 712 { |
| 713 ASSERT(!m_pDevice->IsCmykImage()); | 713 ASSERT(!m_pDevice->IsCmykImage()); |
| 714 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); | 714 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_l
eft<<2); |
| 715 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (spa
n_left<<2); | 715 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (spa
n_left<<2); |
| 716 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; | 716 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; |
| 717 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 717 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 718 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 718 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 719 if (col_end < col_start) return; // do nothing. | 719 if (col_end < col_start) return; // do nothing. |
| 720 dest_scan += col_start << 2; | 720 dest_scan += col_start << 2; |
| 721 ori_scan += col_start << 2; | 721 ori_scan += col_start << 2; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 dest_scan ++; | 777 dest_scan ++; |
| 778 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, co
ver_scan); | 778 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, co
ver_scan); |
| 779 dest_scan ++; | 779 dest_scan ++; |
| 780 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, co
ver_scan); | 780 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, co
ver_scan); |
| 781 dest_scan += 2; | 781 dest_scan += 2; |
| 782 } | 782 } |
| 783 } | 783 } |
| 784 #endif | 784 #endif |
| 785 } | 785 } |
| 786 /*----------------------------------------------------------------------
-------------------------------*/ | 786 /*----------------------------------------------------------------------
-------------------------------*/ |
| 787 » void CFX_SkiaRenderer::CompositeSpanRGB24_2(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, | 787 » void CFX_SkiaRenderer::CompositeSpanRGB24_2(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 788 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 788 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 789 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 789 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 790 » » » FX_LPBYTE dest_extra_alpha_scan) | 790 » » » uint8_t* dest_extra_alpha_scan) |
| 791 { | 791 { |
| 792 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft + (span_left<<1); | 792 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft + (span_left<<1); |
| 793 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 793 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 794 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 794 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 795 if (col_end < col_start) return; // do nothing. | 795 if (col_end < col_start) return; // do nothing. |
| 796 dest_scan += (col_start<<1)+col_start; | 796 dest_scan += (col_start<<1)+col_start; |
| 797 int src_alpha; | 797 int src_alpha; |
| 798 #if 0 | 798 #if 0 |
| 799 if (m_bFullCover) | 799 if (m_bFullCover) |
| 800 src_alpha = m_Alpha; | 800 src_alpha = m_Alpha; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 811 } | 811 } |
| 812 for (int col = col_start; col < col_end; col ++) { | 812 for (int col = col_start; col < col_end; col ++) { |
| 813 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, src_a
lpha); | 813 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, src_a
lpha); |
| 814 dest_scan ++; | 814 dest_scan ++; |
| 815 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, src_
alpha); | 815 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, src_
alpha); |
| 816 dest_scan ++; | 816 dest_scan ++; |
| 817 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, src_al
pha); | 817 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, src_al
pha); |
| 818 dest_scan ++; | 818 dest_scan ++; |
| 819 } | 819 } |
| 820 } | 820 } |
| 821 » void CFX_SkiaRenderer::CompositeSpanRGB24_3(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, | 821 » void CFX_SkiaRenderer::CompositeSpanRGB24_3(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 822 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 822 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 823 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 823 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 824 » » » FX_LPBYTE dest_extra_alpha_scan) | 824 » » » uint8_t* dest_extra_alpha_scan) |
| 825 { | 825 { |
| 826 ASSERT(!m_pDevice->IsCmykImage()); | 826 ASSERT(!m_pDevice->IsCmykImage()); |
| 827 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft + (span_left<<1); | 827 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft + (span_left<<1); |
| 828 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span
_left + (span_left<<1); | 828 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span
_left + (span_left<<1); |
| 829 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 829 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 830 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 830 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 831 if (col_end < col_start) return; // do nothing. | 831 if (col_end < col_start) return; // do nothing. |
| 832 dest_scan += (col_start<<1) + col_start; | 832 dest_scan += (col_start<<1) + col_start; |
| 833 ori_scan += (col_start<<1) + col_start; | 833 ori_scan += (col_start<<1) + col_start; |
| 834 if (m_Alpha == 255&&cover_scan == 255) { | 834 if (m_Alpha == 255&&cover_scan == 255) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 852 int g = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, m_Alpha)
; | 852 int g = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, m_Alpha)
; |
| 853 int r = FXDIB_ALPHA_MERGE(*ori_scan++, m_Red, m_Alpha); | 853 int r = FXDIB_ALPHA_MERGE(*ori_scan++, m_Red, m_Alpha); |
| 854 *dest_scan = FXDIB_ALPHA_MERGE( *dest_scan, b, cover_sca
n); | 854 *dest_scan = FXDIB_ALPHA_MERGE( *dest_scan, b, cover_sca
n); |
| 855 dest_scan ++; | 855 dest_scan ++; |
| 856 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, cover_scan
); | 856 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, cover_scan
); |
| 857 dest_scan ++; | 857 dest_scan ++; |
| 858 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, cover_scan
); | 858 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, cover_scan
); |
| 859 dest_scan ++; | 859 dest_scan ++; |
| 860 } | 860 } |
| 861 } | 861 } |
| 862 » void CFX_SkiaRenderer::CompositeSpanRGB24_6(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, | 862 » void CFX_SkiaRenderer::CompositeSpanRGB24_6(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 863 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 863 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 864 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 864 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 865 » » » FX_LPBYTE dest_extra_alpha_scan) | 865 » » » uint8_t* dest_extra_alpha_scan) |
| 866 { | 866 { |
| 867 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft+(span_left<<1); | 867 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft+(span_left<<1); |
| 868 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; | 868 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; |
| 869 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 869 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 870 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 870 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 871 if (col_end < col_start) return; // do nothing. | 871 if (col_end < col_start) return; // do nothing. |
| 872 dest_scan += col_start + (col_start << 1); | 872 dest_scan += col_start + (col_start << 1); |
| 873 #if 1 | 873 #if 1 |
| 874 int src_alpha = m_Alpha * cover_scan /255; | 874 int src_alpha = m_Alpha * cover_scan /255; |
| 875 for (int col = col_start; col < col_end; col ++) { | 875 for (int col = col_start; col < col_end; col ++) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 dest_scan ++; | 932 dest_scan ++; |
| 933 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, src_alpha1); | 933 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, src_alpha1); |
| 934 dest_scan ++; | 934 dest_scan ++; |
| 935 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, src_alpha1); | 935 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, src_alpha1); |
| 936 dest_scan ++; | 936 dest_scan ++; |
| 937 } | 937 } |
| 938 } | 938 } |
| 939 } | 939 } |
| 940 #endif | 940 #endif |
| 941 } | 941 } |
| 942 » void CFX_SkiaRenderer::CompositeSpanRGB24_7(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, | 942 » void CFX_SkiaRenderer::CompositeSpanRGB24_7(uint8_t* dest_scan, uint8_t*
ori_scan,int Bpp, |
| 943 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 943 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 944 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 944 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 945 » » » FX_LPBYTE dest_extra_alpha_scan) | 945 » » » uint8_t* dest_extra_alpha_scan) |
| 946 { | 946 { |
| 947 ASSERT(!m_pDevice->IsCmykImage()); | 947 ASSERT(!m_pDevice->IsCmykImage()); |
| 948 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft+(span_left<<1); | 948 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft+(span_left<<1); |
| 949 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span
_left+(span_left<<1); | 949 ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span
_left+(span_left<<1); |
| 950 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; | 950 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; |
| 951 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 951 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 952 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 952 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 953 if (col_end < col_start) return; // do nothing. | 953 if (col_end < col_start) return; // do nothing. |
| 954 dest_scan += col_start + (col_start<<1); | 954 dest_scan += col_start + (col_start<<1); |
| 955 ori_scan += col_start + (col_start<<1); | 955 ori_scan += col_start + (col_start<<1); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 *dest_scan = FXDIB_ALPHA_MERGE( *dest_scan, b, c
over_scan); | 1010 *dest_scan = FXDIB_ALPHA_MERGE( *dest_scan, b, c
over_scan); |
| 1011 dest_scan ++; | 1011 dest_scan ++; |
| 1012 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, co
ver_scan); | 1012 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, co
ver_scan); |
| 1013 dest_scan ++; | 1013 dest_scan ++; |
| 1014 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, co
ver_scan); | 1014 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, co
ver_scan); |
| 1015 dest_scan ++; | 1015 dest_scan ++; |
| 1016 } | 1016 } |
| 1017 } | 1017 } |
| 1018 #endif | 1018 #endif |
| 1019 } | 1019 } |
| 1020 » void CFX_SkiaRenderer::CompositeSpanRGB24_10(FX_LPBYTE dest_scan, FX_LPB
YTE ori_scan,int Bpp, | 1020 » void CFX_SkiaRenderer::CompositeSpanRGB24_10(uint8_t* dest_scan, uint8_t
* ori_scan,int Bpp, |
| 1021 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 1021 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 1022 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 1022 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 1023 » » » FX_LPBYTE dest_extra_alpha_scan) | 1023 » » » uint8_t* dest_extra_alpha_scan) |
| 1024 { | 1024 { |
| 1025 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft+(span_left<<1); | 1025 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft+(span_left<<1); |
| 1026 dest_extra_alpha_scan = (uint8_t*)m_pDevice->m_pAlphaMask->GetS
canline(span_top)+span_left; | 1026 dest_extra_alpha_scan = (uint8_t*)m_pDevice->m_pAlphaMask->GetS
canline(span_top)+span_left; |
| 1027 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 1027 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 1028 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 1028 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 1029 if (col_end < col_start) return; // do nothing. | 1029 if (col_end < col_start) return; // do nothing. |
| 1030 dest_scan += col_start+(col_start<<1); | 1030 dest_scan += col_start+(col_start<<1); |
| 1031 #if 1 | 1031 #if 1 |
| 1032 if (m_Alpha == 255 && cover_scan == 255) { | 1032 if (m_Alpha == 255 && cover_scan == 255) { |
| 1033 for (int col = col_start; col < col_end; col ++) { | 1033 for (int col = col_start; col < col_end; col ++) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blu
e, alpha_ratio); | 1099 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blu
e, alpha_ratio); |
| 1100 dest_scan ++; | 1100 dest_scan ++; |
| 1101 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gre
en, alpha_ratio); | 1101 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gre
en, alpha_ratio); |
| 1102 dest_scan ++; | 1102 dest_scan ++; |
| 1103 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red
, alpha_ratio); | 1103 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red
, alpha_ratio); |
| 1104 dest_scan ++; | 1104 dest_scan ++; |
| 1105 } | 1105 } |
| 1106 } | 1106 } |
| 1107 #endif | 1107 #endif |
| 1108 } | 1108 } |
| 1109 » void CFX_SkiaRenderer::CompositeSpanRGB24_14(FX_LPBYTE dest_scan, FX_LPB
YTE ori_scan,int Bpp, | 1109 » void CFX_SkiaRenderer::CompositeSpanRGB24_14(uint8_t* dest_scan, uint8_t
* ori_scan,int Bpp, |
| 1110 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 1110 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 1111 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 1111 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 1112 » » » FX_LPBYTE dest_extra_alpha_scan) | 1112 » » » uint8_t* dest_extra_alpha_scan) |
| 1113 { | 1113 { |
| 1114 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft+(span_left<<1); | 1114 dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft+(span_left<<1); |
| 1115 dest_extra_alpha_scan = (uint8_t*)m_pDevice->m_pAlphaMask->GetS
canline(span_top)+span_left; | 1115 dest_extra_alpha_scan = (uint8_t*)m_pDevice->m_pAlphaMask->GetS
canline(span_top)+span_left; |
| 1116 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; | 1116 clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top
) - clip_left + span_left; |
| 1117 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 1117 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 1118 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 1118 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 1119 if (col_end < col_start) return; // do nothing. | 1119 if (col_end < col_start) return; // do nothing. |
| 1120 dest_scan += col_start + (col_start << 1); | 1120 dest_scan += col_start + (col_start << 1); |
| 1121 #if 1 | 1121 #if 1 |
| 1122 int src_alpha = m_Alpha * cover_scan / 255; | 1122 int src_alpha = m_Alpha * cover_scan / 255; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, alpha_ratio); | 1204 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, alpha_ratio); |
| 1205 dest_scan ++; | 1205 dest_scan ++; |
| 1206 } | 1206 } |
| 1207 } | 1207 } |
| 1208 } | 1208 } |
| 1209 #endif | 1209 #endif |
| 1210 } | 1210 } |
| 1211 /*----------------------------------------------------------------------
-------------------------------*/ | 1211 /*----------------------------------------------------------------------
-------------------------------*/ |
| 1212 | 1212 |
| 1213 // A general alpha merge function (with clipping mask). Cmyka/Cmyk devic
e. | 1213 // A general alpha merge function (with clipping mask). Cmyka/Cmyk devic
e. |
| 1214 » void CFX_SkiaRenderer::CompositeSpanCMYK(FX_LPBYTE dest_scan, FX_LPBYTE
ori_scan,int Bpp, | 1214 » void CFX_SkiaRenderer::CompositeSpanCMYK(uint8_t* dest_scan, uint8_t* or
i_scan,int Bpp, |
| 1215 int span_left, int span_len, int span_top, uint8_t cover
_scan, | 1215 int span_left, int span_len, int span_top, uint8_t cover
_scan, |
| 1216 » » » int clip_top, int clip_left, int clip_right, FX_LPBYTE c
lip_scan, | 1216 » » » int clip_top, int clip_left, int clip_right, uint8_t* cl
ip_scan, |
| 1217 » » » FX_LPBYTE dest_extra_alpha_scan) | 1217 » » » uint8_t* dest_extra_alpha_scan) |
| 1218 { | 1218 { |
| 1219 ASSERT(!m_bRgbByteOrder); | 1219 ASSERT(!m_bRgbByteOrder); |
| 1220 // Cmyk(a) | 1220 // Cmyk(a) |
| 1221 int col_start = span_left < clip_left ? clip_left - span_left :
0; | 1221 int col_start = span_left < clip_left ? clip_left - span_left :
0; |
| 1222 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); | 1222 int col_end = (span_left + span_len) < clip_right ? span_len : (
clip_right - span_left); |
| 1223 if (col_end < col_start) return; // do nothing. | 1223 if (col_end < col_start) return; // do nothing. |
| 1224 dest_scan += col_start * 4; | 1224 dest_scan += col_start * 4; |
| 1225 Bpp; // for avoid compile warning. | 1225 Bpp; // for avoid compile warning. |
| 1226 | 1226 |
| 1227 if (dest_extra_alpha_scan) { | 1227 if (dest_extra_alpha_scan) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 if (m_pDevice->GetBPP() == 8) { // Gray(a) device | 1346 if (m_pDevice->GetBPP() == 8) { // Gray(a) device |
| 1347 ASSERT(!m_bRgbByteOrder); | 1347 ASSERT(!m_bRgbByteOrder); |
| 1348 if (m_pDevice->IsAlphaMask()) { | 1348 if (m_pDevice->IsAlphaMask()) { |
| 1349 //Alpha Mask | 1349 //Alpha Mask |
| 1350 m_Gray = 255; | 1350 m_Gray = 255; |
| 1351 } else { | 1351 } else { |
| 1352 //Gray(a) device | 1352 //Gray(a) device |
| 1353 if (pIccTransform) { | 1353 if (pIccTransform) { |
| 1354 uint8_t gray; | 1354 uint8_t gray; |
| 1355 color = bObjectCMYK ? FXCMYK_TODIB(color
) : FXARGB_TODIB(color); | 1355 color = bObjectCMYK ? FXCMYK_TODIB(color
) : FXARGB_TODIB(color); |
| 1356 » » » » » pIccModule->TranslateScanline(pIccTransf
orm, &gray, (FX_LPCBYTE)&color, 1); | 1356 » » » » » pIccModule->TranslateScanline(pIccTransf
orm, &gray, (const uint8_t*)&color, 1); |
| 1357 m_Gray = gray; | 1357 m_Gray = gray; |
| 1358 } else { | 1358 } else { |
| 1359 if (bObjectCMYK) { | 1359 if (bObjectCMYK) { |
| 1360 uint8_t r, g, b; | 1360 uint8_t r, g, b; |
| 1361 AdobeCMYK_to_sRGB1(FXSYS_GetCVal
ue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color
), | 1361 AdobeCMYK_to_sRGB1(FXSYS_GetCVal
ue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color
), |
| 1362 r, g, b); | 1362 r, g, b); |
| 1363 m_Gray = FXRGB2GRAY(r, g, b); | 1363 m_Gray = FXRGB2GRAY(r, g, b); |
| 1364 } else { | 1364 } else { |
| 1365 m_Gray = FXRGB2GRAY(FXARGB_R(col
or), FXARGB_G(color), FXARGB_B(color)); | 1365 m_Gray = FXRGB2GRAY(FXARGB_R(col
or), FXARGB_G(color), FXARGB_B(color)); |
| 1366 } | 1366 } |
| 1367 } | 1367 } |
| 1368 } | 1368 } |
| 1369 } else { | 1369 } else { |
| 1370 if (bDeviceCMYK) { // Cmyk(a) Device | 1370 if (bDeviceCMYK) { // Cmyk(a) Device |
| 1371 ASSERT(!m_bRgbByteOrder); | 1371 ASSERT(!m_bRgbByteOrder); |
| 1372 //TODO... opt for cmyk | 1372 //TODO... opt for cmyk |
| 1373 composite_span = &CFX_SkiaRenderer::CompositeSpa
nCMYK; | 1373 composite_span = &CFX_SkiaRenderer::CompositeSpa
nCMYK; |
| 1374 if (bObjectCMYK) { | 1374 if (bObjectCMYK) { |
| 1375 m_Color = FXCMYK_TODIB(color); | 1375 m_Color = FXCMYK_TODIB(color); |
| 1376 if (pIccTransform) | 1376 if (pIccTransform) |
| 1377 » » » » » » pIccModule->TranslateScanline(pI
ccTransform, (FX_LPBYTE)&m_Color, (FX_LPCBYTE)&m_Color, 1); | 1377 » » » » » » pIccModule->TranslateScanline(pI
ccTransform, (uint8_t*)&m_Color, (const uint8_t*)&m_Color, 1); |
| 1378 } else { // Object RGB | 1378 } else { // Object RGB |
| 1379 if (!pIccTransform) | 1379 if (!pIccTransform) |
| 1380 return FALSE; | 1380 return FALSE; |
| 1381 color = FXARGB_TODIB(color); | 1381 color = FXARGB_TODIB(color); |
| 1382 » » » » » pIccModule->TranslateScanline(pIccTransf
orm, (FX_LPBYTE)&m_Color, (FX_LPCBYTE)&color, 1); | 1382 » » » » » pIccModule->TranslateScanline(pIccTransf
orm, (uint8_t*)&m_Color, (const uint8_t*)&color, 1); |
| 1383 } | 1383 } |
| 1384 » » » » m_Red» = ((FX_LPBYTE)&m_Color)[0]; | 1384 » » » » m_Red» = ((uint8_t*)&m_Color)[0]; |
| 1385 » » » » m_Green = ((FX_LPBYTE)&m_Color)[1]; | 1385 » » » » m_Green = ((uint8_t*)&m_Color)[1]; |
| 1386 » » » » m_Blue» = ((FX_LPBYTE)&m_Color)[2]; | 1386 » » » » m_Blue» = ((uint8_t*)&m_Color)[2]; |
| 1387 » » » » m_Gray» = ((FX_LPBYTE)&m_Color)[3]; | 1387 » » » » m_Gray» = ((uint8_t*)&m_Color)[3]; |
| 1388 return TRUE; | 1388 return TRUE; |
| 1389 } else { | 1389 } else { |
| 1390 if (pIccTransform) { | 1390 if (pIccTransform) { |
| 1391 color = bObjectCMYK ? FXCMYK_TODIB(color
) : FXARGB_TODIB(color); | 1391 color = bObjectCMYK ? FXCMYK_TODIB(color
) : FXARGB_TODIB(color); |
| 1392 » » » » » pIccModule->TranslateScanline(pIccTransf
orm, (FX_LPBYTE)&m_Color, (FX_LPCBYTE)&color, 1); | 1392 » » » » » pIccModule->TranslateScanline(pIccTransf
orm, (uint8_t*)&m_Color, (const uint8_t*)&color, 1); |
| 1393 » » » » » ((FX_LPBYTE)&m_Color)[3] = m_Alpha; | 1393 » » » » » ((uint8_t*)&m_Color)[3] = m_Alpha; |
| 1394 » » » » » m_Red = ((FX_LPBYTE)&m_Color)[2]; | 1394 » » » » » m_Red = ((uint8_t*)&m_Color)[2]; |
| 1395 » » » » » m_Green = ((FX_LPBYTE)&m_Color)[1]; | 1395 » » » » » m_Green = ((uint8_t*)&m_Color)[1]; |
| 1396 » » » » » m_Blue = ((FX_LPBYTE)&m_Color)[0]; | 1396 » » » » » m_Blue = ((uint8_t*)&m_Color)[0]; |
| 1397 // Need Johnson to improvement it. | 1397 // Need Johnson to improvement it. |
| 1398 if (m_bRgbByteOrder) { | 1398 if (m_bRgbByteOrder) { |
| 1399 // swap | 1399 // swap |
| 1400 » » » » » » m_Red = ((FX_LPBYTE)&m_Color)[0]
; | 1400 » » » » » » m_Red = ((uint8_t*)&m_Color)[0]; |
| 1401 » » » » » » m_Blue = ((FX_LPBYTE)&m_Color)[2
]; | 1401 » » » » » » m_Blue = ((uint8_t*)&m_Color)[2]
; |
| 1402 m_Color = FXARGB_TODIB(m_Color); | 1402 m_Color = FXARGB_TODIB(m_Color); |
| 1403 m_Color = FXARGB_TOBGRORDERDIB(m
_Color); | 1403 m_Color = FXARGB_TOBGRORDERDIB(m
_Color); |
| 1404 } | 1404 } |
| 1405 } else { | 1405 } else { |
| 1406 if (bObjectCMYK) { | 1406 if (bObjectCMYK) { |
| 1407 uint8_t r, g, b; | 1407 uint8_t r, g, b; |
| 1408 AdobeCMYK_to_sRGB1(FXSYS_GetCVal
ue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color
), | 1408 AdobeCMYK_to_sRGB1(FXSYS_GetCVal
ue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color
), |
| 1409 r, g, b); | 1409 r, g, b); |
| 1410 m_Color = FXARGB_MAKE(m_Alpha, r
, g, b); | 1410 m_Color = FXARGB_MAKE(m_Alpha, r
, g, b); |
| 1411 if (m_bRgbByteOrder){ | 1411 if (m_bRgbByteOrder){ |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1502 } | 1502 } |
| 1503 | 1503 |
| 1504 /*----------------------------------------------------------------------
------------------------------*/ | 1504 /*----------------------------------------------------------------------
------------------------------*/ |
| 1505 void CFX_SkiaA8Renderer::blitAntiH(int x, int y, const SkAlpha antialias
[], const int16_t runs[]) | 1505 void CFX_SkiaA8Renderer::blitAntiH(int x, int y, const SkAlpha antialias
[], const int16_t runs[]) |
| 1506 { | 1506 { |
| 1507 FXSYS_assert(m_pDevice); | 1507 FXSYS_assert(m_pDevice); |
| 1508 int dst_y = y - m_Top; | 1508 int dst_y = y - m_Top; |
| 1509 if (dst_y < 0 || dst_y >= m_pDevice->GetHeight()) | 1509 if (dst_y < 0 || dst_y >= m_pDevice->GetHeight()) |
| 1510 return; | 1510 return; |
| 1511 | 1511 |
| 1512 » » FX_LPBYTE dest_scan = m_pDevice->GetBuffer() + m_pDevice->GetPit
ch() * dst_y; | 1512 » » uint8_t* dest_scan = m_pDevice->GetBuffer() + m_pDevice->GetPitc
h() * dst_y; |
| 1513 » » FX_LPBYTE dest_pos = dest_scan; | 1513 » » uint8_t* dest_pos = dest_scan; |
| 1514 while (1) | 1514 while (1) |
| 1515 { | 1515 { |
| 1516 if (x >= m_dstWidth) | 1516 if (x >= m_dstWidth) |
| 1517 return; | 1517 return; |
| 1518 int width = runs[0]; | 1518 int width = runs[0]; |
| 1519 SkASSERT(width >= 0); | 1519 SkASSERT(width >= 0); |
| 1520 if (width <= 0) | 1520 if (width <= 0) |
| 1521 return; | 1521 return; |
| 1522 unsigned aa = antialias[0]; | 1522 unsigned aa = antialias[0]; |
| 1523 if (aa) { | 1523 if (aa) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1539 } | 1539 } |
| 1540 } | 1540 } |
| 1541 void CFX_SkiaA8Renderer::blitH(int x, int y, int width) | 1541 void CFX_SkiaA8Renderer::blitH(int x, int y, int width) |
| 1542 { | 1542 { |
| 1543 FXSYS_assert(m_pDevice); | 1543 FXSYS_assert(m_pDevice); |
| 1544 int dst_y = y - m_Top; | 1544 int dst_y = y - m_Top; |
| 1545 if (dst_y < 0 || dst_y >= m_pDevice->GetHeight()) | 1545 if (dst_y < 0 || dst_y >= m_pDevice->GetHeight()) |
| 1546 return; | 1546 return; |
| 1547 if (x >= m_dstWidth) | 1547 if (x >= m_dstWidth) |
| 1548 return; | 1548 return; |
| 1549 » » FX_LPBYTE dest_scan = m_pDevice->GetBuffer() + m_pDevice->GetPit
ch() * dst_y; | 1549 » » uint8_t* dest_scan = m_pDevice->GetBuffer() + m_pDevice->GetPitc
h() * dst_y; |
| 1550 int col_start = x < m_Left ? 0 : x - m_Left; | 1550 int col_start = x < m_Left ? 0 : x - m_Left; |
| 1551 int col_end = x + width; | 1551 int col_end = x + width; |
| 1552 col_end = col_end < m_dstWidth ? col_end - m_Left: m_pDevice->Ge
tWidth(); | 1552 col_end = col_end < m_dstWidth ? col_end - m_Left: m_pDevice->Ge
tWidth(); |
| 1553 int result = col_end - col_start; | 1553 int result = col_end - col_start; |
| 1554 if (result > 0) { | 1554 if (result > 0) { |
| 1555 uint8_t* dest_pos = dest_scan + col_start; | 1555 uint8_t* dest_pos = dest_scan + col_start; |
| 1556 if (result >= 4) | 1556 if (result >= 4) |
| 1557 FXSYS_memset32(dest_pos, 0xffffffff,result); | 1557 FXSYS_memset32(dest_pos, 0xffffffff,result); |
| 1558 else | 1558 else |
| 1559 FXSYS_memset(dest_pos,255,result); | 1559 FXSYS_memset(dest_pos,255,result); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1601 m_pDevice = pDevice; | 1601 m_pDevice = pDevice; |
| 1602 m_Left = Left; | 1602 m_Left = Left; |
| 1603 m_Top = Top; | 1603 m_Top = Top; |
| 1604 if (pDevice){ | 1604 if (pDevice){ |
| 1605 m_dstWidth = m_Left + pDevice->GetWidth(); | 1605 m_dstWidth = m_Left + pDevice->GetWidth(); |
| 1606 m_dstHeight = m_Top + pDevice->GetHeight(); | 1606 m_dstHeight = m_Top + pDevice->GetHeight(); |
| 1607 } | 1607 } |
| 1608 return TRUE; | 1608 return TRUE; |
| 1609 } | 1609 } |
| 1610 #endif | 1610 #endif |
| OLD | NEW |