jdk/src/share/native/sun/java2d/loops/ByteIndexed.c
author flar
Mon, 06 Dec 2010 21:45:48 -0800
changeset 7487 9b031d062ede
parent 5506 202f599c92aa
permissions -rw-r--r--
6775317: Improve performance of non-AA transformed rectangles and single wide lines in software pipelines Reviewed-by: jgodinez, prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#include <string.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#include "AnyByte.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "ByteIndexed.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#include "AlphaMacros.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#include "IntArgb.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#include "IntArgbBm.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#include "IntArgbPre.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#include "IntRgb.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#include "ThreeByteBgr.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
#include "ByteGray.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#include "Index12Gray.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * This file declares, registers, and defines the various graphics
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * primitive loops to manipulate surfaces of type "ByteIndexed".
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * See also LoopMacros.h
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
RegisterFunc RegisterByteIndexed;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
DECLARE_CONVERT_BLIT(IntArgb, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
DECLARE_CONVERT_BLIT(ThreeByteBgr, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
DECLARE_CONVERT_BLIT(ByteGray, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
DECLARE_CONVERT_BLIT(ByteIndexed, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
DECLARE_CONVERT_BLIT(Index12Gray, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
DECLARE_SCALE_BLIT(IntArgb, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
DECLARE_SCALE_BLIT(ThreeByteBgr, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
DECLARE_SCALE_BLIT(ByteGray, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
DECLARE_SCALE_BLIT(Index12Gray, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
DECLARE_SCALE_BLIT(ByteIndexed, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
DECLARE_XPAR_SCALE_BLIT(ByteIndexedBm, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
DECLARE_XPAR_SCALE_BLIT(IntArgbBm, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
DECLARE_XPAR_BLITBG(ByteIndexedBm, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
DECLARE_XPAR_CONVERT_BLIT(IntArgbBm, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
DECLARE_XPAR_BLITBG(IntArgbBm, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
DECLARE_XOR_BLIT(IntArgb, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
DECLARE_ALPHA_MASKFILL(ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
DECLARE_ALPHA_MASKBLIT(IntArgb, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
DECLARE_ALPHA_MASKBLIT(IntArgbPre, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
DECLARE_ALPHA_MASKBLIT(IntRgb, ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
DECLARE_SOLID_DRAWGLYPHLISTAA(ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
DECLARE_TRANSFORMHELPER_FUNCS(ByteIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
DECLARE_TRANSFORMHELPER_FUNCS(ByteIndexedBm);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
NativePrimitive ByteIndexedPrimitives[] = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    REGISTER_CONVERT_BLIT(IntArgb, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    REGISTER_CONVERT_BLIT_EQUIV(IntRgb, ByteIndexed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
                                NAME_CONVERT_BLIT(IntArgb, ByteIndexed)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    REGISTER_CONVERT_BLIT_EQUIV(IntArgbBm, ByteIndexed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                                NAME_CONVERT_BLIT(IntArgb, ByteIndexed)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    REGISTER_CONVERT_BLIT(ThreeByteBgr, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    REGISTER_CONVERT_BLIT(ByteGray, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    REGISTER_CONVERT_BLIT(Index12Gray, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    REGISTER_CONVERT_BLIT_FLAGS(ByteIndexed, ByteIndexed, 0, SD_LOCK_LUT),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    REGISTER_SCALE_BLIT(IntArgb, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    REGISTER_SCALE_BLIT_EQUIV(IntRgb, ByteIndexed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
                              NAME_SCALE_BLIT(IntArgb, ByteIndexed)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    REGISTER_SCALE_BLIT_EQUIV(IntArgbBm, ByteIndexed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                              NAME_SCALE_BLIT(IntArgb, ByteIndexed)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    REGISTER_SCALE_BLIT(ThreeByteBgr, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    REGISTER_SCALE_BLIT(ByteGray, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    REGISTER_SCALE_BLIT(Index12Gray, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    REGISTER_SCALE_BLIT_FLAGS(ByteIndexed, ByteIndexed, 0, SD_LOCK_LUT),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    REGISTER_XPAR_SCALE_BLIT(ByteIndexedBm, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    REGISTER_XPAR_SCALE_BLIT(IntArgbBm, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    REGISTER_XPAR_BLITBG(ByteIndexedBm, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    REGISTER_XPAR_CONVERT_BLIT(IntArgbBm, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    REGISTER_XPAR_BLITBG(IntArgbBm, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    REGISTER_XOR_BLIT(IntArgb, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    REGISTER_ALPHA_MASKFILL(ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    REGISTER_ALPHA_MASKBLIT(IntArgb, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    REGISTER_ALPHA_MASKBLIT(IntArgbPre, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    REGISTER_ALPHA_MASKBLIT(IntRgb, ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    REGISTER_SOLID_DRAWGLYPHLISTAA(ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    REGISTER_TRANSFORMHELPER_FUNCS(ByteIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    REGISTER_TRANSFORMHELPER_FUNCS(ByteIndexedBm),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
jboolean RegisterByteIndexed(JNIEnv *env)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    return RegisterPrimitives(env, ByteIndexedPrimitives,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                              ArraySize(ByteIndexedPrimitives));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
jint PixelForByteIndexed(SurfaceDataRasInfo *pRasInfo, jint rgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    jint r, g, b;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    ExtractIntDcmComponentsX123(rgb, r, g, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    return SurfaceData_InvColorMap(pRasInfo->invColorTable, r, g, b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
jboolean checkSameLut(jint *SrcReadLut, jint *DstReadLut,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                      SurfaceDataRasInfo *pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                      SurfaceDataRasInfo *pDstInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    if (SrcReadLut != DstReadLut) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        juint lutSize = pSrcInfo->lutSize;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        if (lutSize > pDstInfo->lutSize) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
            return JNI_FALSE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
            juint i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            for (i = 0; i < lutSize; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
                if (SrcReadLut[i] != DstReadLut[i]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
                    return JNI_FALSE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    return JNI_TRUE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
DEFINE_CONVERT_BLIT(IntArgb, ByteIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
DEFINE_CONVERT_BLIT(ThreeByteBgr, ByteIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
DEFINE_CONVERT_BLIT(ByteGray, ByteIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
DEFINE_CONVERT_BLIT(Index12Gray, ByteIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
void NAME_CONVERT_BLIT(ByteIndexed, ByteIndexed)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    (void *srcBase, void *dstBase,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     juint width, juint height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     SurfaceDataRasInfo *pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     SurfaceDataRasInfo *pDstInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     NativePrimitive *pPrim,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     CompositeInfo *pCompInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    DeclareByteIndexedLoadVars(SrcRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    DeclareByteIndexedLoadVars(DstRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    jint srcScan = pSrcInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    jint dstScan = pDstInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    InitByteIndexedLoadVars(SrcRead, pSrcInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    InitByteIndexedLoadVars(DstRead, pDstInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        do {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            memcpy(dstBase, srcBase, width);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            srcBase = PtrAddBytes(srcBase, srcScan);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            dstBase = PtrAddBytes(dstBase, dstScan);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        } while (--height > 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        DeclareByteIndexedStoreVars(DstWrite);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        BlitLoopWidthHeight(ByteIndexed, pSrc, srcBase, pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                            ByteIndexed, pDst, dstBase, pDstInfo, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                            width, height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                            ConvertVia3ByteRgb
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                                (pSrc, ByteIndexed, SrcRead,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                                 pDst, ByteIndexed, DstWrite, 0, 0));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
DEFINE_SCALE_BLIT(IntArgb, ByteIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
DEFINE_SCALE_BLIT(ThreeByteBgr, ByteIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
DEFINE_SCALE_BLIT(ByteGray, ByteIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
DEFINE_SCALE_BLIT(Index12Gray, ByteIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
void NAME_SCALE_BLIT(ByteIndexed, ByteIndexed)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    (void *srcBase, void *dstBase,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     juint width, juint height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     jint sxloc, jint syloc,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     jint sxinc, jint syinc, jint shift,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     SurfaceDataRasInfo *pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     SurfaceDataRasInfo *pDstInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     NativePrimitive *pPrim,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     CompositeInfo *pCompInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    DeclareByteIndexedLoadVars(SrcRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    DeclareByteIndexedLoadVars(DstRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    jint srcScan = pSrcInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    jint dstScan = pDstInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    DeclareByteIndexedStoreVars(DstWrite)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    InitByteIndexedLoadVars(SrcRead, pSrcInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    InitByteIndexedLoadVars(DstRead, pDstInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        BlitLoopScaleWidthHeight(ByteIndexed, pSrc, srcBase, pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                                 ByteIndexed, pDst, dstBase, pDstInfo, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                                 x, width, height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                                 sxloc, syloc, sxinc, syinc, shift,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                                 pDst[0] = pSrc[x]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        BlitLoopScaleWidthHeight(ByteIndexed, pSrc, srcBase, pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                                 ByteIndexed, pDst, dstBase, pDstInfo, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                                 x, width, height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                                 sxloc, syloc, sxinc, syinc, shift,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                                 ConvertVia3ByteRgb(pSrc, ByteIndexed, SrcRead,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                                                    pDst, ByteIndexed, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                                                    x, 0));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
DEFINE_XPAR_CONVERT_BLIT_LUT8(ByteIndexedBm, ByteIndexed, ConvertOnTheFly)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
DEFINE_XPAR_SCALE_BLIT_LUT8(ByteIndexedBm, ByteIndexed, ConvertOnTheFly)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
DEFINE_XPAR_SCALE_BLIT(IntArgbBm, ByteIndexed, 1IntRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
DEFINE_XPAR_BLITBG_LUT8(ByteIndexedBm, ByteIndexed, ConvertOnTheFly)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
DEFINE_XPAR_CONVERT_BLIT(IntArgbBm, ByteIndexed, 1IntRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
DEFINE_XPAR_BLITBG(IntArgbBm, ByteIndexed, 1IntRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
DEFINE_XOR_BLIT(IntArgb, ByteIndexed, AnyByte)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
DEFINE_ALPHA_MASKFILL(ByteIndexed, 4ByteArgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
DEFINE_ALPHA_MASKBLIT(IntArgb, ByteIndexed, 4ByteArgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
DEFINE_ALPHA_MASKBLIT(IntArgbPre, ByteIndexed, 4ByteArgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
DEFINE_ALPHA_MASKBLIT(IntRgb, ByteIndexed, 4ByteArgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
DEFINE_SOLID_DRAWGLYPHLISTAA(ByteIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
DEFINE_TRANSFORMHELPERS(ByteIndexed)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
DEFINE_TRANSFORMHELPERS(ByteIndexedBm)