src/java.desktop/share/native/libawt/java2d/loops/UshortIndexed.c
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 26751 jdk/src/java.desktop/share/native/libawt/java2d/loops/UshortIndexed.c@70bac69b37c9
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
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) 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 "UshortIndexed.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 "UshortIndexed".
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 RegisterUshortIndexed;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
DECLARE_CONVERT_BLIT(IntArgb, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
DECLARE_CONVERT_BLIT(ThreeByteBgr, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
DECLARE_CONVERT_BLIT(ByteGray, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
DECLARE_CONVERT_BLIT(UshortIndexed, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
DECLARE_CONVERT_BLIT(Index12Gray, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
DECLARE_CONVERT_BLIT(UshortIndexed, IntArgb);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
DECLARE_SCALE_BLIT(IntArgb, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
DECLARE_SCALE_BLIT(ThreeByteBgr, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
DECLARE_SCALE_BLIT(ByteGray, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
DECLARE_SCALE_BLIT(Index12Gray, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
DECLARE_SCALE_BLIT(UshortIndexed, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
DECLARE_SCALE_BLIT(UshortIndexed, IntArgb);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
DECLARE_XPAR_SCALE_BLIT(ByteIndexedBm, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
DECLARE_XPAR_SCALE_BLIT(IntArgbBm, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
DECLARE_XPAR_BLITBG(ByteIndexedBm, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
DECLARE_XPAR_CONVERT_BLIT(IntArgbBm, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
DECLARE_XPAR_BLITBG(IntArgbBm, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
DECLARE_XOR_BLIT(IntArgb, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
DECLARE_ALPHA_MASKFILL(UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
DECLARE_ALPHA_MASKBLIT(IntArgb, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
DECLARE_ALPHA_MASKBLIT(IntArgbPre, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
DECLARE_ALPHA_MASKBLIT(IntRgb, UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
DECLARE_SOLID_DRAWGLYPHLISTAA(UshortIndexed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
NativePrimitive UshortIndexedPrimitives[] = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    REGISTER_CONVERT_BLIT(IntArgb, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    REGISTER_CONVERT_BLIT_EQUIV(IntRgb, UshortIndexed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                                NAME_CONVERT_BLIT(IntArgb, UshortIndexed)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    REGISTER_CONVERT_BLIT_EQUIV(IntArgbBm, UshortIndexed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                                NAME_CONVERT_BLIT(IntArgb, UshortIndexed)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    REGISTER_CONVERT_BLIT(ThreeByteBgr, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    REGISTER_CONVERT_BLIT(ByteGray, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    REGISTER_CONVERT_BLIT(Index12Gray, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    REGISTER_CONVERT_BLIT_FLAGS(UshortIndexed, UshortIndexed, 0, SD_LOCK_LUT),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    REGISTER_CONVERT_BLIT(UshortIndexed, IntArgb),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    REGISTER_CONVERT_BLIT_EQUIV(UshortIndexed, IntRgb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                                NAME_CONVERT_BLIT(UshortIndexed, IntArgb)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    REGISTER_SCALE_BLIT(IntArgb, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    REGISTER_SCALE_BLIT_EQUIV(IntRgb, UshortIndexed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                              NAME_SCALE_BLIT(IntArgb, UshortIndexed)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    REGISTER_SCALE_BLIT_EQUIV(IntArgbBm, UshortIndexed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                              NAME_SCALE_BLIT(IntArgb, UshortIndexed)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    REGISTER_SCALE_BLIT(ThreeByteBgr, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    REGISTER_SCALE_BLIT(ByteGray, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    REGISTER_SCALE_BLIT(Index12Gray, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    REGISTER_SCALE_BLIT_FLAGS(UshortIndexed, UshortIndexed, 0, SD_LOCK_LUT),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    REGISTER_SCALE_BLIT(UshortIndexed, IntArgb),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    REGISTER_SCALE_BLIT_EQUIV(UshortIndexed, IntRgb,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                              NAME_SCALE_BLIT(UshortIndexed, IntArgb)),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    REGISTER_XPAR_SCALE_BLIT(ByteIndexedBm, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    REGISTER_XPAR_SCALE_BLIT(IntArgbBm, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    REGISTER_XPAR_BLITBG(ByteIndexedBm, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    REGISTER_XPAR_CONVERT_BLIT(IntArgbBm, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    REGISTER_XPAR_BLITBG(IntArgbBm, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    REGISTER_XOR_BLIT(IntArgb, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    REGISTER_ALPHA_MASKFILL(UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    REGISTER_ALPHA_MASKBLIT(IntArgb, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    REGISTER_ALPHA_MASKBLIT(IntArgbPre, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    REGISTER_ALPHA_MASKBLIT(IntRgb, UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    REGISTER_SOLID_DRAWGLYPHLISTAA(UshortIndexed),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
extern jint PixelForByteIndexed(SurfaceDataRasInfo *pRasInfo, jint rgb);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
extern jboolean checkSameLut(jint *SrcReadLut, jint *DstReadLut,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                             SurfaceDataRasInfo *pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                             SurfaceDataRasInfo *pDstInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
jboolean RegisterUshortIndexed(JNIEnv *env)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    return RegisterPrimitives(env, UshortIndexedPrimitives,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                              ArraySize(UshortIndexedPrimitives));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
jint PixelForUshortIndexed(SurfaceDataRasInfo *pRasInfo, jint rgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    return PixelForByteIndexed(pRasInfo, rgb);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
DEFINE_CONVERT_BLIT(IntArgb, UshortIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
DEFINE_CONVERT_BLIT(ThreeByteBgr, UshortIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
DEFINE_CONVERT_BLIT(ByteGray, UshortIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
DEFINE_CONVERT_BLIT(Index12Gray, UshortIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
DEFINE_CONVERT_BLIT_LUT(UshortIndexed, IntArgb, ConvertOnTheFly)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
DEFINE_SCALE_BLIT_LUT(UshortIndexed, IntArgb, ConvertOnTheFly)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
void NAME_CONVERT_BLIT(UshortIndexed, UshortIndexed)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    (void *srcBase, void *dstBase,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     juint width, juint height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     SurfaceDataRasInfo *pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     SurfaceDataRasInfo *pDstInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     NativePrimitive *pPrim,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     CompositeInfo *pCompInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    DeclareUshortIndexedLoadVars(SrcRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    DeclareUshortIndexedLoadVars(DstRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    jint srcScan = pSrcInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    jint dstScan = pDstInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    jint bytesToCopy = width * pDstInfo->pixelStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    InitUshortIndexedLoadVars(SrcRead, pSrcInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    InitUshortIndexedLoadVars(DstRead, pDstInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        do {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            memcpy(dstBase, srcBase, bytesToCopy);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            srcBase = PtrAddBytes(srcBase, srcScan);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
            dstBase = PtrAddBytes(dstBase, dstScan);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        } while (--height > 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        DeclareUshortIndexedStoreVars(DstWrite);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        BlitLoopWidthHeight(UshortIndexed, pSrc, srcBase, pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                            UshortIndexed, pDst, dstBase, pDstInfo, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                            width, height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                            ConvertVia3ByteRgb
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                                (pSrc, UshortIndexed, SrcRead,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                                 pDst, UshortIndexed, DstWrite, 0, 0));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
DEFINE_SCALE_BLIT(IntArgb, UshortIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
DEFINE_SCALE_BLIT(ThreeByteBgr, UshortIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
DEFINE_SCALE_BLIT(ByteGray, UshortIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
DEFINE_SCALE_BLIT(Index12Gray, UshortIndexed, 3ByteRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
void NAME_SCALE_BLIT(UshortIndexed, UshortIndexed)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    (void *srcBase, void *dstBase,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     juint width, juint height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     jint sxloc, jint syloc,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     jint sxinc, jint syinc, jint shift,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     SurfaceDataRasInfo *pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     SurfaceDataRasInfo *pDstInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     NativePrimitive *pPrim,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     CompositeInfo *pCompInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    DeclareUshortIndexedLoadVars(SrcRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    DeclareUshortIndexedLoadVars(DstRead)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    jint srcScan = pSrcInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    jint dstScan = pDstInfo->scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    DeclareUshortIndexedStoreVars(DstWrite)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    InitUshortIndexedLoadVars(SrcRead, pSrcInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    InitUshortIndexedLoadVars(DstRead, pDstInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        BlitLoopScaleWidthHeight(UshortIndexed, pSrc, srcBase, pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                                 UshortIndexed, pDst, dstBase, pDstInfo, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                                 x, width, height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                                 sxloc, syloc, sxinc, syinc, shift,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                                 pDst[0] = pSrc[x]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        BlitLoopScaleWidthHeight(UshortIndexed, pSrc, srcBase, pSrcInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                                 UshortIndexed, pDst, dstBase, pDstInfo, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                                 x, width, height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                                 sxloc, syloc, sxinc, syinc, shift,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                                 ConvertVia3ByteRgb(pSrc, UshortIndexed, SrcRead,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                                                    pDst, UshortIndexed, DstWrite,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                                                    x, 0));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
DEFINE_XPAR_CONVERT_BLIT_LUT(ByteIndexedBm, UshortIndexed, ConvertOnTheFly)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
DEFINE_XPAR_SCALE_BLIT_LUT(ByteIndexedBm, UshortIndexed, ConvertOnTheFly)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
DEFINE_XPAR_SCALE_BLIT(IntArgbBm, UshortIndexed, 1IntRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
DEFINE_XPAR_BLITBG_LUT(ByteIndexedBm, UshortIndexed, ConvertOnTheFly)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
DEFINE_XPAR_CONVERT_BLIT(IntArgbBm, UshortIndexed, 1IntRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
DEFINE_XPAR_BLITBG(IntArgbBm, UshortIndexed, 1IntRgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
DEFINE_XOR_BLIT(IntArgb, UshortIndexed, AnyByte)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
DEFINE_ALPHA_MASKFILL(UshortIndexed, 4ByteArgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
DEFINE_ALPHA_MASKBLIT(IntArgb, UshortIndexed, 4ByteArgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
DEFINE_ALPHA_MASKBLIT(IntArgbPre, UshortIndexed, 4ByteArgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
DEFINE_ALPHA_MASKBLIT(IntRgb, UshortIndexed, 4ByteArgb)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
DEFINE_SOLID_DRAWGLYPHLISTAA(UshortIndexed, 3ByteRgb)