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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, |
77 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
79 FX_LPBYTE dest_extra_alpha_scan) | 79 FX_LPBYTE 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 = (FX_BYTE*)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 = ((FX_BYTE)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 FX_LPBYTE 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(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, |
110 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
112 FX_LPBYTE dest_extra_alpha_scan) | 112 FX_LPBYTE 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 = (FX_BYTE*)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 = (FX_BYTE*)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 = ((FX_BYTE)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 FX_LPBYTE 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(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, |
146 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
148 FX_LPBYTE dest_extra_alpha_scan) | 148 FX_LPBYTE 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 = (FX_BYTE*)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(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, |
168 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
170 FX_LPBYTE dest_extra_alpha_scan) | 170 FX_LPBYTE 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 = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_le
ft; | 174 » » dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft; |
175 » » ori_scan = (FX_BYTE*)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; |
181 if (m_Alpha == 255 && cover_scan == 255) { | 181 if (m_Alpha == 255 && cover_scan == 255) { |
182 FXSYS_memset32(dest_scan, FXARGB_MAKE(m_Gray, m_Gray, m_
Gray, m_Gray), col_end - col_start); | 182 FXSYS_memset32(dest_scan, FXARGB_MAKE(m_Gray, m_Gray, m_
Gray, m_Gray), col_end - col_start); |
183 } else { | 183 } else { |
184 int src_alpha = m_Alpha; | 184 int src_alpha = m_Alpha; |
185 #if 1 | 185 #if 1 |
(...skipping 15 matching lines...) Expand all Loading... |
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(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, |
211 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
213 FX_LPBYTE dest_extra_alpha_scan) | 213 FX_LPBYTE dest_extra_alpha_scan) |
214 { | 214 { |
215 ASSERT(!m_bRgbByteOrder); | 215 ASSERT(!m_bRgbByteOrder); |
216 » » dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_le
ft; | 216 » » dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft; |
217 » » clip_scan = (FX_BYTE*)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(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, |
239 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
241 FX_LPBYTE dest_extra_alpha_scan) | 241 FX_LPBYTE dest_extra_alpha_scan) |
242 { | 242 { |
243 ASSERT(!m_pDevice->IsCmykImage()); | 243 ASSERT(!m_pDevice->IsCmykImage()); |
244 » » dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_le
ft; | 244 » » dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_le
ft; |
245 » » ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + span
_left; | 245 » » ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span
_left; |
246 » » clip_scan = (FX_BYTE*)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; |
252 #if 1 | 252 #if 1 |
253 for (int col = col_start; col < col_end; col ++) { | 253 for (int col = col_start; col < col_end; col ++) { |
254 int src_alpha = m_Alpha * clip_scan[col] / 255; | 254 int src_alpha = m_Alpha * clip_scan[col] / 255; |
255 if (src_alpha == 255 && cover_scan == 255) { | 255 if (src_alpha == 255 && cover_scan == 255) { |
256 *dest_scan++ = m_Gray; | 256 *dest_scan++ = m_Gray; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, |
299 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
301 FX_LPBYTE dest_extra_alpha_scan) | 301 FX_LPBYTE dest_extra_alpha_scan) |
302 { | 302 { |
303 » » dest_scan = (FX_BYTE*)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 } |
312 int src_alpha; | 312 int src_alpha; |
313 #if 0 | 313 #if 0 |
(...skipping 10 matching lines...) Expand all Loading... |
324 // Dest format: Argb | 324 // Dest format: Argb |
325 // calculate destination alpha (it's union of source and
dest alpha) | 325 // calculate destination alpha (it's union of source and
dest alpha) |
326 if (dest_scan[3] == 0) { | 326 if (dest_scan[3] == 0) { |
327 dest_scan[3] = src_alpha; | 327 dest_scan[3] = src_alpha; |
328 *dest_scan++ = m_Blue; | 328 *dest_scan++ = m_Blue; |
329 *dest_scan++ = m_Green; | 329 *dest_scan++ = m_Green; |
330 *dest_scan = m_Red; | 330 *dest_scan = m_Red; |
331 dest_scan += 2; | 331 dest_scan += 2; |
332 continue; | 332 continue; |
333 } | 333 } |
334 » » » FX_BYTE dest_alpha = dest_scan[3] + src_alpha - dest_sca
n[3] * src_alpha / 255; | 334 » » » uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_sca
n[3] * src_alpha / 255; |
335 dest_scan[3] = dest_alpha; | 335 dest_scan[3] = dest_alpha; |
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(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, |
347 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
349 FX_LPBYTE dest_extra_alpha_scan) | 349 FX_LPBYTE dest_extra_alpha_scan) |
350 { | 350 { |
351 ASSERT(!m_pDevice->IsCmykImage()); | 351 ASSERT(!m_pDevice->IsCmykImage()); |
352 » » dest_scan = (FX_BYTE*)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 = (FX_BYTE*)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 |
360 if (m_Alpha == 255 && cover_scan == 255){ | 360 if (m_Alpha == 255 && cover_scan == 255){ |
361 FXSYS_memset32(dest_scan, m_Color, (col_end - col_start)
<<2); | 361 FXSYS_memset32(dest_scan, m_Color, (col_end - col_start)
<<2); |
362 return; | 362 return; |
363 } | 363 } |
(...skipping 22 matching lines...) Expand all Loading... |
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(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, |
396 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
398 FX_LPBYTE dest_extra_alpha_scan) | 398 FX_LPBYTE dest_extra_alpha_scan) |
399 { | 399 { |
400 » » dest_scan = (FX_BYTE*)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 = (FX_BYTE*)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 ++) { |
409 int src_alpha1 = src_alpha* clip_scan[col] / 255; | 409 int src_alpha1 = src_alpha* clip_scan[col] / 255; |
410 if (!src_alpha1) { | 410 if (!src_alpha1) { |
411 dest_scan += 4; | 411 dest_scan += 4; |
412 continue; | 412 continue; |
413 } | 413 } |
414 if (src_alpha1 == 255) { | 414 if (src_alpha1 == 255) { |
415 *(FX_DWORD*)dest_scan = m_Color; | 415 *(FX_DWORD*)dest_scan = m_Color; |
416 dest_scan += 4; | 416 dest_scan += 4; |
417 } else { | 417 } else { |
418 // Dest format: Argb | 418 // Dest format: Argb |
419 // calculate destination alpha (it's union of so
urce and dest alpha) | 419 // calculate destination alpha (it's union of so
urce and dest alpha) |
420 if (dest_scan[3] == 0) { | 420 if (dest_scan[3] == 0) { |
421 dest_scan[3] = src_alpha1; | 421 dest_scan[3] = src_alpha1; |
422 *dest_scan++ = m_Blue; | 422 *dest_scan++ = m_Blue; |
423 *dest_scan++ = m_Green; | 423 *dest_scan++ = m_Green; |
424 *dest_scan = m_Red; | 424 *dest_scan = m_Red; |
425 dest_scan += 2; | 425 dest_scan += 2; |
426 continue; | 426 continue; |
427 } | 427 } |
428 » » » » FX_BYTE dest_alpha = dest_scan[3] + src_alpha1 -
dest_scan[3] * src_alpha1 / 255; | 428 » » » » uint8_t dest_alpha = dest_scan[3] + src_alpha1 -
dest_scan[3] * src_alpha1 / 255; |
429 dest_scan[3] = dest_alpha; | 429 dest_scan[3] = dest_alpha; |
430 int alpha_ratio = src_alpha1*255/dest_alpha; | 430 int alpha_ratio = src_alpha1*255/dest_alpha; |
431 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blu
e, alpha_ratio); | 431 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blu
e, alpha_ratio); |
432 dest_scan ++; | 432 dest_scan ++; |
433 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gre
en, alpha_ratio); | 433 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gre
en, alpha_ratio); |
434 dest_scan ++; | 434 dest_scan ++; |
435 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red
, alpha_ratio); | 435 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red
, alpha_ratio); |
436 dest_scan += 2; | 436 dest_scan += 2; |
437 } | 437 } |
438 } | 438 } |
(...skipping 13 matching lines...) Expand all Loading... |
452 // Dest format: Argb | 452 // Dest format: Argb |
453 // calculate destination alpha (it's uni
on of source and dest alpha) | 453 // calculate destination alpha (it's uni
on of source and dest alpha) |
454 if (dest_scan[3] == 0) { | 454 if (dest_scan[3] == 0) { |
455 dest_scan[3] = src_alpha; | 455 dest_scan[3] = src_alpha; |
456 *dest_scan++ = m_Blue; | 456 *dest_scan++ = m_Blue; |
457 *dest_scan++ = m_Green; | 457 *dest_scan++ = m_Green; |
458 *dest_scan = m_Red; | 458 *dest_scan = m_Red; |
459 dest_scan += 2; | 459 dest_scan += 2; |
460 continue; | 460 continue; |
461 } | 461 } |
462 » » » » » FX_BYTE dest_alpha = dest_scan[3] + src_
alpha - dest_scan[3] * src_alpha / 255; | 462 » » » » » uint8_t dest_alpha = dest_scan[3] + src_
alpha - dest_scan[3] * src_alpha / 255; |
463 dest_scan[3] = dest_alpha; | 463 dest_scan[3] = dest_alpha; |
464 int alpha_ratio = src_alpha*255/dest_alp
ha; | 464 int alpha_ratio = src_alpha*255/dest_alp
ha; |
465 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Blue, alpha_ratio); | 465 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Blue, alpha_ratio); |
466 dest_scan ++; | 466 dest_scan ++; |
467 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, alpha_ratio); | 467 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, alpha_ratio); |
468 dest_scan ++; | 468 dest_scan ++; |
469 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, alpha_ratio); | 469 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, alpha_ratio); |
470 dest_scan += 2; | 470 dest_scan += 2; |
471 } | 471 } |
472 } | 472 } |
(...skipping 12 matching lines...) Expand all Loading... |
485 // Dest format: Argb | 485 // Dest format: Argb |
486 // calculate destination alpha (it's uni
on of source and dest alpha) | 486 // calculate destination alpha (it's uni
on of source and dest alpha) |
487 if (dest_scan[3] == 0) { | 487 if (dest_scan[3] == 0) { |
488 dest_scan[3] = src_alpha1; | 488 dest_scan[3] = src_alpha1; |
489 *dest_scan++ = m_Blue; | 489 *dest_scan++ = m_Blue; |
490 *dest_scan++ = m_Green; | 490 *dest_scan++ = m_Green; |
491 *dest_scan = m_Red; | 491 *dest_scan = m_Red; |
492 dest_scan += 2; | 492 dest_scan += 2; |
493 continue; | 493 continue; |
494 } | 494 } |
495 » » » » » FX_BYTE dest_alpha = dest_scan[3] + src_
alpha1 - dest_scan[3] * src_alpha1 / 255; | 495 » » » » » uint8_t dest_alpha = dest_scan[3] + src_
alpha1 - dest_scan[3] * src_alpha1 / 255; |
496 dest_scan[3] = dest_alpha; | 496 dest_scan[3] = dest_alpha; |
497 int alpha_ratio = src_alpha1*255/dest_al
pha; | 497 int alpha_ratio = src_alpha1*255/dest_al
pha; |
498 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Blue, alpha_ratio); | 498 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Blue, alpha_ratio); |
499 dest_scan ++; | 499 dest_scan ++; |
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(FX_LPBYTE dest_scan, FX_LPBYT
E ori_scan,int Bpp, |
511 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
513 FX_LPBYTE dest_extra_alpha_scan) | 513 FX_LPBYTE dest_extra_alpha_scan) |
514 { | 514 { |
515 ASSERT(!m_pDevice->IsCmykImage()); | 515 ASSERT(!m_pDevice->IsCmykImage()); |
516 » » dest_scan = (FX_BYTE*)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 = (FX_BYTE*)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 = (FX_BYTE*)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; |
524 // Do not need origin bitmap, because of merge in pure transpare
nt background | 524 // Do not need origin bitmap, because of merge in pure transpare
nt background |
525 for (int col = col_start; col < col_end; col ++) | 525 for (int col = col_start; col < col_end; col ++) |
526 { | 526 { |
527 int src_alpha = m_Alpha * clip_scan[col] / 255; | 527 int src_alpha = m_Alpha * clip_scan[col] / 255; |
528 int src_alpha_covered = src_alpha * cover_scan / 255; | 528 int src_alpha_covered = src_alpha * cover_scan / 255; |
(...skipping 22 matching lines...) Expand all Loading... |
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(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, |
561 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
563 FX_LPBYTE dest_extra_alpha_scan) | 563 FX_LPBYTE dest_extra_alpha_scan) |
564 { | 564 { |
565 » » dest_scan = (FX_BYTE*)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(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, |
592 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
594 FX_LPBYTE dest_extra_alpha_scan) | 594 FX_LPBYTE dest_extra_alpha_scan) |
595 { | 595 { |
596 » » dest_scan = (FX_BYTE*)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 = (FX_BYTE*)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); |
605 return; | 605 return; |
606 } | 606 } |
607 int src_alpha = m_Alpha; | 607 int src_alpha = m_Alpha; |
(...skipping 13 matching lines...) Expand all Loading... |
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(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, |
631 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
633 FX_LPBYTE dest_extra_alpha_scan) | 633 FX_LPBYTE dest_extra_alpha_scan) |
634 { | 634 { |
635 » » dest_scan = (FX_BYTE*)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 = (FX_BYTE*)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 ++) { |
644 int src_alpha1 = src_alpha * clip_scan[col] / 255; | 644 int src_alpha1 = src_alpha * clip_scan[col] / 255; |
645 if (!src_alpha1) { | 645 if (!src_alpha1) { |
646 dest_scan += 4; | 646 dest_scan += 4; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, |
709 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
711 FX_LPBYTE dest_extra_alpha_scan) | 711 FX_LPBYTE dest_extra_alpha_scan) |
712 { | 712 { |
713 ASSERT(!m_pDevice->IsCmykImage()); | 713 ASSERT(!m_pDevice->IsCmykImage()); |
714 » » dest_scan = (FX_BYTE*)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 = (FX_BYTE*)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 = (FX_BYTE*)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; |
722 #if 1 | 722 #if 1 |
723 for (int col = col_start; col < col_end; col ++) { | 723 for (int col = col_start; col < col_end; col ++) { |
724 int src_alpha = m_Alpha * clip_scan[col] / 255; | 724 int src_alpha = m_Alpha * clip_scan[col] / 255; |
725 if (src_alpha == 255 && cover_scan == 255) { | 725 if (src_alpha == 255 && cover_scan == 255) { |
726 *(FX_DWORD*)dest_scan = m_Color; | 726 *(FX_DWORD*)dest_scan = m_Color; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, |
788 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
790 FX_LPBYTE dest_extra_alpha_scan) | 790 FX_LPBYTE dest_extra_alpha_scan) |
791 { | 791 { |
792 » » dest_scan = (FX_BYTE*)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; |
801 else | 801 else |
802 #endif | 802 #endif |
803 src_alpha = m_Alpha * cover_scan / 255; | 803 src_alpha = m_Alpha * cover_scan / 255; |
804 if (src_alpha == 255) { | 804 if (src_alpha == 255) { |
805 for (int col = col_start; col < col_end; col ++) { | 805 for (int col = col_start; col < col_end; col ++) { |
806 *dest_scan++ = m_Blue; | 806 *dest_scan++ = m_Blue; |
807 *dest_scan++ = m_Green; | 807 *dest_scan++ = m_Green; |
808 *dest_scan++ = m_Red; | 808 *dest_scan++ = m_Red; |
809 } | 809 } |
810 return; | 810 return; |
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(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, |
822 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
824 FX_LPBYTE dest_extra_alpha_scan) | 824 FX_LPBYTE dest_extra_alpha_scan) |
825 { | 825 { |
826 ASSERT(!m_pDevice->IsCmykImage()); | 826 ASSERT(!m_pDevice->IsCmykImage()); |
827 » » dest_scan = (FX_BYTE*)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 = (FX_BYTE*)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) { |
835 for (int col = col_start; col < col_end; col ++) { | 835 for (int col = col_start; col < col_end; col ++) { |
836 *dest_scan ++ = m_Blue; | 836 *dest_scan ++ = m_Blue; |
837 *dest_scan ++ = m_Green; | 837 *dest_scan ++ = m_Green; |
838 *dest_scan ++ = m_Red; | 838 *dest_scan ++ = m_Red; |
(...skipping 14 matching lines...) Expand all Loading... |
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(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, |
863 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
865 FX_LPBYTE dest_extra_alpha_scan) | 865 FX_LPBYTE dest_extra_alpha_scan) |
866 { | 866 { |
867 » » dest_scan = (FX_BYTE*)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 = (FX_BYTE*)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 ++) { |
876 int src_alpha1 = src_alpha * clip_scan[col] / 255; | 876 int src_alpha1 = src_alpha * clip_scan[col] / 255; |
877 if (!src_alpha1) { | 877 if (!src_alpha1) { |
878 dest_scan += 3; | 878 dest_scan += 3; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(FX_LPBYTE dest_scan, FX_LPBY
TE ori_scan,int Bpp, |
943 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
945 FX_LPBYTE dest_extra_alpha_scan) | 945 FX_LPBYTE dest_extra_alpha_scan) |
946 { | 946 { |
947 ASSERT(!m_pDevice->IsCmykImage()); | 947 ASSERT(!m_pDevice->IsCmykImage()); |
948 » » dest_scan = (FX_BYTE*)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 = (FX_BYTE*)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 = (FX_BYTE*)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); |
956 #if 1 | 956 #if 1 |
957 for (int col = col_start; col < col_end; col ++) { | 957 for (int col = col_start; col < col_end; col ++) { |
958 int src_alpha = m_Alpha * clip_scan[col] / 255; | 958 int src_alpha = m_Alpha * clip_scan[col] / 255; |
959 if (src_alpha == 255 && cover_scan == 255) { | 959 if (src_alpha == 255 && cover_scan == 255) { |
960 *dest_scan++ = m_Blue; | 960 *dest_scan++ = m_Blue; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(FX_LPBYTE dest_scan, FX_LPB
YTE ori_scan,int Bpp, |
1021 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
1023 FX_LPBYTE dest_extra_alpha_scan) | 1023 FX_LPBYTE dest_extra_alpha_scan) |
1024 { | 1024 { |
1025 » » dest_scan = (FX_BYTE*)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 = (FX_BYTE*)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 ++) { |
1034 » » » » *dest_scan++ = (FX_BYTE)m_Blue; | 1034 » » » » *dest_scan++ = (uint8_t)m_Blue; |
1035 » » » » *dest_scan++ = (FX_BYTE)m_Green; | 1035 » » » » *dest_scan++ = (uint8_t)m_Green; |
1036 » » » » *dest_scan++ = (FX_BYTE)m_Red; | 1036 » » » » *dest_scan++ = (uint8_t)m_Red; |
1037 *dest_extra_alpha_scan++ = 255; | 1037 *dest_extra_alpha_scan++ = 255; |
1038 } | 1038 } |
1039 return; | 1039 return; |
1040 } | 1040 } |
1041 int src_alpha = m_Alpha * cover_scan / 255; | 1041 int src_alpha = m_Alpha * cover_scan / 255; |
1042 for (int col = col_start; col < col_end; col ++) { | 1042 for (int col = col_start; col < col_end; col ++) { |
1043 // Dest format: Rgba | 1043 // Dest format: Rgba |
1044 // calculate destination alpha (it's union of source and
dest alpha) | 1044 // calculate destination alpha (it's union of source and
dest alpha) |
1045 » » » FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alph
a - | 1045 » » » uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alph
a - |
1046 (*dest_extra_alp
ha_scan) * src_alpha / 255; | 1046 (*dest_extra_alp
ha_scan) * src_alpha / 255; |
1047 *dest_extra_alpha_scan++ = dest_alpha; | 1047 *dest_extra_alpha_scan++ = dest_alpha; |
1048 int alpha_ratio = src_alpha*255/dest_alpha; | 1048 int alpha_ratio = src_alpha*255/dest_alpha; |
1049 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha
_ratio); | 1049 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha
_ratio); |
1050 dest_scan ++; | 1050 dest_scan ++; |
1051 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, alph
a_ratio); | 1051 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Green, alph
a_ratio); |
1052 dest_scan ++; | 1052 dest_scan ++; |
1053 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, alpha_
ratio); | 1053 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, alpha_
ratio); |
1054 dest_scan ++; | 1054 dest_scan ++; |
1055 } | 1055 } |
1056 #else | 1056 #else |
1057 if (m_bFullCover) { | 1057 if (m_bFullCover) { |
1058 if (m_Alpha == 255) { | 1058 if (m_Alpha == 255) { |
1059 for (int col = col_start; col < col_end; col ++)
{ | 1059 for (int col = col_start; col < col_end; col ++)
{ |
1060 » » » » » *dest_scan++ = (FX_BYTE)m_Blue; | 1060 » » » » » *dest_scan++ = (uint8_t)m_Blue; |
1061 » » » » » *dest_scan++ = (FX_BYTE)m_Green; | 1061 » » » » » *dest_scan++ = (uint8_t)m_Green; |
1062 » » » » » *dest_scan++ = (FX_BYTE)m_Red; | 1062 » » » » » *dest_scan++ = (uint8_t)m_Red; |
1063 *dest_extra_alpha_scan++ = 255; | 1063 *dest_extra_alpha_scan++ = 255; |
1064 } | 1064 } |
1065 return; | 1065 return; |
1066 } | 1066 } |
1067 for (int col = col_start; col < col_end; col ++) { | 1067 for (int col = col_start; col < col_end; col ++) { |
1068 // Dest format: Rgba | 1068 // Dest format: Rgba |
1069 // calculate destination alpha (it's union of so
urce and dest alpha) | 1069 // calculate destination alpha (it's union of so
urce and dest alpha) |
1070 » » » » FX_BYTE dest_alpha = (*dest_extra_alpha_scan) +
m_Alpha - | 1070 » » » » uint8_t dest_alpha = (*dest_extra_alpha_scan) +
m_Alpha - |
1071 (*dest_e
xtra_alpha_scan) * m_Alpha / 255; | 1071 (*dest_e
xtra_alpha_scan) * m_Alpha / 255; |
1072 *dest_extra_alpha_scan++ = dest_alpha; | 1072 *dest_extra_alpha_scan++ = dest_alpha; |
1073 int alpha_ratio = m_Alpha*255/dest_alpha; | 1073 int alpha_ratio = m_Alpha*255/dest_alpha; |
1074 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blu
e, alpha_ratio); | 1074 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blu
e, alpha_ratio); |
1075 dest_scan ++; | 1075 dest_scan ++; |
1076 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gre
en, alpha_ratio); | 1076 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gre
en, alpha_ratio); |
1077 dest_scan ++; | 1077 dest_scan ++; |
1078 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red
, alpha_ratio); | 1078 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red
, alpha_ratio); |
1079 dest_scan ++; | 1079 dest_scan ++; |
1080 } | 1080 } |
1081 } else { | 1081 } else { |
1082 if (m_Alpha == 255 && cover_scan == 255) { | 1082 if (m_Alpha == 255 && cover_scan == 255) { |
1083 for (int col = col_start; col < col_end; col ++)
{ | 1083 for (int col = col_start; col < col_end; col ++)
{ |
1084 » » » » » *dest_scan++ = (FX_BYTE)m_Blue; | 1084 » » » » » *dest_scan++ = (uint8_t)m_Blue; |
1085 » » » » » *dest_scan++ = (FX_BYTE)m_Green; | 1085 » » » » » *dest_scan++ = (uint8_t)m_Green; |
1086 » » » » » *dest_scan++ = (FX_BYTE)m_Red; | 1086 » » » » » *dest_scan++ = (uint8_t)m_Red; |
1087 *dest_extra_alpha_scan++ = 255; | 1087 *dest_extra_alpha_scan++ = 255; |
1088 } | 1088 } |
1089 return; | 1089 return; |
1090 } | 1090 } |
1091 int src_alpha = m_Alpha * cover_scan / 255; | 1091 int src_alpha = m_Alpha * cover_scan / 255; |
1092 for (int col = col_start; col < col_end; col ++) { | 1092 for (int col = col_start; col < col_end; col ++) { |
1093 // Dest format: Rgba | 1093 // Dest format: Rgba |
1094 // calculate destination alpha (it's union of so
urce and dest alpha) | 1094 // calculate destination alpha (it's union of so
urce and dest alpha) |
1095 » » » » FX_BYTE dest_alpha = (*dest_extra_alpha_scan) +
src_alpha - | 1095 » » » » uint8_t dest_alpha = (*dest_extra_alpha_scan) +
src_alpha - |
1096 (*dest_e
xtra_alpha_scan) * src_alpha / 255; | 1096 (*dest_e
xtra_alpha_scan) * src_alpha / 255; |
1097 *dest_extra_alpha_scan++ = dest_alpha; | 1097 *dest_extra_alpha_scan++ = dest_alpha; |
1098 int alpha_ratio = src_alpha*255/dest_alpha; | 1098 int alpha_ratio = src_alpha*255/dest_alpha; |
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(FX_LPBYTE dest_scan, FX_LPB
YTE ori_scan,int Bpp, |
1110 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
1112 FX_LPBYTE dest_extra_alpha_scan) | 1112 FX_LPBYTE dest_extra_alpha_scan) |
1113 { | 1113 { |
1114 » » dest_scan = (FX_BYTE*)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 = (FX_BYTE*)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 = (FX_BYTE*)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; |
1123 for (int col = col_start; col < col_end; col ++) { | 1123 for (int col = col_start; col < col_end; col ++) { |
1124 int src_alpha1 = src_alpha * clip_scan[col] / 255; | 1124 int src_alpha1 = src_alpha * clip_scan[col] / 255; |
1125 if (!src_alpha1) { | 1125 if (!src_alpha1) { |
1126 dest_extra_alpha_scan++; | 1126 dest_extra_alpha_scan++; |
1127 dest_scan += 3; | 1127 dest_scan += 3; |
1128 continue; | 1128 continue; |
1129 } | 1129 } |
1130 if (src_alpha1 == 255) { | 1130 if (src_alpha1 == 255) { |
1131 » » » » *dest_scan++ = (FX_BYTE)m_Blue; | 1131 » » » » *dest_scan++ = (uint8_t)m_Blue; |
1132 » » » » *dest_scan++ = (FX_BYTE)m_Green; | 1132 » » » » *dest_scan++ = (uint8_t)m_Green; |
1133 » » » » *dest_scan++ = (FX_BYTE)m_Red; | 1133 » » » » *dest_scan++ = (uint8_t)m_Red; |
1134 » » » » *dest_extra_alpha_scan++ = (FX_BYTE)m_Alpha; | 1134 » » » » *dest_extra_alpha_scan++ = (uint8_t)m_Alpha; |
1135 } else { | 1135 } else { |
1136 // Dest format: Rgba | 1136 // Dest format: Rgba |
1137 // calculate destination alpha (it's union of so
urce and dest alpha) | 1137 // calculate destination alpha (it's union of so
urce and dest alpha) |
1138 » » » » FX_BYTE dest_alpha = (*dest_extra_alpha_scan) +
src_alpha1 - | 1138 » » » » uint8_t dest_alpha = (*dest_extra_alpha_scan) +
src_alpha1 - |
1139 (*dest_e
xtra_alpha_scan) * src_alpha1 / 255; | 1139 (*dest_e
xtra_alpha_scan) * src_alpha1 / 255; |
1140 *dest_extra_alpha_scan++ = dest_alpha; | 1140 *dest_extra_alpha_scan++ = dest_alpha; |
1141 int alpha_ratio = src_alpha1*255/dest_alpha; | 1141 int alpha_ratio = src_alpha1*255/dest_alpha; |
1142 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blu
e, alpha_ratio); | 1142 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blu
e, alpha_ratio); |
1143 dest_scan ++; | 1143 dest_scan ++; |
1144 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gre
en, alpha_ratio); | 1144 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Gre
en, alpha_ratio); |
1145 dest_scan ++; | 1145 dest_scan ++; |
1146 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red
, alpha_ratio); | 1146 *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red
, alpha_ratio); |
1147 dest_scan ++; | 1147 dest_scan ++; |
1148 } | 1148 } |
1149 } | 1149 } |
1150 #else | 1150 #else |
1151 if (m_bFullCover) { | 1151 if (m_bFullCover) { |
1152 for (int col = col_start; col < col_end; col ++) { | 1152 for (int col = col_start; col < col_end; col ++) { |
1153 int src_alpha = m_Alpha * clip_scan[col] / 255; | 1153 int src_alpha = m_Alpha * clip_scan[col] / 255; |
1154 if (!src_alpha) { | 1154 if (!src_alpha) { |
1155 dest_extra_alpha_scan++; | 1155 dest_extra_alpha_scan++; |
1156 dest_scan += 3; | 1156 dest_scan += 3; |
1157 continue; | 1157 continue; |
1158 } | 1158 } |
1159 if (src_alpha == 255) { | 1159 if (src_alpha == 255) { |
1160 » » » » » *dest_scan++ = (FX_BYTE)m_Blue; | 1160 » » » » » *dest_scan++ = (uint8_t)m_Blue; |
1161 » » » » » *dest_scan++ = (FX_BYTE)m_Green; | 1161 » » » » » *dest_scan++ = (uint8_t)m_Green; |
1162 » » » » » *dest_scan++ = (FX_BYTE)m_Red; | 1162 » » » » » *dest_scan++ = (uint8_t)m_Red; |
1163 » » » » » *dest_extra_alpha_scan++ = (FX_BYTE)m_Al
pha; | 1163 » » » » » *dest_extra_alpha_scan++ = (uint8_t)m_Al
pha; |
1164 } else { | 1164 } else { |
1165 // Dest format: Rgba | 1165 // Dest format: Rgba |
1166 // calculate destination alpha (it's uni
on of source and dest alpha) | 1166 // calculate destination alpha (it's uni
on of source and dest alpha) |
1167 » » » » » FX_BYTE dest_alpha = (*dest_extra_alpha_
scan) + src_alpha - | 1167 » » » » » uint8_t dest_alpha = (*dest_extra_alpha_
scan) + src_alpha - |
1168
(*dest_extra_alpha_scan) * src_alpha / 255; | 1168
(*dest_extra_alpha_scan) * src_alpha / 255; |
1169 *dest_extra_alpha_scan++ = dest_alpha; | 1169 *dest_extra_alpha_scan++ = dest_alpha; |
1170 int alpha_ratio = src_alpha*255/dest_alp
ha; | 1170 int alpha_ratio = src_alpha*255/dest_alp
ha; |
1171 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Blue, alpha_ratio); | 1171 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Blue, alpha_ratio); |
1172 dest_scan ++; | 1172 dest_scan ++; |
1173 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, alpha_ratio); | 1173 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, alpha_ratio); |
1174 dest_scan ++; | 1174 dest_scan ++; |
1175 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, alpha_ratio); | 1175 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Red, alpha_ratio); |
1176 dest_scan ++; | 1176 dest_scan ++; |
1177 } | 1177 } |
1178 } | 1178 } |
1179 } else { | 1179 } else { |
1180 int src_alpha = m_Alpha * cover_scan / 255; | 1180 int src_alpha = m_Alpha * cover_scan / 255; |
1181 for (int col = col_start; col < col_end; col ++) { | 1181 for (int col = col_start; col < col_end; col ++) { |
1182 int src_alpha1 = m_Alpha * cover_scan * clip_sca
n[col] / 255; | 1182 int src_alpha1 = m_Alpha * cover_scan * clip_sca
n[col] / 255; |
1183 if (!src_alpha1) { | 1183 if (!src_alpha1) { |
1184 dest_extra_alpha_scan++; | 1184 dest_extra_alpha_scan++; |
1185 dest_scan += 3; | 1185 dest_scan += 3; |
1186 continue; | 1186 continue; |
1187 } | 1187 } |
1188 if (src_alpha1 == 255) { | 1188 if (src_alpha1 == 255) { |
1189 » » » » » *dest_scan++ = (FX_BYTE)m_Blue; | 1189 » » » » » *dest_scan++ = (uint8_t)m_Blue; |
1190 » » » » » *dest_scan++ = (FX_BYTE)m_Green; | 1190 » » » » » *dest_scan++ = (uint8_t)m_Green; |
1191 » » » » » *dest_scan++ = (FX_BYTE)m_Red; | 1191 » » » » » *dest_scan++ = (uint8_t)m_Red; |
1192 » » » » » *dest_extra_alpha_scan++ = (FX_BYTE)m_Al
pha; | 1192 » » » » » *dest_extra_alpha_scan++ = (uint8_t)m_Al
pha; |
1193 } else { | 1193 } else { |
1194 // Dest format: Rgba | 1194 // Dest format: Rgba |
1195 // calculate destination alpha (it's uni
on of source and dest alpha) | 1195 // calculate destination alpha (it's uni
on of source and dest alpha) |
1196 » » » » » FX_BYTE dest_alpha = (*dest_extra_alpha_
scan) + src_alpha1 - | 1196 » » » » » uint8_t dest_alpha = (*dest_extra_alpha_
scan) + src_alpha1 - |
1197
(*dest_extra_alpha_scan) * src_alpha1 / 255; | 1197
(*dest_extra_alpha_scan) * src_alpha1 / 255; |
1198 *dest_extra_alpha_scan++ = dest_alpha; | 1198 *dest_extra_alpha_scan++ = dest_alpha; |
1199 int alpha_ratio = src_alpha1*255/dest_al
pha; | 1199 int alpha_ratio = src_alpha1*255/dest_al
pha; |
1200 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Blue, alpha_ratio); | 1200 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Blue, alpha_ratio); |
1201 dest_scan ++; | 1201 dest_scan ++; |
1202 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, alpha_ratio); | 1202 *dest_scan = FXDIB_ALPHA_MERGE(*dest_sca
n, m_Green, alpha_ratio); |
1203 dest_scan ++; | 1203 dest_scan ++; |
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(FX_LPBYTE dest_scan, FX_LPBYTE
ori_scan,int Bpp, |
1215 » » » int span_left, int span_len, int span_top, FX_BYTE 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, FX_LPBYTE c
lip_scan, |
1217 FX_LPBYTE dest_extra_alpha_scan) | 1217 FX_LPBYTE 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. |
(...skipping 10 matching lines...) Expand all Loading... |
1236 } else { | 1236 } else { |
1237 if (clip_scan) | 1237 if (clip_scan) |
1238 src_alpha = m_Alpha * cover_scan
* clip_scan[col] / 255 / 255; | 1238 src_alpha = m_Alpha * cover_scan
* clip_scan[col] / 255 / 255; |
1239 else | 1239 else |
1240 src_alpha = m_Alpha * cover_scan
/ 255; | 1240 src_alpha = m_Alpha * cover_scan
/ 255; |
1241 } | 1241 } |
1242 | 1242 |
1243 if (src_alpha) { | 1243 if (src_alpha) { |
1244 if (src_alpha == 255) { | 1244 if (src_alpha == 255) { |
1245 *(FX_CMYK*)dest_scan = m_Color; | 1245 *(FX_CMYK*)dest_scan = m_Color; |
1246 » » » » » » *dest_extra_alpha_scan = (FX_BYT
E)m_Alpha; | 1246 » » » » » » *dest_extra_alpha_scan = (uint8_
t)m_Alpha; |
1247 } else { | 1247 } else { |
1248 // Dest format: Cmyka | 1248 // Dest format: Cmyka |
1249 // calculate destination alpha (
it's union of source and dest alpha) | 1249 // calculate destination alpha (
it's union of source and dest alpha) |
1250 » » » » » » FX_BYTE dest_alpha = (*dest_extr
a_alpha_scan) + src_alpha - | 1250 » » » » » » uint8_t dest_alpha = (*dest_extr
a_alpha_scan) + src_alpha - |
1251 (*dest_extra_alpha_scan)
* src_alpha / 255; | 1251 (*dest_extra_alpha_scan)
* src_alpha / 255; |
1252 *dest_extra_alpha_scan++ = dest_
alpha; | 1252 *dest_extra_alpha_scan++ = dest_
alpha; |
1253 int alpha_ratio = src_alpha*255/
dest_alpha; | 1253 int alpha_ratio = src_alpha*255/
dest_alpha; |
1254 *dest_scan = FXDIB_ALPHA_MERGE(*
dest_scan, m_Red, alpha_ratio); | 1254 *dest_scan = FXDIB_ALPHA_MERGE(*
dest_scan, m_Red, alpha_ratio); |
1255 dest_scan ++; | 1255 dest_scan ++; |
1256 *dest_scan = FXDIB_ALPHA_MERGE(*
dest_scan, m_Green, alpha_ratio); | 1256 *dest_scan = FXDIB_ALPHA_MERGE(*
dest_scan, m_Green, alpha_ratio); |
1257 dest_scan ++; | 1257 dest_scan ++; |
1258 *dest_scan = FXDIB_ALPHA_MERGE(*
dest_scan, m_Blue, alpha_ratio); | 1258 *dest_scan = FXDIB_ALPHA_MERGE(*
dest_scan, m_Blue, alpha_ratio); |
1259 dest_scan ++; | 1259 dest_scan ++; |
1260 *dest_scan = FXDIB_ALPHA_MERGE(*
dest_scan, m_Gray, alpha_ratio); | 1260 *dest_scan = FXDIB_ALPHA_MERGE(*
dest_scan, m_Gray, alpha_ratio); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetI
ccModule(); | 1344 pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetI
ccModule(); |
1345 | 1345 |
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 » » » » » FX_BYTE 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, (FX_LPCBYTE)&color, 1); |
1357 m_Gray = gray; | 1357 m_Gray = gray; |
1358 } else { | 1358 } else { |
1359 if (bObjectCMYK) { | 1359 if (bObjectCMYK) { |
1360 » » » » » » FX_BYTE 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 |
(...skipping 26 matching lines...) Expand all Loading... |
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 = ((FX_LPBYTE)&m_Color)[0]
; |
1401 m_Blue = ((FX_LPBYTE)&m_Color)[2
]; | 1401 m_Blue = ((FX_LPBYTE)&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 » » » » » » FX_BYTE 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){ |
1412 m_Color = FXARGB_TOBGROR
DERDIB(m_Color); | 1412 m_Color = FXARGB_TOBGROR
DERDIB(m_Color); |
1413 m_Red = b; m_Green = g;
m_Blue = r;// | 1413 m_Red = b; m_Green = g;
m_Blue = r;// |
1414 }else { | 1414 }else { |
1415 m_Color = FXARGB_TODIB(m
_Color); | 1415 m_Color = FXARGB_TODIB(m
_Color); |
1416 m_Red = r; m_Green = g;
m_Blue = b;// | 1416 m_Red = r; m_Green = g;
m_Blue = b;// |
1417 } | 1417 } |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 FX_LPBYTE dest_scan = m_pDevice->GetBuffer() + m_pDevice->GetPit
ch() * 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 » » » FX_BYTE* 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); |
1560 } | 1560 } |
1561 } | 1561 } |
1562 void CFX_SkiaA8Renderer::blitV(int x, int y, int height, SkAlpha alpha) | 1562 void CFX_SkiaA8Renderer::blitV(int x, int y, int height, SkAlpha alpha) |
1563 { | 1563 { |
1564 FXSYS_assert(alpha); | 1564 FXSYS_assert(alpha); |
1565 if (alpha == 255) { | 1565 if (alpha == 255) { |
(...skipping 35 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 |