File: | jdk/src/java.desktop/share/native/libawt/java2d/loops/UshortIndexed.c |
Warning: | line 199, column 10 Value stored to 'srcScan' during its initialization is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* |
2 | * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. |
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | * |
5 | * This code is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 only, as |
7 | * published by the Free Software Foundation. Oracle designates this |
8 | * particular file as subject to the "Classpath" exception as provided |
9 | * by Oracle in the LICENSE file that accompanied this code. |
10 | * |
11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
14 | * version 2 for more details (a copy is included in the LICENSE file that |
15 | * accompanied this code). |
16 | * |
17 | * You should have received a copy of the GNU General Public License version |
18 | * 2 along with this work; if not, write to the Free Software Foundation, |
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
20 | * |
21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 | * or visit www.oracle.com if you need additional information or have any |
23 | * questions. |
24 | */ |
25 | |
26 | #include <string.h> |
27 | |
28 | #include "AnyByte.h" |
29 | #include "UshortIndexed.h" |
30 | #include "AlphaMacros.h" |
31 | |
32 | #include "IntArgb.h" |
33 | #include "IntArgbBm.h" |
34 | #include "IntArgbPre.h" |
35 | #include "IntRgb.h" |
36 | #include "ThreeByteBgr.h" |
37 | #include "ByteGray.h" |
38 | #include "Index12Gray.h" |
39 | |
40 | /* |
41 | * This file declares, registers, and defines the various graphics |
42 | * primitive loops to manipulate surfaces of type "UshortIndexed". |
43 | * |
44 | * See also LoopMacros.h |
45 | */ |
46 | |
47 | RegisterFunc RegisterUshortIndexed; |
48 | |
49 | DECLARE_CONVERT_BLIT(IntArgb, UshortIndexed)BlitFunc IntArgbToUshortIndexedConvert; |
50 | DECLARE_CONVERT_BLIT(ThreeByteBgr, UshortIndexed)BlitFunc ThreeByteBgrToUshortIndexedConvert; |
51 | DECLARE_CONVERT_BLIT(ByteGray, UshortIndexed)BlitFunc ByteGrayToUshortIndexedConvert; |
52 | DECLARE_CONVERT_BLIT(UshortIndexed, UshortIndexed)BlitFunc UshortIndexedToUshortIndexedConvert; |
53 | DECLARE_CONVERT_BLIT(Index12Gray, UshortIndexed)BlitFunc Index12GrayToUshortIndexedConvert; |
54 | DECLARE_CONVERT_BLIT(UshortIndexed, IntArgb)BlitFunc UshortIndexedToIntArgbConvert; |
55 | DECLARE_SCALE_BLIT(IntArgb, UshortIndexed)ScaleBlitFunc IntArgbToUshortIndexedScaleConvert; |
56 | DECLARE_SCALE_BLIT(ThreeByteBgr, UshortIndexed)ScaleBlitFunc ThreeByteBgrToUshortIndexedScaleConvert; |
57 | DECLARE_SCALE_BLIT(ByteGray, UshortIndexed)ScaleBlitFunc ByteGrayToUshortIndexedScaleConvert; |
58 | DECLARE_SCALE_BLIT(Index12Gray, UshortIndexed)ScaleBlitFunc Index12GrayToUshortIndexedScaleConvert; |
59 | DECLARE_SCALE_BLIT(UshortIndexed, UshortIndexed)ScaleBlitFunc UshortIndexedToUshortIndexedScaleConvert; |
60 | DECLARE_SCALE_BLIT(UshortIndexed, IntArgb)ScaleBlitFunc UshortIndexedToIntArgbScaleConvert; |
61 | DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, UshortIndexed)BlitFunc ByteIndexedBmToUshortIndexedXparOver; |
62 | DECLARE_XPAR_SCALE_BLIT(ByteIndexedBm, UshortIndexed)ScaleBlitFunc ByteIndexedBmToUshortIndexedScaleXparOver; |
63 | DECLARE_XPAR_SCALE_BLIT(IntArgbBm, UshortIndexed)ScaleBlitFunc IntArgbBmToUshortIndexedScaleXparOver; |
64 | DECLARE_XPAR_BLITBG(ByteIndexedBm, UshortIndexed)BlitBgFunc ByteIndexedBmToUshortIndexedXparBgCopy; |
65 | DECLARE_XPAR_CONVERT_BLIT(IntArgbBm, UshortIndexed)BlitFunc IntArgbBmToUshortIndexedXparOver; |
66 | DECLARE_XPAR_BLITBG(IntArgbBm, UshortIndexed)BlitBgFunc IntArgbBmToUshortIndexedXparBgCopy; |
67 | |
68 | DECLARE_XOR_BLIT(IntArgb, UshortIndexed)BlitFunc IntArgbToUshortIndexedXorBlit; |
69 | DECLARE_ALPHA_MASKFILL(UshortIndexed)MaskFillFunc UshortIndexedAlphaMaskFill; |
70 | DECLARE_ALPHA_MASKBLIT(IntArgb, UshortIndexed)MaskBlitFunc IntArgbToUshortIndexedAlphaMaskBlit; |
71 | DECLARE_ALPHA_MASKBLIT(IntArgbPre, UshortIndexed)MaskBlitFunc IntArgbPreToUshortIndexedAlphaMaskBlit; |
72 | DECLARE_ALPHA_MASKBLIT(IntRgb, UshortIndexed)MaskBlitFunc IntRgbToUshortIndexedAlphaMaskBlit; |
73 | DECLARE_SOLID_DRAWGLYPHLISTAA(UshortIndexed)DrawGlyphListAAFunc UshortIndexedDrawGlyphListAA; |
74 | |
75 | NativePrimitive UshortIndexedPrimitives[] = { |
76 | REGISTER_CONVERT_BLIT(IntArgb, UshortIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed, {IntArgbToUshortIndexedConvert }, {IntArgbToUshortIndexedConvert}, 0, 0 }, |
77 | REGISTER_CONVERT_BLIT_EQUIV(IntRgb, UshortIndexed,{ & PrimitiveTypes.Blit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed, {IntArgbToUshortIndexedConvert }, {IntArgbToUshortIndexedConvert}, 0, 0 } |
78 | NAME_CONVERT_BLIT(IntArgb, UshortIndexed)){ & PrimitiveTypes.Blit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed, {IntArgbToUshortIndexedConvert }, {IntArgbToUshortIndexedConvert}, 0, 0 }, |
79 | REGISTER_CONVERT_BLIT_EQUIV(IntArgbBm, UshortIndexed,{ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgbBm, & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed, {IntArgbToUshortIndexedConvert }, {IntArgbToUshortIndexedConvert}, 0, 0 } |
80 | NAME_CONVERT_BLIT(IntArgb, UshortIndexed)){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgbBm, & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed, {IntArgbToUshortIndexedConvert }, {IntArgbToUshortIndexedConvert}, 0, 0 }, |
81 | REGISTER_CONVERT_BLIT(ThreeByteBgr, UshortIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.ThreeByteBgr, & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {ThreeByteBgrToUshortIndexedConvert}, {ThreeByteBgrToUshortIndexedConvert }, 0, 0 }, |
82 | REGISTER_CONVERT_BLIT(ByteGray, UshortIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.ByteGray, & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed, {ByteGrayToUshortIndexedConvert }, {ByteGrayToUshortIndexedConvert}, 0, 0 }, |
83 | REGISTER_CONVERT_BLIT(Index12Gray, UshortIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.Index12Gray, & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed, {Index12GrayToUshortIndexedConvert }, {Index12GrayToUshortIndexedConvert}, 0, 0 }, |
84 | REGISTER_CONVERT_BLIT_FLAGS(UshortIndexed, UshortIndexed, 0, SD_LOCK_LUT){ & PrimitiveTypes.Blit, & SurfaceTypes.UshortIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {UshortIndexedToUshortIndexedConvert}, {UshortIndexedToUshortIndexedConvert }, 0, (1 << 2), }, |
85 | REGISTER_CONVERT_BLIT(UshortIndexed, IntArgb){ & PrimitiveTypes.Blit, & SurfaceTypes.UshortIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.IntArgb, { UshortIndexedToIntArgbConvert}, {UshortIndexedToIntArgbConvert }, 0, 0 }, |
86 | REGISTER_CONVERT_BLIT_EQUIV(UshortIndexed, IntRgb,{ & PrimitiveTypes.Blit, & SurfaceTypes.UshortIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.IntRgb, {UshortIndexedToIntArgbConvert }, {UshortIndexedToIntArgbConvert}, 0, 0 } |
87 | NAME_CONVERT_BLIT(UshortIndexed, IntArgb)){ & PrimitiveTypes.Blit, & SurfaceTypes.UshortIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.IntRgb, {UshortIndexedToIntArgbConvert }, {UshortIndexedToIntArgbConvert}, 0, 0 }, |
88 | REGISTER_SCALE_BLIT(IntArgb, UshortIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntArgb , & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {IntArgbToUshortIndexedScaleConvert}, {IntArgbToUshortIndexedScaleConvert }, 0, 0 }, |
89 | REGISTER_SCALE_BLIT_EQUIV(IntRgb, UshortIndexed,{ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {IntArgbToUshortIndexedScaleConvert}, {IntArgbToUshortIndexedScaleConvert }, 0, 0 } |
90 | NAME_SCALE_BLIT(IntArgb, UshortIndexed)){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {IntArgbToUshortIndexedScaleConvert}, {IntArgbToUshortIndexedScaleConvert }, 0, 0 }, |
91 | REGISTER_SCALE_BLIT_EQUIV(IntArgbBm, UshortIndexed,{ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntArgbBm , & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {IntArgbToUshortIndexedScaleConvert}, {IntArgbToUshortIndexedScaleConvert }, 0, 0 } |
92 | NAME_SCALE_BLIT(IntArgb, UshortIndexed)){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntArgbBm , & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {IntArgbToUshortIndexedScaleConvert}, {IntArgbToUshortIndexedScaleConvert }, 0, 0 }, |
93 | REGISTER_SCALE_BLIT(ThreeByteBgr, UshortIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ThreeByteBgr , & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {ThreeByteBgrToUshortIndexedScaleConvert}, {ThreeByteBgrToUshortIndexedScaleConvert }, 0, 0 }, |
94 | REGISTER_SCALE_BLIT(ByteGray, UshortIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ByteGray , & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {ByteGrayToUshortIndexedScaleConvert}, {ByteGrayToUshortIndexedScaleConvert }, 0, 0 }, |
95 | REGISTER_SCALE_BLIT(Index12Gray, UshortIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.Index12Gray , & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {Index12GrayToUshortIndexedScaleConvert}, {Index12GrayToUshortIndexedScaleConvert }, 0, 0 }, |
96 | REGISTER_SCALE_BLIT_FLAGS(UshortIndexed, UshortIndexed, 0, SD_LOCK_LUT){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.UshortIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {UshortIndexedToUshortIndexedScaleConvert}, {UshortIndexedToUshortIndexedScaleConvert }, 0, (1 << 2), }, |
97 | REGISTER_SCALE_BLIT(UshortIndexed, IntArgb){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.UshortIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.IntArgb, { UshortIndexedToIntArgbScaleConvert}, {UshortIndexedToIntArgbScaleConvert }, 0, 0 }, |
98 | REGISTER_SCALE_BLIT_EQUIV(UshortIndexed, IntRgb,{ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.UshortIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.IntRgb, {UshortIndexedToIntArgbScaleConvert }, {UshortIndexedToIntArgbScaleConvert}, 0, 0 } |
99 | NAME_SCALE_BLIT(UshortIndexed, IntArgb)){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.UshortIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.IntRgb, {UshortIndexedToIntArgbScaleConvert }, {UshortIndexedToIntArgbScaleConvert}, 0, 0 }, |
100 | REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, UshortIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.ByteIndexedBm , & CompositeTypes.SrcOverBmNoEa, & SurfaceTypes.UshortIndexed , {ByteIndexedBmToUshortIndexedXparOver}, {ByteIndexedBmToUshortIndexedXparOver }, 0, 0 }, |
101 | REGISTER_XPAR_SCALE_BLIT(ByteIndexedBm, UshortIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ByteIndexedBm , & CompositeTypes.SrcOverBmNoEa, & SurfaceTypes.UshortIndexed , {ByteIndexedBmToUshortIndexedScaleXparOver}, {ByteIndexedBmToUshortIndexedScaleXparOver }, 0, 0 }, |
102 | REGISTER_XPAR_SCALE_BLIT(IntArgbBm, UshortIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntArgbBm , & CompositeTypes.SrcOverBmNoEa, & SurfaceTypes.UshortIndexed , {IntArgbBmToUshortIndexedScaleXparOver}, {IntArgbBmToUshortIndexedScaleXparOver }, 0, 0 }, |
103 | REGISTER_XPAR_BLITBG(ByteIndexedBm, UshortIndexed){ & PrimitiveTypes.BlitBg, & SurfaceTypes.ByteIndexedBm , & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {ByteIndexedBmToUshortIndexedXparBgCopy}, {ByteIndexedBmToUshortIndexedXparBgCopy }, 0, 0 }, |
104 | REGISTER_XPAR_CONVERT_BLIT(IntArgbBm, UshortIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgbBm, & CompositeTypes.SrcOverBmNoEa, & SurfaceTypes.UshortIndexed , {IntArgbBmToUshortIndexedXparOver}, {IntArgbBmToUshortIndexedXparOver }, 0, 0 }, |
105 | REGISTER_XPAR_BLITBG(IntArgbBm, UshortIndexed){ & PrimitiveTypes.BlitBg, & SurfaceTypes.IntArgbBm, & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed, {IntArgbBmToUshortIndexedXparBgCopy }, {IntArgbBmToUshortIndexedXparBgCopy}, 0, 0 }, |
106 | |
107 | REGISTER_XOR_BLIT(IntArgb, UshortIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgb, & CompositeTypes.Xor, & SurfaceTypes.UshortIndexed, {IntArgbToUshortIndexedXorBlit }, {IntArgbToUshortIndexedXorBlit}, 0, 0 }, |
108 | REGISTER_ALPHA_MASKFILL(UshortIndexed){ & PrimitiveTypes.MaskFill, & SurfaceTypes.AnyColor, & CompositeTypes.AnyAlpha, & SurfaceTypes.UshortIndexed , {UshortIndexedAlphaMaskFill}, {UshortIndexedAlphaMaskFill}, 0, 0 }, |
109 | REGISTER_ALPHA_MASKBLIT(IntArgb, UshortIndexed){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgb, & CompositeTypes.AnyAlpha, & SurfaceTypes.UshortIndexed, { IntArgbToUshortIndexedAlphaMaskBlit}, {IntArgbToUshortIndexedAlphaMaskBlit }, 0, 0 }, |
110 | REGISTER_ALPHA_MASKBLIT(IntArgbPre, UshortIndexed){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgbPre , & CompositeTypes.AnyAlpha, & SurfaceTypes.UshortIndexed , {IntArgbPreToUshortIndexedAlphaMaskBlit}, {IntArgbPreToUshortIndexedAlphaMaskBlit }, 0, 0 }, |
111 | REGISTER_ALPHA_MASKBLIT(IntRgb, UshortIndexed){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntRgb, & CompositeTypes.AnyAlpha, & SurfaceTypes.UshortIndexed, { IntRgbToUshortIndexedAlphaMaskBlit}, {IntRgbToUshortIndexedAlphaMaskBlit }, 0, 0 }, |
112 | REGISTER_SOLID_DRAWGLYPHLISTAA(UshortIndexed){ & PrimitiveTypes.DrawGlyphListAA, & SurfaceTypes.AnyColor , & CompositeTypes.SrcNoEa, & SurfaceTypes.UshortIndexed , {UshortIndexedDrawGlyphListAA}, {UshortIndexedDrawGlyphListAA }, 0, 0 }, |
113 | }; |
114 | |
115 | extern jint PixelForByteIndexed(SurfaceDataRasInfo *pRasInfo, jint rgb); |
116 | extern jboolean checkSameLut(jint *SrcReadLut, jint *DstReadLut, |
117 | SurfaceDataRasInfo *pSrcInfo, |
118 | SurfaceDataRasInfo *pDstInfo); |
119 | |
120 | jboolean RegisterUshortIndexed(JNIEnv *env) |
121 | { |
122 | return RegisterPrimitives(env, UshortIndexedPrimitives, |
123 | ArraySize(UshortIndexedPrimitives)(sizeof(UshortIndexedPrimitives) / sizeof(UshortIndexedPrimitives [0]))); |
124 | } |
125 | |
126 | jint PixelForUshortIndexed(SurfaceDataRasInfo *pRasInfo, jint rgb) |
127 | { |
128 | return PixelForByteIndexed(pRasInfo, rgb); |
129 | } |
130 | |
131 | |
132 | DEFINE_CONVERT_BLIT(IntArgb, UshortIndexed, 3ByteRgb)void IntArgbToUshortIndexedConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither; char *DstWritererr, * DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; ; do { IntArgbDataType *pSrc = (IntArgbDataType *) (srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = ( pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride ; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)-> invColorTable; } while (0); srcScan -= (width) * 4; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo )->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo )->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo )->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo )->bounds.x1 & 7); } while (0);; do { do { jint r, g, b ; do { jint pixel = (pSrc)[0]; do { (b) = (pixel) & 0xff; (g) = ((pixel) >> 8) & 0xff; (r) = ((pixel) >> 16) & 0xff; } while (0); } while (0); do { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t ) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst) ) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
133 | |
134 | DEFINE_CONVERT_BLIT(ThreeByteBgr, UshortIndexed, 3ByteRgb)void ThreeByteBgrToUshortIndexedConvert(void *srcBase, void * dstBase, juint width, juint height, SurfaceDataRasInfo *pSrcInfo , SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither; char *DstWritererr , *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ; ; do { ThreeByteBgrDataType *pSrc = (ThreeByteBgrDataType * ) (srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0 ); srcScan -= (width) * 3; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { (b) = (pSrc)[3*(0)+0]; (g ) = (pSrc)[3*(0)+1]; (r) = (pSrc)[3*(0)+2]; } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (3))) ; pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
135 | |
136 | DEFINE_CONVERT_BLIT(ByteGray, UshortIndexed, 3ByteRgb)void ByteGrayToUshortIndexedConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither; char *DstWritererr, * DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; ; do { ByteGrayDataType *pSrc = (ByteGrayDataType *) (srcBase) ; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo )->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0); srcScan -= (width ) * 1; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; ((r) = (g) = (b) = (pSrc)[0]); do { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t ) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst) ) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
137 | |
138 | DEFINE_CONVERT_BLIT(Index12Gray, UshortIndexed, 3ByteRgb)void Index12GrayToUshortIndexedConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *SrcReadLut; int DstWriteXDither, DstWriteYDither; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char * DstWriteInvLut; SrcReadLut = (pSrcInfo)->lutBase; do { Index12GrayDataType *pSrc = (Index12GrayDataType *) (srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = ( pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride ; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)-> invColorTable; } while (0); srcScan -= (width) * 2; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo )->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo )->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo )->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo )->bounds.x1 & 7); } while (0);; do { do { jint r, g, b ; r = g = b = (jubyte)SrcReadLut[pSrc[0] & 0xfff]; do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))) ; pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
139 | |
140 | DEFINE_CONVERT_BLIT_LUT(UshortIndexed, IntArgb, ConvertOnTheFly)void UshortIndexedToIntArgbConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *pixLutLut; pixLutLut = (pSrcInfo)->lutBase; do { UshortIndexedDataType *pSrc = (UshortIndexedDataType *) (srcBase); IntArgbDataType *pDst = (IntArgbDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; ; srcScan -= (width) * 2; dstScan -= (width) * 4; do { juint w = width; ; do { do { int argb; (argb) = pixLutLut[(pSrc[0])& 0xfff];; (pDst)[0] = (argb); } while (0); pSrc = ((void *) (( (intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst )) + (4))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t ) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst) ) + (dstScan))); ; } while (--height > 0); } while (0);} |
141 | |
142 | DEFINE_SCALE_BLIT_LUT(UshortIndexed, IntArgb, ConvertOnTheFly)void UshortIndexedToIntArgbScaleConvert(void *srcBase, void * dstBase, juint width, juint height, jint sxloc, jint syloc, jint sxinc, jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *pixLutLut; pixLutLut = (pSrcInfo)->lutBase ; do { UshortIndexedDataType *pSrc; IntArgbDataType *pDst = ( IntArgbDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride ; jint dstScan = (pDstInfo)->scanStride; ; dstScan -= (width ) * 4; do { juint w = width; jint tmpsxloc = sxloc; pSrc = (( void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift ); do { int argb; (argb) = pixLutLut[(pSrc[x])&0xfff];; ( pDst)[0] = (argb); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (4))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc ; } while (--height > 0); } while (0);} |
143 | |
144 | void NAME_CONVERT_BLIT(UshortIndexed, UshortIndexed)UshortIndexedToUshortIndexedConvert |
145 | (void *srcBase, void *dstBase, |
146 | juint width, juint height, |
147 | SurfaceDataRasInfo *pSrcInfo, |
148 | SurfaceDataRasInfo *pDstInfo, |
149 | NativePrimitive *pPrim, |
150 | CompositeInfo *pCompInfo) |
151 | { |
152 | DeclareUshortIndexedLoadVars(SrcRead)jint *SrcReadLut; |
153 | DeclareUshortIndexedLoadVars(DstRead)jint *DstReadLut; |
154 | jint srcScan = pSrcInfo->scanStride; |
155 | jint dstScan = pDstInfo->scanStride; |
156 | jint bytesToCopy = width * pDstInfo->pixelStride; |
157 | |
158 | InitUshortIndexedLoadVars(SrcRead, pSrcInfo)SrcReadLut = (pSrcInfo)->lutBase; |
159 | InitUshortIndexedLoadVars(DstRead, pDstInfo)DstReadLut = (pDstInfo)->lutBase; |
160 | |
161 | if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) { |
162 | do { |
163 | memcpy(dstBase, srcBase, bytesToCopy); |
164 | srcBase = PtrAddBytes(srcBase, srcScan)((void *) (((intptr_t) (srcBase)) + (srcScan))); |
165 | dstBase = PtrAddBytes(dstBase, dstScan)((void *) (((intptr_t) (dstBase)) + (dstScan))); |
166 | } while (--height > 0); |
167 | } else { |
168 | DeclareUshortIndexedStoreVars(DstWrite)int DstWriteXDither, DstWriteYDither; char *DstWritererr, *DstWritegerr , *DstWriteberr; unsigned char *DstWriteInvLut;; |
169 | |
170 | BlitLoopWidthHeight(UshortIndexed, pSrc, srcBase, pSrcInfo,do { UshortIndexedDataType *pSrc = (UshortIndexedDataType *) ( srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0 ); srcScan -= (width) * 2; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc [0])&0xfff]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2) )); DstWriteXDither = (DstWriteXDither + 1) & 7; } while ( --w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0) |
171 | UshortIndexed, pDst, dstBase, pDstInfo, DstWrite,do { UshortIndexedDataType *pSrc = (UshortIndexedDataType *) ( srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0 ); srcScan -= (width) * 2; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc [0])&0xfff]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2) )); DstWriteXDither = (DstWriteXDither + 1) & 7; } while ( --w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0) |
172 | width, height,do { UshortIndexedDataType *pSrc = (UshortIndexedDataType *) ( srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0 ); srcScan -= (width) * 2; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc [0])&0xfff]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2) )); DstWriteXDither = (DstWriteXDither + 1) & 7; } while ( --w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0) |
173 | ConvertVia3ByteRgbdo { UshortIndexedDataType *pSrc = (UshortIndexedDataType *) ( srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0 ); srcScan -= (width) * 2; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc [0])&0xfff]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2) )); DstWriteXDither = (DstWriteXDither + 1) & 7; } while ( --w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0) |
174 | (pSrc, UshortIndexed, SrcRead,do { UshortIndexedDataType *pSrc = (UshortIndexedDataType *) ( srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0 ); srcScan -= (width) * 2; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc [0])&0xfff]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2) )); DstWriteXDither = (DstWriteXDither + 1) & 7; } while ( --w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0) |
175 | pDst, UshortIndexed, DstWrite, 0, 0))do { UshortIndexedDataType *pSrc = (UshortIndexedDataType *) ( srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0 ); srcScan -= (width) * 2; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc [0])&0xfff]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2) )); DstWriteXDither = (DstWriteXDither + 1) & 7; } while ( --w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); |
176 | } |
177 | } |
178 | |
179 | DEFINE_SCALE_BLIT(IntArgb, UshortIndexed, 3ByteRgb)void IntArgbToUshortIndexedScaleConvert(void *srcBase, void * dstBase, juint width, juint height, jint sxloc, jint syloc, jint sxinc, jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither; char *DstWritererr , *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ; ; do { IntArgbDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint pixel = (pSrc)[x]; do { (b) = (pixel) & 0xff; (g) = ((pixel) >> 8) & 0xff; (r) = ((pixel) >> 16) & 0xff; } while (0); } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); } |
180 | |
181 | DEFINE_SCALE_BLIT(ThreeByteBgr, UshortIndexed, 3ByteRgb)void ThreeByteBgrToUshortIndexedScaleConvert(void *srcBase, void *dstBase, juint width, juint height, jint sxloc, jint syloc, jint sxinc, jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo , SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither; char *DstWritererr , *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ; ; do { ThreeByteBgrDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { (b) = (pSrc)[3*(x)+0]; (g) = (pSrc)[3*(x)+1]; (r) = (pSrc)[3*(x)+2 ]; } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); } |
182 | |
183 | DEFINE_SCALE_BLIT(ByteGray, UshortIndexed, 3ByteRgb)void ByteGrayToUshortIndexedScaleConvert(void *srcBase, void * dstBase, juint width, juint height, jint sxloc, jint syloc, jint sxinc, jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither; char *DstWritererr , *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ; ; do { ByteGrayDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; ((r) = (g) = (b) = (pSrc)[x]); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); } |
184 | |
185 | DEFINE_SCALE_BLIT(Index12Gray, UshortIndexed, 3ByteRgb)void Index12GrayToUshortIndexedScaleConvert(void *srcBase, void *dstBase, juint width, juint height, jint sxloc, jint syloc, jint sxinc, jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo , SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *SrcReadLut; int DstWriteXDither, DstWriteYDither ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; SrcReadLut = (pSrcInfo)->lutBase; do { Index12GrayDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType * ) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = ((( pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0); dstScan -= (width ) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = (( void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)-> redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)-> grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)-> bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)-> bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; r = g = b = (jubyte)SrcReadLut[pSrc [x] & 0xfff]; do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); } |
186 | |
187 | void NAME_SCALE_BLIT(UshortIndexed, UshortIndexed)UshortIndexedToUshortIndexedScaleConvert |
188 | (void *srcBase, void *dstBase, |
189 | juint width, juint height, |
190 | jint sxloc, jint syloc, |
191 | jint sxinc, jint syinc, jint shift, |
192 | SurfaceDataRasInfo *pSrcInfo, |
193 | SurfaceDataRasInfo *pDstInfo, |
194 | NativePrimitive *pPrim, |
195 | CompositeInfo *pCompInfo) |
196 | { |
197 | DeclareUshortIndexedLoadVars(SrcRead)jint *SrcReadLut; |
198 | DeclareUshortIndexedLoadVars(DstRead)jint *DstReadLut; |
199 | jint srcScan = pSrcInfo->scanStride; |
Value stored to 'srcScan' during its initialization is never read | |
200 | jint dstScan = pDstInfo->scanStride; |
201 | DeclareUshortIndexedStoreVars(DstWrite)int DstWriteXDither, DstWriteYDither; char *DstWritererr, *DstWritegerr , *DstWriteberr; unsigned char *DstWriteInvLut; |
202 | |
203 | InitUshortIndexedLoadVars(SrcRead, pSrcInfo)SrcReadLut = (pSrcInfo)->lutBase; |
204 | InitUshortIndexedLoadVars(DstRead, pDstInfo)DstReadLut = (pDstInfo)->lutBase; |
205 | |
206 | if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) { |
207 | BlitLoopScaleWidthHeight(UshortIndexed, pSrc, srcBase, pSrcInfo,do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
208 | UshortIndexed, pDst, dstBase, pDstInfo, DstWrite,do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
209 | x, width, height,do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
210 | sxloc, syloc, sxinc, syinc, shift,do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
211 | pDst[0] = pSrc[x])do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); |
212 | } else { |
213 | BlitLoopScaleWidthHeight(UshortIndexed, pSrc, srcBase, pSrcInfo,do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc[x])&0xfff]; do { (b) = (rgb) & 0xff ; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16 ) & 0xff; } while (0); } while (0); do { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
214 | UshortIndexed, pDst, dstBase, pDstInfo, DstWrite,do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc[x])&0xfff]; do { (b) = (rgb) & 0xff ; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16 ) & 0xff; } while (0); } while (0); do { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
215 | x, width, height,do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc[x])&0xfff]; do { (b) = (rgb) & 0xff ; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16 ) & 0xff; } while (0); } while (0); do { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
216 | sxloc, syloc, sxinc, syinc, shift,do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc[x])&0xfff]; do { (b) = (rgb) & 0xff ; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16 ) & 0xff; } while (0); } while (0); do { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
217 | ConvertVia3ByteRgb(pSrc, UshortIndexed, SrcRead,do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc[x])&0xfff]; do { (b) = (rgb) & 0xff ; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16 ) & 0xff; } while (0); } while (0); do { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
218 | pDst, UshortIndexed, DstWrite,do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc[x])&0xfff]; do { (b) = (rgb) & 0xff ; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16 ) & 0xff; } while (0); } while (0); do { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
219 | x, 0))do { UshortIndexedDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[(pSrc[x])&0xfff]; do { (b) = (rgb) & 0xff ; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16 ) & 0xff; } while (0); } while (0); do { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); |
220 | } |
221 | } |
222 | |
223 | DEFINE_XPAR_CONVERT_BLIT_LUT(ByteIndexedBm, UshortIndexed, ConvertOnTheFly)void ByteIndexedBmToUshortIndexedXparOver(void *srcBase, void *dstBase, juint width, juint height, SurfaceDataRasInfo *pSrcInfo , SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither; char *DstWritererr , *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ; jint *pixLutLut; pixLutLut = (pSrcInfo)->lutBase; do { ByteIndexedBmDataType *pSrc = (ByteIndexedBmDataType *) (srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = ( pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride ; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)-> invColorTable; } while (0); srcScan -= (width) * 1; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo )->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo )->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo )->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo )->bounds.x1 & 7); } while (0);; do { do { jint argb; ( argb) = pixLutLut[pSrc[0]]; if (argb < 0) { do { int r, g, b; do { (b) = (argb) & 0xff; (g) = ((argb) >> 8) & 0xff; (r) = ((argb) >> 16) & 0xff; } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); } } while (0); pSrc = ((void *) (((intptr_t) ( pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (2))) ; DstWriteXDither = (DstWriteXDither + 1) & 7; } while (-- w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan)) ); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
224 | |
225 | DEFINE_XPAR_SCALE_BLIT_LUT(ByteIndexedBm, UshortIndexed, ConvertOnTheFly)void ByteIndexedBmToUshortIndexedScaleXparOver(void *srcBase, void *dstBase, juint width, juint height, jint sxloc, jint syloc , jint sxinc, jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo , SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither; char *DstWritererr , *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ; jint *pixLutLut; pixLutLut = (pSrcInfo)->lutBase; do { ByteIndexedBmDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType * ) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = ((( pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0); dstScan -= (width ) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = (( void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)-> redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)-> grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)-> bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)-> bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint argb; (argb) = pixLutLut[pSrc[x]]; if (argb < 0) { do { int r, g, b; do { (b) = (argb) & 0xff; (g ) = ((argb) >> 8) & 0xff; (r) = ((argb) >> 16 ) & 0xff; } while (0); do { r += DstWritererr[DstWriteXDither ]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); } } while (0); pDst = ((void * ) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); } |
226 | |
227 | DEFINE_XPAR_SCALE_BLIT(IntArgbBm, UshortIndexed, 1IntRgb)void IntArgbBmToUshortIndexedScaleXparOver(void *srcBase, void *dstBase, juint width, juint height, jint sxloc, jint syloc, jint sxinc, jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo , SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither; char *DstWritererr , *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ; ; do { IntArgbBmDataType *pSrc; UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; } while (0); dstScan -= (width) * 2; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint XparLoad;; (XparLoad ) = (pSrc)[x]; if (! ((((XparLoad) >> 24) == 0))) { int rgb; (rgb) = (XparLoad); do { int r, g, b; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); do { r += DstWritererr[DstWriteXDither ]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); } } while (0); pDst = ((void * ) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); } |
228 | |
229 | DEFINE_XPAR_BLITBG_LUT(ByteIndexedBm, UshortIndexed, ConvertOnTheFly)void ByteIndexedBmToUshortIndexedXparBgCopy(void *srcBase, void *dstBase, juint width, juint height, jint bgpixel, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim , CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; jint *pixLutLut; ; do { pixLutLut = (pSrcInfo )->lutBase; ; } while (0); do { ByteIndexedBmDataType *pSrc = (ByteIndexedBmDataType *) (srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = ( pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride ; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)-> invColorTable; } while (0); srcScan -= (width) * 1; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo )->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo )->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo )->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo )->bounds.x1 & 7); } while (0);; do { do { jint argb; ( argb) = pixLutLut[pSrc[0]]; if (argb < 0) { do { int r, g, b; do { (b) = (argb) & 0xff; (g) = ((argb) >> 8) & 0xff; (r) = ((argb) >> 16) & 0xff; } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); } else { (pDst)[0] = (jushort) (bgpixel); } } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = ( DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = (( void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) ( ((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
230 | |
231 | DEFINE_XPAR_CONVERT_BLIT(IntArgbBm, UshortIndexed, 1IntRgb)void IntArgbBmToUshortIndexedXparOver(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither; char *DstWritererr, * DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; ; do { IntArgbBmDataType *pSrc = (IntArgbBmDataType *) (srcBase ); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo )->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0); srcScan -= (width ) * 4; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint XparLoad;; (XparLoad) = (pSrc)[0]; if (! ((((XparLoad) >> 24) == 0))) { int rgb; (rgb) = (XparLoad); do { int r, g, b; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff ; (r) = ((rgb) >> 16) & 0xff; } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); } } while (0); pSrc = ((void *) (((intptr_t) ( pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))) ; DstWriteXDither = (DstWriteXDither + 1) & 7; } while (-- w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan)) ); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
232 | |
233 | DEFINE_XPAR_BLITBG(IntArgbBm, UshortIndexed, 1IntRgb)void IntArgbBmToUshortIndexedXparBgCopy(void *srcBase, void * dstBase, juint width, juint height, jint bgpixel, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim , CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; ; do { IntArgbBmDataType *pSrc = (IntArgbBmDataType *) (srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0 ); srcScan -= (width) * 4; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint XparLoad;; (XparLoad) = (pSrc)[0]; if ( (((XparLoad) >> 24) == 0)) { (pDst)[0] = (jushort) (bgpixel ); } else { int rgb; (rgb) = (XparLoad); do { int r, g, b; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff ; (r) = ((rgb) >> 16) & 0xff; } while (0); do { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); } } while (0); pSrc = ((void *) (((intptr_t) ( pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))) ; DstWriteXDither = (DstWriteXDither + 1) & 7; } while (-- w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan)) ); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
234 | |
235 | DEFINE_XOR_BLIT(IntArgb, UshortIndexed, AnyByte)void IntArgbToUshortIndexedXorBlit(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint xorpixel = pCompInfo->details.xorPixel; juint alphamask = pCompInfo->alphaMask; int DstWriteXDither, DstWriteYDither ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; ; ; ; do { IntArgbDataType *pSrc = (IntArgbDataType *) (srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0 ); srcScan -= (width) * 4; dstScan -= (width) * 2; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint srcpixel; (srcpixel) = (pSrc)[0]; if (( ((jint) srcpixel) >= 0)) { break; } do { jint r, g, b; do { (b) = (srcpixel) & 0xff; (g) = ((srcpixel) >> 8) & 0xff; (r) = ((srcpixel) >> 16) & 0xff; } while (0) ; (srcpixel) = ((pDstInfo)->invColorTable)[((((unsigned char ) r) >> 3)<<10) + ((((unsigned char) g) >> 3 )<<5) + (((unsigned char) b) >> 3)]; } while (0); ; (pDst)[0] ^= (((srcpixel) ^ (xorpixel)) & ~(alphamask) ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4))) ; pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
236 | |
237 | DEFINE_ALPHA_MASKFILL(UshortIndexed, 4ByteArgb)void UshortIndexedAlphaMaskFill (void *rasBase, jubyte *pMask , jint maskOff, jint maskScan, jint width, jint height, jint fgColor , SurfaceDataRasInfo *pRasInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint pathA = 0xff; jint srcA; jint srcR, srcG, srcB; jint dstA = 0; jint dstF; jint dstFbase; jint rasScan = pRasInfo->scanStride; jboolean loaddst; UshortIndexedDataType *pRas = (UshortIndexedDataType *) (rasBase); jint *DstPixLut ; jint DstPixrgb; int DstWriteXDither, DstWriteYDither; char * DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ; jint SrcOpAnd, SrcOpXor, SrcOpAdd; jint DstOpAnd, DstOpXor, DstOpAdd; do { (srcB) = (fgColor) & 0xff; (srcG) = ((fgColor ) >> 8) & 0xff; (srcR) = ((fgColor) >> 16) & 0xff; (srcA) = ((fgColor) >> 24) & 0xff; } while ( 0); if (srcA != 0xff) { do { srcR = mul8table[srcA][srcR]; srcG = mul8table[srcA][srcG]; srcB = mul8table[srcA][srcB]; } while (0); } do { SrcOpAnd = (AlphaRules[pCompInfo->rule].srcOps ).andval; SrcOpXor = (AlphaRules[pCompInfo->rule].srcOps). xorval; SrcOpAdd = (jint) (AlphaRules[pCompInfo->rule].srcOps ).addval - SrcOpXor; } while (0); do { DstOpAnd = (AlphaRules [pCompInfo->rule].dstOps).andval; DstOpXor = (AlphaRules[pCompInfo ->rule].dstOps).xorval; DstOpAdd = (jint) (AlphaRules[pCompInfo ->rule].dstOps).addval - DstOpXor; } while (0); loaddst = pMask || !((DstOpAnd | DstOpAdd) == 0) || (SrcOpAnd != 0); dstFbase = dstF = ((((srcA) & DstOpAnd) ^ DstOpXor) + DstOpAdd); do { DstPixLut = (pRasInfo)->lutBase; DstPixrgb = 0; } while (0); rasScan -= width * 2; maskScan -= width; if (pMask) { pMask += maskOff; } do { do { DstWriteYDither = (((pRasInfo)->bounds .y1 & 7) << 3); } while (0); DstWriteInvLut = (pRasInfo )->invColorTable; } while (0); do { jint w = width; do { DstWritererr = (pRasInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pRasInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pRasInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pRasInfo)->bounds.x1 & 7); } while (0);; do { jint resA; jint resR, resG, resB; jint srcF; if (pMask) { pathA = *pMask++; if (!pathA) { pRas = ((void *) (((intptr_t) (pRas) ) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue ; } ; dstF = dstFbase; } if (loaddst) { do { DstPixrgb = DstPixLut [((pRas)[0])&0xfff]; dstA = ((juint) DstPixrgb) >> 24 ; } while (0); } srcF = ((((dstA) & SrcOpAnd) ^ SrcOpXor) + SrcOpAdd); if (pathA != 0xff) { srcF = mul8table[pathA][srcF ]; dstF = 0xff - pathA + mul8table[pathA][dstF]; } if (srcF) { if (srcF == 0xff) { resA = srcA; do { resR = srcR; resG = srcG ; resB = srcB; } while (0); } else { resA = mul8table[srcF][srcA ]; do { resR = mul8table[srcF][srcR]; resG = mul8table[srcF][ srcG]; resB = mul8table[srcF][srcB]; } while (0); } } else { if (dstF == 0xff) { pRas = ((void *) (((intptr_t) (pRas)) + (2) )); DstWriteXDither = (DstWriteXDither + 1) & 7; continue ; } resA = 0; resR = resG = resB = 0; } if (dstF) { dstA = mul8table [dstF][dstA]; resA += dstA; if (0) { dstA = dstF; } if (dstA) { jint tmpR, tmpG, tmpB; do { tmpR = (DstPixrgb >> 16) & 0xff; tmpG = (DstPixrgb >> 8) & 0xff; tmpB = (DstPixrgb >> 0) & 0xff; } while (0); if (dstA != 0xff ) { do { tmpR = mul8table[dstA][tmpR]; tmpG = mul8table[dstA] [tmpG]; tmpB = mul8table[dstA][tmpB]; } while (0); } do { resR += tmpR; resG += tmpG; resB += tmpB; } while (0); } } if (!( 0) && resA && resA < 0xff) { do { resR = div8table [resA][resR]; resG = div8table[resA][resG]; resB = div8table[ resA][resB]; } while (0); } do { resR += DstWritererr[DstWriteXDither ]; resG += DstWritegerr[DstWriteXDither]; resB += DstWriteberr [DstWriteXDither]; do { if (((resR|resG|resB) >> 8) != 0 ) { do { if (((resR) >> 8) != 0) {resR = (~(resR >> 31)) & 255; } } while (0); do { if (((resG) >> 8) != 0) {resG = (~(resG >> 31)) & 255; } } while (0); do { if (((resB) >> 8) != 0) {resB = (~(resB >> 31) ) & 255; } } while (0); } } while (0); (pRas)[0] = (DstWriteInvLut )[((((unsigned char) resR) >> 3)<<10) + ((((unsigned char) resG) >> 3)<<5) + (((unsigned char) resB) >> 3)]; } while (0); pRas = ((void *) (((intptr_t) (pRas)) + (2 ))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pRas = ((void *) (((intptr_t) (pRas)) + (rasScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); if (pMask) { pMask = ((void *) (((intptr_t) ( pMask)) + (maskScan))); } } while (--height > 0); } |
238 | |
239 | DEFINE_ALPHA_MASKBLIT(IntArgb, UshortIndexed, 4ByteArgb)void IntArgbToUshortIndexedAlphaMaskBlit (void *dstBase, void *srcBase, jubyte *pMask, jint maskOff, jint maskScan, jint width , jint height, SurfaceDataRasInfo *pDstInfo, SurfaceDataRasInfo *pSrcInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint pathA = 0xff; jint srcA = 0; jint dstA = 0; jint extraA = (jint)(pCompInfo->details.extraAlpha * 255.0 + 0.5); jint srcScan = pSrcInfo->scanStride; jint dstScan = pDstInfo-> scanStride; jboolean loadsrc, loaddst; IntArgbDataType *pSrc = (IntArgbDataType *) (srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint SrcPix; jint *DstPixLut ; jint DstPixrgb; int DstWriteXDither, DstWriteYDither; char * DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ; jint SrcOpAnd, SrcOpXor, SrcOpAdd; jint DstOpAnd, DstOpXor, DstOpAdd; do { SrcOpAnd = (AlphaRules[pCompInfo->rule].srcOps ).andval; SrcOpXor = (AlphaRules[pCompInfo->rule].srcOps). xorval; SrcOpAdd = (jint) (AlphaRules[pCompInfo->rule].srcOps ).addval - SrcOpXor; } while (0); do { DstOpAnd = (AlphaRules [pCompInfo->rule].dstOps).andval; DstOpXor = (AlphaRules[pCompInfo ->rule].dstOps).xorval; DstOpAdd = (jint) (AlphaRules[pCompInfo ->rule].dstOps).addval - DstOpXor; } while (0); loadsrc = ! ((SrcOpAnd | SrcOpAdd) == 0) || (DstOpAnd != 0); loaddst = pMask || !((DstOpAnd | DstOpAdd) == 0) || (SrcOpAnd != 0); SrcPix = 0; do { DstPixLut = (pDstInfo)->lutBase; DstPixrgb = 0; } while (0); srcScan -= width * 4; dstScan -= width * 2; maskScan -= width; if (pMask) { pMask += maskOff; } do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0 ); do { jint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds. x1 & 7); } while (0);; do { jint resA; jint resR, resG, resB ; jint srcF; jint dstF; if (pMask) { pathA = *pMask++; if (!pathA ) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } ; } if (loadsrc) { do { SrcPix = ( pSrc)[0]; srcA = ((juint) SrcPix) >> 24; } while (0); srcA = mul8table[extraA][srcA]; } if (loaddst) { do { DstPixrgb = DstPixLut[((pDst)[0])&0xfff]; dstA = ((juint) DstPixrgb) >> 24; } while (0); } srcF = ((((dstA) & SrcOpAnd) ^ SrcOpXor) + SrcOpAdd); dstF = ((((srcA) & DstOpAnd) ^ DstOpXor ) + DstOpAdd); if (pathA != 0xff) { srcF = mul8table[pathA][srcF ]; dstF = 0xff - pathA + mul8table[pathA][dstF]; } if (srcF) { resA = mul8table[srcF][srcA]; if (!(0)) { srcF = resA; } else { srcF = mul8table[srcF][extraA]; } if (srcF) { do { resR = ( SrcPix >> 16) & 0xff; resG = (SrcPix >> 8) & 0xff; resB = (SrcPix >> 0) & 0xff; } while (0); if (srcF != 0xff) { do { resR = mul8table[srcF][resR]; resG = mul8table [srcF][resG]; resB = mul8table[srcF][resB]; } while (0); } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } resR = resG = resB = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t ) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2 ))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue ; } resA = 0; resR = resG = resB = 0; } if (dstF) { dstA = mul8table [dstF][dstA]; if (!(0)) { dstF = dstA; } resA += dstA; if (dstF ) { jint tmpR, tmpG, tmpB; do { tmpR = (DstPixrgb >> 16 ) & 0xff; tmpG = (DstPixrgb >> 8) & 0xff; tmpB = (DstPixrgb >> 0) & 0xff; } while (0); if (dstF != 0xff ) { do { tmpR = mul8table[dstF][tmpR]; tmpG = mul8table[dstF] [tmpG]; tmpB = mul8table[dstF][tmpB]; } while (0); } do { resR += tmpR; resG += tmpG; resB += tmpB; } while (0); } } if (!( 0) && resA && resA < 0xff) { do { resR = div8table [resA][resR]; resG = div8table[resA][resG]; resB = div8table[ resA][resB]; } while (0); } do { resR += DstWritererr[DstWriteXDither ]; resG += DstWritegerr[DstWriteXDither]; resB += DstWriteberr [DstWriteXDither]; do { if (((resR|resG|resB) >> 8) != 0 ) { do { if (((resR) >> 8) != 0) {resR = (~(resR >> 31)) & 255; } } while (0); do { if (((resG) >> 8) != 0) {resG = (~(resG >> 31)) & 255; } } while (0); do { if (((resB) >> 8) != 0) {resB = (~(resB >> 31) ) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) resR) >> 3)<<10) + ((((unsigned char) resG) >> 3)<<5) + (((unsigned char) resB) >> 3)]; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4 ))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); if (pMask) { pMask = ((void *) (((intptr_t) (pMask)) + (maskScan))); } } while (-- height > 0); } |
240 | |
241 | DEFINE_ALPHA_MASKBLIT(IntArgbPre, UshortIndexed, 4ByteArgb)void IntArgbPreToUshortIndexedAlphaMaskBlit (void *dstBase, void *srcBase, jubyte *pMask, jint maskOff, jint maskScan, jint width , jint height, SurfaceDataRasInfo *pDstInfo, SurfaceDataRasInfo *pSrcInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint pathA = 0xff; jint srcA = 0; jint dstA = 0; jint extraA = (jint)(pCompInfo->details.extraAlpha * 255.0 + 0.5); jint srcScan = pSrcInfo->scanStride; jint dstScan = pDstInfo-> scanStride; jboolean loadsrc, loaddst; IntArgbPreDataType *pSrc = (IntArgbPreDataType *) (srcBase); UshortIndexedDataType *pDst = (UshortIndexedDataType *) (dstBase); jint SrcPix; jint *DstPixLut ; jint DstPixrgb; int DstWriteXDither, DstWriteYDither; char * DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ; jint SrcOpAnd, SrcOpXor, SrcOpAdd; jint DstOpAnd, DstOpXor, DstOpAdd; do { SrcOpAnd = (AlphaRules[pCompInfo->rule].srcOps ).andval; SrcOpXor = (AlphaRules[pCompInfo->rule].srcOps). xorval; SrcOpAdd = (jint) (AlphaRules[pCompInfo->rule].srcOps ).addval - SrcOpXor; } while (0); do { DstOpAnd = (AlphaRules [pCompInfo->rule].dstOps).andval; DstOpXor = (AlphaRules[pCompInfo ->rule].dstOps).xorval; DstOpAdd = (jint) (AlphaRules[pCompInfo ->rule].dstOps).addval - DstOpXor; } while (0); loadsrc = ! ((SrcOpAnd | SrcOpAdd) == 0) || (DstOpAnd != 0); loaddst = pMask || !((DstOpAnd | DstOpAdd) == 0) || (SrcOpAnd != 0); SrcPix = 0; do { DstPixLut = (pDstInfo)->lutBase; DstPixrgb = 0; } while (0); srcScan -= width * 4; dstScan -= width * 2; maskScan -= width; if (pMask) { pMask += maskOff; } do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0 ); do { jint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds. x1 & 7); } while (0);; do { jint resA; jint resR, resG, resB ; jint srcF; jint dstF; if (pMask) { pathA = *pMask++; if (!pathA ) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } ; } if (loadsrc) { do { SrcPix = ( pSrc)[0]; srcA = ((juint) SrcPix) >> 24; } while (0); srcA = mul8table[extraA][srcA]; } if (loaddst) { do { DstPixrgb = DstPixLut[((pDst)[0])&0xfff]; dstA = ((juint) DstPixrgb) >> 24; } while (0); } srcF = ((((dstA) & SrcOpAnd) ^ SrcOpXor) + SrcOpAdd); dstF = ((((srcA) & DstOpAnd) ^ DstOpXor ) + DstOpAdd); if (pathA != 0xff) { srcF = mul8table[pathA][srcF ]; dstF = 0xff - pathA + mul8table[pathA][dstF]; } if (srcF) { resA = mul8table[srcF][srcA]; if (!(1)) { srcF = resA; } else { srcF = mul8table[srcF][extraA]; } if (srcF) { do { do { (resB ) = (SrcPix) & 0xff; (resG) = ((SrcPix) >> 8) & 0xff; (resR) = ((SrcPix) >> 16) & 0xff; } while (0 ); } while (0); if (srcF != 0xff) { do { resR = mul8table[srcF ][resR]; resG = mul8table[srcF][resG]; resB = mul8table[srcF] [resB]; } while (0); } } else { if (dstF == 0xff) { pSrc = (( void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t ) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } resR = resG = resB = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } resA = 0; resR = resG = resB = 0; } if (dstF) { dstA = mul8table[dstF][dstA]; if (!(0)) { dstF = dstA; } resA += dstA; if (dstF) { jint tmpR, tmpG, tmpB; do { tmpR = (DstPixrgb >> 16) & 0xff; tmpG = (DstPixrgb >> 8) & 0xff; tmpB = (DstPixrgb >> 0) & 0xff ; } while (0); if (dstF != 0xff) { do { tmpR = mul8table[dstF ][tmpR]; tmpG = mul8table[dstF][tmpG]; tmpB = mul8table[dstF] [tmpB]; } while (0); } do { resR += tmpR; resG += tmpG; resB += tmpB; } while (0); } } if (!(0) && resA && resA < 0xff) { do { resR = div8table[resA][resR]; resG = div8table [resA][resG]; resB = div8table[resA][resB]; } while (0); } do { resR += DstWritererr[DstWriteXDither]; resG += DstWritegerr [DstWriteXDither]; resB += DstWriteberr[DstWriteXDither]; do { if (((resR|resG|resB) >> 8) != 0) { do { if (((resR) >> 8) != 0) {resR = (~(resR >> 31)) & 255; } } while ( 0); do { if (((resG) >> 8) != 0) {resG = (~(resG >> 31)) & 255; } } while (0); do { if (((resB) >> 8) != 0) {resB = (~(resB >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) resR) >> 3)<<10) + ((((unsigned char) resG) >> 3)<<5) + (((unsigned char) resB) >> 3)]; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ( (void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t ) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst) ) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); if (pMask) { pMask = ((void *) ((( intptr_t) (pMask)) + (maskScan))); } } while (--height > 0 ); } |
242 | |
243 | DEFINE_ALPHA_MASKBLIT(IntRgb, UshortIndexed, 4ByteArgb)void IntRgbToUshortIndexedAlphaMaskBlit (void *dstBase, void * srcBase, jubyte *pMask, jint maskOff, jint maskScan, jint width , jint height, SurfaceDataRasInfo *pDstInfo, SurfaceDataRasInfo *pSrcInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint pathA = 0xff; jint srcA = 0; jint dstA = 0; jint extraA = (jint)(pCompInfo->details.extraAlpha * 255.0 + 0.5); jint srcScan = pSrcInfo->scanStride; jint dstScan = pDstInfo-> scanStride; jboolean loadsrc, loaddst; IntRgbDataType *pSrc = (IntRgbDataType *) (srcBase); UshortIndexedDataType *pDst = ( UshortIndexedDataType *) (dstBase); jint *DstPixLut; jint DstPixrgb ; int DstWriteXDither, DstWriteYDither; char *DstWritererr, * DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; jint SrcOpAnd, SrcOpXor, SrcOpAdd; jint DstOpAnd, DstOpXor, DstOpAdd ; do { SrcOpAnd = (AlphaRules[pCompInfo->rule].srcOps).andval ; SrcOpXor = (AlphaRules[pCompInfo->rule].srcOps).xorval; SrcOpAdd = (jint) (AlphaRules[pCompInfo->rule].srcOps).addval - SrcOpXor ; } while (0); do { DstOpAnd = (AlphaRules[pCompInfo->rule ].dstOps).andval; DstOpXor = (AlphaRules[pCompInfo->rule]. dstOps).xorval; DstOpAdd = (jint) (AlphaRules[pCompInfo->rule ].dstOps).addval - DstOpXor; } while (0); loadsrc = !((SrcOpAnd | SrcOpAdd) == 0) || (DstOpAnd != 0); loaddst = pMask || !(( DstOpAnd | DstOpAdd) == 0) || (SrcOpAnd != 0); ; do { DstPixLut = (pDstInfo)->lutBase; DstPixrgb = 0; } while (0); srcScan -= width * 4; dstScan -= width * 2; maskScan -= width; if (pMask ) { pMask += maskOff; } do { do { DstWriteYDither = (((pDstInfo )->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; } while (0); do { jint w = width ; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint resA; jint resR, resG, resB; jint srcF; jint dstF; if (pMask) { pathA = *pMask++; if (!pathA) { pSrc = (( void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t ) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } ; } if (loadsrc) { srcA = 0xff; srcA = mul8table [extraA][srcA]; } if (loaddst) { do { DstPixrgb = DstPixLut[( (pDst)[0])&0xfff]; dstA = ((juint) DstPixrgb) >> 24 ; } while (0); } srcF = ((((dstA) & SrcOpAnd) ^ SrcOpXor) + SrcOpAdd); dstF = ((((srcA) & DstOpAnd) ^ DstOpXor) + DstOpAdd ); if (pathA != 0xff) { srcF = mul8table[pathA][srcF]; dstF = 0xff - pathA + mul8table[pathA][dstF]; } if (srcF) { resA = mul8table [srcF][srcA]; if (!(0)) { srcF = resA; } else { srcF = mul8table [srcF][extraA]; } if (srcF) { do { jint pixel = (pSrc)[0]; do { (resB) = (pixel) & 0xff; (resG) = ((pixel) >> 8) & 0xff; (resR) = ((pixel) >> 16) & 0xff; } while (0); } while (0); if (srcF != 0xff) { do { resR = mul8table[ srcF][resR]; resG = mul8table[srcF][resG]; resB = mul8table[srcF ][resB]; } while (0); } } else { if (dstF == 0xff) { pSrc = ( (void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t ) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } resR = resG = resB = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } resA = 0; resR = resG = resB = 0; } if (dstF) { dstA = mul8table[dstF][dstA]; if (!(0)) { dstF = dstA; } resA += dstA; if (dstF) { jint tmpR, tmpG, tmpB; do { tmpR = (DstPixrgb >> 16) & 0xff; tmpG = (DstPixrgb >> 8) & 0xff; tmpB = (DstPixrgb >> 0) & 0xff ; } while (0); if (dstF != 0xff) { do { tmpR = mul8table[dstF ][tmpR]; tmpG = mul8table[dstF][tmpG]; tmpB = mul8table[dstF] [tmpB]; } while (0); } do { resR += tmpR; resG += tmpG; resB += tmpB; } while (0); } } if (!(0) && resA && resA < 0xff) { do { resR = div8table[resA][resR]; resG = div8table [resA][resG]; resB = div8table[resA][resB]; } while (0); } do { resR += DstWritererr[DstWriteXDither]; resG += DstWritegerr [DstWriteXDither]; resB += DstWriteberr[DstWriteXDither]; do { if (((resR|resG|resB) >> 8) != 0) { do { if (((resR) >> 8) != 0) {resR = (~(resR >> 31)) & 255; } } while ( 0); do { if (((resG) >> 8) != 0) {resG = (~(resG >> 31)) & 255; } } while (0); do { if (((resB) >> 8) != 0) {resB = (~(resB >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) resR) >> 3)<<10) + ((((unsigned char) resG) >> 3)<<5) + (((unsigned char) resB) >> 3)]; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ( (void *) (((intptr_t) (pDst)) + (2))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t ) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst) ) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); if (pMask) { pMask = ((void *) ((( intptr_t) (pMask)) + (maskScan))); } } while (--height > 0 ); } |
244 | |
245 | DEFINE_SOLID_DRAWGLYPHLISTAA(UshortIndexed, 3ByteRgb)void UshortIndexedDrawGlyphListAA(SurfaceDataRasInfo *pRasInfo , ImageRef *glyphs, jint totalGlyphs, jint fgpixel, jint argbcolor , jint clipLeft, jint clipTop, jint clipRight, jint clipBottom , NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint glyphCounter ; jint scan = pRasInfo->scanStride; UshortIndexedDataType * pPix; jint srcA; jint srcR, srcG, srcB; jint *pixLut; int pixXDither , pixYDither; char *pixrerr, *pixgerr, *pixberr; unsigned char *pixInvLut; pixLut = (pRasInfo)->lutBase; do { do { pixYDither = (((pRasInfo)->bounds.y1 & 7) << 3); } while ( 0); pixInvLut = (pRasInfo)->invColorTable; } while (0); do { pixrerr = (pRasInfo)->redErrTable + pixYDither; pixgerr = (pRasInfo)->grnErrTable + pixYDither; pixberr = (pRasInfo )->bluErrTable + pixYDither; pixXDither = ((pRasInfo)-> bounds.x1 & 7); } while (0);; do { (srcB) = (argbcolor) & 0xff; (srcG) = ((argbcolor) >> 8) & 0xff; (srcR) = ((argbcolor) >> 16) & 0xff; (srcA) = ((argbcolor) >> 24) & 0xff; } while (0); ; for (glyphCounter = 0; glyphCounter < totalGlyphs; glyphCounter++) { const jubyte * pixels; int rowBytes; int left, top; int width, height; int right, bottom ; pixels = (const jubyte *)glyphs[glyphCounter].pixels; if (! pixels) { continue; } rowBytes = glyphs[glyphCounter].rowBytes ; left = glyphs[glyphCounter].x; top = glyphs[glyphCounter].y ; width = glyphs[glyphCounter].width; height = glyphs[glyphCounter ].height; right = left + width; bottom = top + height; if (left < clipLeft) { pixels += (clipLeft - left) * 1 ; left = clipLeft ; } if (top < clipTop) { pixels += (clipTop - top) * rowBytes ; top = clipTop; } if (right > clipRight) { right = clipRight ; } if (bottom > clipBottom) { bottom = clipBottom; } if ( right <= left || bottom <= top) { continue; } width = right - left; height = bottom - top; pPix = ((void *) (((intptr_t) (pRasInfo->rasBase)) + (((ptrdiff_t)(top))*(scan) + ((ptrdiff_t )(left))*(2)))); do { pixYDither = ((top & 7) << 3) ; } while (0); do { int x = 0; do { pixrerr = (pRasInfo)-> redErrTable + pixYDither; pixgerr = (pRasInfo)->grnErrTable + pixYDither; pixberr = (pRasInfo)->bluErrTable + pixYDither ; pixXDither = (left & 7); } while (0); do { do { jint dstR , dstG, dstB; jint mixValSrc = pixels[x]; if (mixValSrc) { if (mixValSrc < 255) { jint mixValDst = 255 - mixValSrc; do { jint rgb = pixLut[(pPix[x])&0xfff]; do { (dstB) = (rgb) & 0xff; (dstG) = ((rgb) >> 8) & 0xff; (dstR) = ((rgb ) >> 16) & 0xff; } while (0); } while (0); do { dstR = mul8table[mixValDst][dstR] + mul8table[mixValSrc][srcR]; dstG = mul8table[mixValDst][dstG] + mul8table[mixValSrc][srcG]; dstB = mul8table[mixValDst][dstB] + mul8table[mixValSrc][srcB]; } while (0); do { dstR += pixrerr[pixXDither]; dstG += pixgerr [pixXDither]; dstB += pixberr[pixXDither]; do { if (((dstR|dstG |dstB) >> 8) != 0) { do { if (((dstR) >> 8) != 0) {dstR = (~(dstR >> 31)) & 255; } } while (0); do { if (((dstG) >> 8) != 0) {dstG = (~(dstG >> 31)) & 255; } } while (0); do { if (((dstB) >> 8) != 0) {dstB = (~(dstB >> 31)) & 255; } } while (0); } } while ( 0); (pPix)[x] = (pixInvLut)[((((unsigned char) dstR) >> 3)<<10) + ((((unsigned char) dstG) >> 3)<< 5) + (((unsigned char) dstB) >> 3)]; } while (0); } else { (pPix)[x] = (jushort) (fgpixel); } } } while (0);; pixXDither = (pixXDither + 1) & 7; } while (++x < width); pPix = ((void *) (((intptr_t) (pPix)) + (scan))); pixels += rowBytes ; pixYDither = (pixYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } } |