1 /*
2  * Copyright (c) 2000, 2001, 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 "GraphicsPrimitiveMgr.h"
27 #include "LoopMacros.h"
28 
29 /*
30  * This file contains macro and type definitions used by the macros in
31  * LoopMacros.h to manipulate a surface of type "AnyInt".
32  */
33 
34 typedef jint    AnyIntDataType;
35 
36 #define AnyIntPixelStride       4
37 
38 #define DeclareAnyIntLoadVars(PREFIX)
39 #define DeclareAnyIntStoreVars(PREFIX)
40 #define InitAnyIntLoadVars(PREFIX, pRasInfo)
41 #define InitAnyIntStoreVarsY(PREFIX, pRasInfo)
42 #define InitAnyIntStoreVarsX(PREFIX, pRasInfo)
43 #define NextAnyIntStoreVarsX(PREFIX)
44 #define NextAnyIntStoreVarsY(PREFIX)
45 
46 #define DeclareAnyIntPixelData(PREFIX)
47 
48 #define ExtractAnyIntPixelData(PIXEL, PREFIX)
49 
50 #define StoreAnyIntPixelData(pPix, x, pixel, PREFIX) \
51     (pPix)[x] = (pixel)
52 
53 #define CopyAnyIntPixelData(pSrc, sx, pDst, dx) \
54     (pDst)[dx] = (pSrc)[sx]
55 
56 #define XorCopyAnyIntPixelData(pSrc, pDst, x, xorpixel, XORPREFIX) \
57     (pDst)[x] ^= (pSrc)[x] ^ (xorpixel)
58 
59 #define XorAnyIntPixelData(srcpixel, SRCPREFIX, pDst, x, \
60                            xorpixel, XORPREFIX, mask, MASKPREFIX) \
61     (pDst)[x] ^= (((srcpixel) ^ (xorpixel)) & ~(mask))
62 
63 DECLARE_ISOCOPY_BLIT(AnyInt);
64 DECLARE_ISOSCALE_BLIT(AnyInt);
65 DECLARE_ISOXOR_BLIT(AnyInt);
66 DECLARE_CONVERT_BLIT(ByteIndexed, IntArgb);
67 DECLARE_SCALE_BLIT(ByteIndexed, IntArgb);
68 DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, IntArgb);
69 DECLARE_XPAR_SCALE_BLIT(ByteIndexedBm, IntArgb);
70 DECLARE_XPAR_BLITBG(ByteIndexedBm, IntArgb);
71 
72 #define REGISTER_ANYINT_ISOCOPY_BLIT(INTTYPE) \
73     REGISTER_ISOCOPY_BLIT(INTTYPE, AnyInt)
74 
75 #define REGISTER_ANYINT_ISOSCALE_BLIT(INTTYPE) \
76     REGISTER_ISOSCALE_BLIT(INTTYPE, AnyInt)
77 
78 #define REGISTER_ANYINT_ISOXOR_BLIT(INTTYPE) \
79     REGISTER_ISOXOR_BLIT(INTTYPE, AnyInt)
80