0N/A/*
2362N/A * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A#if !defined(JAVA2D_NO_MLIB) || defined(MLIB_ADD_SUFF)
0N/A
0N/A#include <vis_proto.h>
0N/A#include "java2d_Mlib.h"
0N/A#include "vis_AlphaMacros.h"
0N/A
0N/A/***************************************************************/
0N/A
0N/Aconst mlib_u8 vis_sat_sh3_tbl[128 + 256 + 128] = {
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 0, 0, 0, 0, 0, 0, 0, 0,
0N/A 1, 1, 1, 1, 1, 1, 1, 1,
0N/A 2, 2, 2, 2, 2, 2, 2, 2,
0N/A 3, 3, 3, 3, 3, 3, 3, 3,
0N/A 4, 4, 4, 4, 4, 4, 4, 4,
0N/A 5, 5, 5, 5, 5, 5, 5, 5,
0N/A 6, 6, 6, 6, 6, 6, 6, 6,
0N/A 7, 7, 7, 7, 7, 7, 7, 7,
0N/A 8, 8, 8, 8, 8, 8, 8, 8,
0N/A 9, 9, 9, 9, 9, 9, 9, 9,
0N/A 10, 10, 10, 10, 10, 10, 10, 10,
0N/A 11, 11, 11, 11, 11, 11, 11, 11,
0N/A 12, 12, 12, 12, 12, 12, 12, 12,
0N/A 13, 13, 13, 13, 13, 13, 13, 13,
0N/A 14, 14, 14, 14, 14, 14, 14, 14,
0N/A 15, 15, 15, 15, 15, 15, 15, 15,
0N/A 16, 16, 16, 16, 16, 16, 16, 16,
0N/A 17, 17, 17, 17, 17, 17, 17, 17,
0N/A 18, 18, 18, 18, 18, 18, 18, 18,
0N/A 19, 19, 19, 19, 19, 19, 19, 19,
0N/A 20, 20, 20, 20, 20, 20, 20, 20,
0N/A 21, 21, 21, 21, 21, 21, 21, 21,
0N/A 22, 22, 22, 22, 22, 22, 22, 22,
0N/A 23, 23, 23, 23, 23, 23, 23, 23,
0N/A 24, 24, 24, 24, 24, 24, 24, 24,
0N/A 25, 25, 25, 25, 25, 25, 25, 25,
0N/A 26, 26, 26, 26, 26, 26, 26, 26,
0N/A 27, 27, 27, 27, 27, 27, 27, 27,
0N/A 28, 28, 28, 28, 28, 28, 28, 28,
0N/A 29, 29, 29, 29, 29, 29, 29, 29,
0N/A 30, 30, 30, 30, 30, 30, 30, 30,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A 31, 31, 31, 31, 31, 31, 31, 31,
0N/A};
0N/A
0N/A/***************************************************************/
0N/A
0N/A#define CHECK_LUT
0N/A
0N/A/***************************************************************/
0N/A
0N/A#define FUNC_CONVERT(FUNC, SRC_T) \
0N/Avoid ADD_SUFF(SRC_T##ToByteIndexed##FUNC)(BLIT_PARAMS) \
0N/A{ \
0N/A const mlib_u8 *p_tbl = vis_sat_sh3_tbl + 128; \
0N/A mlib_s32 DstWriteXDither, DstWriteYDither; \
0N/A mlib_s8 *DstWritererr, *DstWritegerr, *DstWriteberr; \
0N/A mlib_u8 *DstWriteInvLut; \
0N/A mlib_s32 srcScan = pSrcInfo->scanStride; \
0N/A mlib_s32 dstScan = pDstInfo->scanStride; \
0N/A mlib_s32 r, g, b; \
0N/A mlib_s32 i, j; \
0N/A CHECK_LUT \
0N/A \
0N/A DstWriteYDither = (pDstInfo->bounds.y1 & 7) << 3; \
0N/A DstWriteInvLut = pDstInfo->invColorTable; \
0N/A \
0N/A for (j = 0; j < height; j++) { \
0N/A mlib_u8 *pSrc = srcBase; \
0N/A mlib_u8 *pDst = dstBase; \
0N/A \
0N/A DstWritererr = pDstInfo->redErrTable + DstWriteYDither; \
0N/A DstWritegerr = pDstInfo->grnErrTable + DstWriteYDither; \
0N/A DstWriteberr = pDstInfo->bluErrTable + DstWriteYDither; \
0N/A \
0N/A DstWriteXDither = pDstInfo->bounds.x1 & 7; \
0N/A \
0N/A for (i = 0; i < width; i++) { \
0N/A GET_RGB_##SRC_T(i) \
0N/A { \
0N/A r = p_tbl[r + DstWritererr[DstWriteXDither]]; \
0N/A g = p_tbl[g + DstWritegerr[DstWriteXDither]]; \
0N/A b = p_tbl[b + DstWriteberr[DstWriteXDither]]; \
0N/A \
0N/A pDst[i] = DstWriteInvLut[(r << 10) + (g << 5) + b]; \
0N/A } \
0N/A \
0N/A DstWriteXDither = (DstWriteXDither + 1) & 7; \
0N/A } \
0N/A \
0N/A PTR_ADD(dstBase, dstScan); \
0N/A PTR_ADD(srcBase, srcScan); \
0N/A \
0N/A DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); \
0N/A } \
0N/A}
0N/A
0N/A/***************************************************************/
0N/A
0N/A#define FUNC_SCALE_CONVERT(FUNC, SRC_T) \
0N/Avoid ADD_SUFF(SRC_T##ToByteIndexed##FUNC)(SCALE_PARAMS) \
0N/A{ \
0N/A const mlib_u8 *p_tbl = vis_sat_sh3_tbl + 128; \
0N/A mlib_s32 DstWriteXDither, DstWriteYDither; \
0N/A mlib_s8 *DstWritererr, *DstWritegerr, *DstWriteberr; \
0N/A mlib_u8 *DstWriteInvLut; \
0N/A mlib_s32 srcScan = pSrcInfo->scanStride; \
0N/A mlib_s32 dstScan = pDstInfo->scanStride; \
0N/A mlib_s32 r, g, b; \
0N/A mlib_s32 i, j; \
0N/A CHECK_LUT \
0N/A \
0N/A DstWriteYDither = (pDstInfo->bounds.y1 & 7) << 3; \
0N/A DstWriteInvLut = pDstInfo->invColorTable; \
0N/A \
0N/A for (j = 0; j < height; j++) { \
0N/A mlib_u8 *pSrc = srcBase; \
0N/A mlib_u8 *pDst = dstBase; \
0N/A mlib_s32 tmpsxloc = sxloc; \
0N/A \
0N/A PTR_ADD(pSrc, (syloc >> shift) * srcScan); \
0N/A \
0N/A DstWritererr = pDstInfo->redErrTable + DstWriteYDither; \
0N/A DstWritegerr = pDstInfo->grnErrTable + DstWriteYDither; \
0N/A DstWriteberr = pDstInfo->bluErrTable + DstWriteYDither; \
0N/A \
0N/A DstWriteXDither = pDstInfo->bounds.x1 & 7; \
0N/A \
0N/A for (i = 0; i < width; i++) { \
0N/A mlib_s32 ii = tmpsxloc >> shift; \
0N/A GET_RGB_##SRC_T(ii) \
0N/A { \
0N/A r = p_tbl[r + DstWritererr[DstWriteXDither]]; \
0N/A g = p_tbl[g + DstWritegerr[DstWriteXDither]]; \
0N/A b = p_tbl[b + DstWriteberr[DstWriteXDither]]; \
0N/A \
0N/A pDst[i] = DstWriteInvLut[(r << 10) + (g << 5) + b]; \
0N/A } \
0N/A \
0N/A DstWriteXDither = (DstWriteXDither + 1) & 7; \
0N/A tmpsxloc += sxinc; \
0N/A } \
0N/A \
0N/A PTR_ADD(dstBase, dstScan); \
0N/A syloc += syinc; \
0N/A \
0N/A DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); \
0N/A } \
0N/A}
0N/A
0N/A/***************************************************************/
0N/A
0N/A#define GET_PIX_IntArgbBm(i) \
0N/A mlib_s32 pixel = *(mlib_s32*)(pSrc + 4*i); \
0N/A if (pixel >> 24)
0N/A
0N/A#define GET_PIX_ByteIndexedBm(i) \
0N/A mlib_s32 pixel = SrcReadLut[pSrc[i]]; \
0N/A if (pixel < 0)
0N/A
0N/A#define FUNC_BGCOPY(SRC_T) \
0N/Avoid ADD_SUFF(SRC_T##ToByteIndexedXparBgCopy)(BCOPY_PARAMS) \
0N/A{ \
0N/A const mlib_u8 *p_tbl = vis_sat_sh3_tbl + 128; \
0N/A mlib_s32 DstWriteXDither, DstWriteYDither; \
0N/A mlib_s8 *DstWritererr, *DstWritegerr, *DstWriteberr; \
0N/A mlib_u8 *DstWriteInvLut; \
0N/A mlib_s32 srcScan = pSrcInfo->scanStride; \
0N/A mlib_s32 dstScan = pDstInfo->scanStride; \
0N/A mlib_s32 r, g, b; \
0N/A mlib_s32 i, j; \
0N/A jint *SrcReadLut = pSrcInfo->lutBase; \
0N/A \
0N/A DstWriteYDither = (pDstInfo->bounds.y1 & 7) << 3; \
0N/A DstWriteInvLut = pDstInfo->invColorTable; \
0N/A \
0N/A for (j = 0; j < height; j++) { \
0N/A mlib_u8 *pSrc = srcBase; \
0N/A mlib_u8 *pDst = dstBase; \
0N/A \
0N/A DstWritererr = pDstInfo->redErrTable + DstWriteYDither; \
0N/A DstWritegerr = pDstInfo->grnErrTable + DstWriteYDither; \
0N/A DstWriteberr = pDstInfo->bluErrTable + DstWriteYDither; \
0N/A \
0N/A DstWriteXDither = pDstInfo->bounds.x1 & 7; \
0N/A \
0N/A for (i = 0; i < width; i++) { \
0N/A GET_PIX_##SRC_T(i) \
0N/A { \
0N/A b = (pixel) & 0xff; \
0N/A g = (pixel >> 8) & 0xff; \
0N/A r = (pixel >> 16) & 0xff; \
0N/A \
0N/A r = p_tbl[r + DstWritererr[DstWriteXDither]]; \
0N/A g = p_tbl[g + DstWritegerr[DstWriteXDither]]; \
0N/A b = p_tbl[b + DstWriteberr[DstWriteXDither]]; \
0N/A \
0N/A pDst[i] = DstWriteInvLut[(r << 10) + (g << 5) + b]; \
0N/A } else { \
0N/A pDst[i] = bgpixel; \
0N/A } \
0N/A \
0N/A DstWriteXDither = (DstWriteXDither + 1) & 7; \
0N/A } \
0N/A \
0N/A PTR_ADD(dstBase, dstScan); \
0N/A PTR_ADD(srcBase, srcScan); \
0N/A \
0N/A DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); \
0N/A } \
0N/A}
0N/A
0N/AFUNC_BGCOPY(ByteIndexedBm)
0N/AFUNC_BGCOPY(IntArgbBm)
0N/A
0N/A/***************************************************************/
0N/A
0N/A#define GET_RGB_IntArgb(i) \
0N/A mlib_u32 pixel = *(mlib_u32*)(pSrc + 4*i); \
0N/A b = (pixel) & 0xff; \
0N/A g = (pixel >> 8) & 0xff; \
0N/A r = (pixel >> 16) & 0xff;
0N/A
0N/A#define GET_RGB_ThreeByteBgr(i) \
0N/A b = pSrc[3*i]; \
0N/A g = pSrc[3*i + 1]; \
0N/A r = pSrc[3*i + 2];
0N/A
0N/A#define GET_RGB_ByteGray(i) \
0N/A r = g = b = pSrc[i];
0N/A
0N/A#define GET_RGB_Index12Gray(i) \
0N/A r = SrcReadLut[((mlib_u16*)pSrc)[i] & 0xfff]; \
0N/A r &= 0xff; \
0N/A g = b = r;
0N/A
0N/A#define GET_RGB_ByteIndexed(i) \
0N/A mlib_u32 pixel = SrcReadLut[pSrc[i]]; \
0N/A b = (pixel) & 0xff; \
0N/A g = (pixel >> 8) & 0xff; \
0N/A r = (pixel >> 16) & 0xff;
0N/A
0N/A#define GET_RGB_IntArgbBm(i) \
0N/A mlib_s32 pixel = *(mlib_s32*)(pSrc + 4*i); \
0N/A b = (pixel) & 0xff; \
0N/A g = (pixel >> 8) & 0xff; \
0N/A r = (pixel >> 16) & 0xff; \
0N/A if (pixel >> 24)
0N/A
0N/A#define GET_RGB_ByteIndexedBm(i) \
0N/A mlib_s32 pixel = SrcReadLut[pSrc[i]]; \
0N/A b = (pixel) & 0xff; \
0N/A g = (pixel >> 8) & 0xff; \
0N/A r = (pixel >> 16) & 0xff; \
0N/A if (pixel < 0)
0N/A
0N/A/***************************************************************/
0N/A
0N/AFUNC_CONVERT(Convert, IntArgb)
0N/AFUNC_CONVERT(Convert, ThreeByteBgr)
0N/AFUNC_CONVERT(Convert, ByteGray)
0N/AFUNC_CONVERT(XparOver, IntArgbBm)
0N/AFUNC_SCALE_CONVERT(ScaleConvert, IntArgb)
0N/AFUNC_SCALE_CONVERT(ScaleConvert, ThreeByteBgr)
0N/AFUNC_SCALE_CONVERT(ScaleConvert, ByteGray)
0N/AFUNC_SCALE_CONVERT(ScaleXparOver, IntArgbBm)
0N/A
0N/A/***************************************************************/
0N/A
0N/A#undef CHECK_LUT
0N/A#define CHECK_LUT \
0N/A jint *SrcReadLut = pSrcInfo->lutBase;
0N/A
0N/AFUNC_CONVERT(Convert, Index12Gray)
0N/AFUNC_SCALE_CONVERT(ScaleConvert, Index12Gray)
0N/A
0N/AFUNC_CONVERT(XparOver, ByteIndexedBm)
0N/AFUNC_SCALE_CONVERT(ScaleXparOver, ByteIndexedBm)
0N/A
0N/A/***************************************************************/
0N/A
0N/A#undef CHECK_LUT
0N/A#define CHECK_LUT \
0N/A jint *SrcReadLut = pSrcInfo->lutBase; \
0N/A jint *DstReadLut = pDstInfo->lutBase; \
0N/A if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) { \
0N/A ADD_SUFF(AnyByteIsomorphicCopy)(BLIT_CALL_PARAMS); \
0N/A return; \
0N/A }
0N/A
0N/AFUNC_CONVERT(Convert, ByteIndexed)
0N/A
0N/A#undef CHECK_LUT
0N/A#define CHECK_LUT \
0N/A jint *SrcReadLut = pSrcInfo->lutBase; \
0N/A jint *DstReadLut = pDstInfo->lutBase; \
0N/A if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) { \
0N/A ADD_SUFF(AnyByteIsomorphicScaleCopy)(SCALE_CALL_PARAMS); \
0N/A return; \
0N/A }
0N/A
0N/AFUNC_SCALE_CONVERT(ScaleConvert, ByteIndexed)
0N/A
0N/A/***************************************************************/
0N/A
0N/Avoid ADD_SUFF(IntArgbToByteIndexedXorBlit)(BLIT_PARAMS)
0N/A{
0N/A mlib_u8 *DstWriteInvLut;
0N/A mlib_s32 srcScan = pSrcInfo->scanStride;
0N/A mlib_s32 dstScan = pDstInfo->scanStride;
0N/A mlib_s32 xorpixel = pCompInfo->details.xorPixel;
0N/A mlib_s32 alphamask = pCompInfo->alphaMask;
0N/A mlib_s32 i, j;
0N/A
0N/A DstWriteInvLut = pDstInfo->invColorTable;
0N/A
0N/A for (j = 0; j < height; j++) {
0N/A mlib_s32 *pSrc = srcBase;
0N/A mlib_u8 *pDst = dstBase;
0N/A
0N/A for (i = 0; i < width; i++) {
0N/A mlib_s32 spix = pSrc[i];
0N/A mlib_s32 dpix;
0N/A if (spix < 0) {
0N/A dpix = DstWriteInvLut[((spix >> 9) & 0x7C00) +
0N/A ((spix >> 6) & 0x03E0) +
0N/A ((spix >> 3) & 0x001F)];
0N/A pDst[i] ^= (dpix ^ xorpixel) &~ alphamask;
0N/A }
0N/A }
0N/A
0N/A PTR_ADD(dstBase, dstScan);
0N/A PTR_ADD(srcBase, srcScan);
0N/A }
0N/A}
0N/A
0N/A/***************************************************************/
0N/A
0N/A#define MASK_FILL(rr, pathA, dstA, dstARGB) \
0N/A{ \
0N/A mlib_d64 t0, t1; \
0N/A mlib_s32 srcF, dstF, srcA; \
0N/A \
0N/A srcF = ((dstA & SrcOpAnd) ^ SrcOpXor) + SrcOpAdd; \
0N/A \
0N/A srcF = MUL8_INT(srcF, pathA); \
0N/A dstF = MUL8_INT(dstFbase, pathA) + (0xff - pathA); \
0N/A \
0N/A srcA = MUL8_INT(cnstA, srcF); \
0N/A dstA = MUL8_INT(dstF, dstA); \
0N/A \
0N/A t0 = MUL8_VIS(cnstARGB0, srcF); \
0N/A t1 = MUL8_VIS(dstARGB, dstA); \
0N/A rr = vis_fpadd16(t0, t1); \
0N/A \
0N/A dstA += srcA; \
0N/A DIV_ALPHA(rr, dstA); \
0N/A}
0N/A
0N/A/***************************************************************/
0N/A
0N/Avoid ADD_SUFF(ByteIndexedAlphaMaskFill)(void *dstBase,
0N/A jubyte *pMask,
0N/A jint maskOff,
0N/A jint maskScan,
0N/A jint width,
0N/A jint height,
0N/A jint fgColor,
0N/A SurfaceDataRasInfo *pDstInfo,
0N/A NativePrimitive *pPrim,
0N/A CompositeInfo *pCompInfo)
0N/A{
0N/A const mlib_u8 *mul8_tbl = (void*)mul8table;
0N/A const mlib_u8 *p_tbl = vis_sat_sh3_tbl + 128;
0N/A mlib_s32 DstWriteXDither, DstWriteYDither;
0N/A mlib_s8 *DstWritererr, *DstWritegerr, *DstWriteberr;
0N/A mlib_u8 *DstWriteInvLut;
0N/A mlib_s32 r, g, b;
0N/A mlib_f32 *DstReadLut = (void*)(pDstInfo->lutBase);
0N/A mlib_s32 cnstA, cnstR, cnstG, cnstB;
0N/A mlib_s32 dstScan = pDstInfo->scanStride;
0N/A mlib_f32 cnstARGB0;
0N/A mlib_s32 SrcOpAnd, SrcOpXor, SrcOpAdd;
0N/A mlib_s32 DstOpAnd, DstOpXor, DstOpAdd;
0N/A mlib_s32 dstFbase;
0N/A mlib_s32 j;
0N/A
0N/A cnstA = (fgColor >> 24) & 0xff;
0N/A cnstR = (fgColor >> 16) & 0xff;
0N/A cnstG = (fgColor >> 8) & 0xff;
0N/A cnstB = (fgColor ) & 0xff;
0N/A
0N/A if (cnstA != 0xff) {
0N/A cnstR = mul8table[cnstA][cnstR];
0N/A cnstG = mul8table[cnstA][cnstG];
0N/A cnstB = mul8table[cnstA][cnstB];
0N/A }
0N/A
0N/A cnstARGB0 = F32_FROM_U8x4(cnstA, cnstR, cnstG, cnstB);
0N/A
0N/A SrcOpAnd = (AlphaRules[pCompInfo->rule].srcOps).andval;
0N/A SrcOpXor = (AlphaRules[pCompInfo->rule].srcOps).xorval;
0N/A SrcOpAdd = (AlphaRules[pCompInfo->rule].srcOps).addval;
0N/A SrcOpAdd -= SrcOpXor;
0N/A
0N/A DstOpAnd = (AlphaRules[pCompInfo->rule].dstOps).andval;
0N/A DstOpXor = (AlphaRules[pCompInfo->rule].dstOps).xorval;
0N/A DstOpAdd = (AlphaRules[pCompInfo->rule].dstOps).addval;
0N/A DstOpAdd -= DstOpXor;
0N/A
0N/A dstFbase = (((cnstA) & DstOpAnd) ^ DstOpXor) + DstOpAdd;
0N/A
0N/A vis_write_gsr(7 << 3);
0N/A
0N/A if (pMask != NULL) {
0N/A DstWriteYDither = (pDstInfo->bounds.y1 & 7) << 3;
0N/A DstWriteInvLut = pDstInfo->invColorTable;
0N/A
0N/A pMask += maskOff;
0N/A
0N/A if (dstScan == width && maskScan == width) {
0N/A width *= height;
0N/A height = 1;
0N/A }
0N/A
0N/A for (j = 0; j < height; j++) {
0N/A mlib_u8 *pDst = dstBase;
0N/A mlib_s32 i;
0N/A mlib_s32 pathA0, dstA0, dst_val, pixel;
0N/A mlib_d64 res0;
0N/A mlib_f32 dstARGB0;
0N/A
0N/A DstWritererr = pDstInfo->redErrTable + DstWriteYDither;
0N/A DstWritegerr = pDstInfo->grnErrTable + DstWriteYDither;
0N/A DstWriteberr = pDstInfo->bluErrTable + DstWriteYDither;
0N/A
0N/A DstWriteXDither = pDstInfo->bounds.x1 & 7;
0N/A
0N/A#pragma pipeloop(0)
0N/A for (i = 0; i < width; i++) {
0N/A dst_val = pDst[i];
0N/A pathA0 = pMask[i];
0N/A dstA0 = *(mlib_u8*)(DstReadLut + dst_val);
0N/A dstARGB0 = DstReadLut[dst_val];
0N/A MASK_FILL(res0, pathA0, dstA0, dstARGB0);
0N/A dstARGB0 = vis_fpack16(res0);
0N/A
0N/A pixel = *(mlib_s32*)&dstARGB0;
0N/A b = (pixel) & 0xff;
0N/A g = (pixel >> 8) & 0xff;
0N/A r = (pixel >> 16) & 0xff;
0N/A r = p_tbl[r + DstWritererr[DstWriteXDither]];
0N/A g = p_tbl[g + DstWritegerr[DstWriteXDither]];
0N/A b = p_tbl[b + DstWriteberr[DstWriteXDither]];
0N/A pDst[i] = DstWriteInvLut[(r << 10) + (g << 5) + b];
0N/A
0N/A DstWriteXDither = (DstWriteXDither + 1) & 7;
0N/A }
0N/A
0N/A PTR_ADD(dstBase, dstScan);
0N/A PTR_ADD(pMask, maskScan);
0N/A DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3);
0N/A }
0N/A }/* else {
0N/A if (dstScan == 4*width) {
0N/A width *= height;
0N/A height = 1;
0N/A }
0N/A
0N/A for (j = 0; j < height; j++) {
0N/A IntArgbAlphaMaskFill_A1_line(dstBase, pMask, width,
0N/A cnstARGB0,
0N/A log_val, mul8_cnstA, mul8_dstF,
0N/A (void*)mul8table);
0N/A
0N/A PTR_ADD(dstBase, dstScan);
0N/A }
0N/A }*/
0N/A}
0N/A
0N/A/***************************************************************/
0N/A
0N/A#endif