1/*
2 * Copyright (c) 2001, 2005, 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 "AnyInt.h"
27#include "IntArgbBm.h"
28#include "AlphaMacros.h"
29
30#include "IntArgb.h"
31#include "IntArgbPre.h"
32#include "ByteIndexed.h"
33
34/*
35 * This file declares, registers, and defines the various graphics
36 * primitive loops to manipulate surfaces of type "IntArgbBm".
37 *
38 * See also LoopMacros.h
39 */
40
41RegisterFunc RegisterIntArgbBm;
42
43DECLARE_CONVERT_BLIT(IntArgbBm, IntArgb);
44DECLARE_CONVERT_BLIT(IntArgb, IntArgbBm);
45DECLARE_CONVERT_BLIT(ByteIndexed, IntArgbBm);
46DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, IntArgbBm);
47
48DECLARE_SCALE_BLIT(IntArgb, IntArgbBm);
49DECLARE_SCALE_BLIT(ByteIndexed, IntArgbBm);
50DECLARE_XPAR_SCALE_BLIT(ByteIndexedBm, IntArgbBm);
51
52DECLARE_XPAR_BLITBG(ByteIndexedBm, IntArgbBm);
53
54DECLARE_XOR_BLIT(IntArgb, IntArgbBm);
55DECLARE_ALPHA_MASKFILL(IntArgbBm);
56DECLARE_ALPHA_MASKBLIT(IntArgb, IntArgbBm);
57DECLARE_ALPHA_MASKBLIT(IntArgbPre, IntArgbBm);
58DECLARE_SOLID_DRAWGLYPHLISTAA(IntArgbBm);
59DECLARE_SOLID_DRAWGLYPHLISTLCD(IntArgbBm);
60
61DECLARE_TRANSFORMHELPER_FUNCS(IntArgbBm);
62
63NativePrimitive IntArgbBmPrimitives[] = {
64 REGISTER_ANYINT_ISOCOPY_BLIT(IntArgbBm),
65 REGISTER_ANYINT_ISOSCALE_BLIT(IntArgbBm),
66 REGISTER_ANYINT_ISOXOR_BLIT(IntArgbBm),
67 REGISTER_CONVERT_BLIT(IntArgbBm, IntArgb),
68 REGISTER_CONVERT_BLIT(IntArgb, IntArgbBm),
69 REGISTER_CONVERT_BLIT(ByteIndexed, IntArgbBm),
70 REGISTER_SCALE_BLIT(IntArgb, IntArgbBm),
71 REGISTER_SCALE_BLIT(ByteIndexed, IntArgbBm),
72 REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, IntArgbBm),
73 REGISTER_XPAR_SCALE_BLIT(ByteIndexedBm, IntArgbBm),
74 REGISTER_XPAR_BLITBG(ByteIndexedBm, IntArgbBm),
75
76 REGISTER_XOR_BLIT(IntArgb, IntArgbBm),
77 REGISTER_ALPHA_MASKFILL(IntArgbBm),
78 REGISTER_ALPHA_MASKBLIT(IntArgb, IntArgbBm),
79 REGISTER_ALPHA_MASKBLIT(IntArgbPre, IntArgbBm),
80 REGISTER_SOLID_DRAWGLYPHLISTAA(IntArgbBm),
81 REGISTER_SOLID_DRAWGLYPHLISTLCD(IntArgbBm),
82
83 REGISTER_TRANSFORMHELPER_FUNCS(IntArgbBm),
84};
85
86jboolean RegisterIntArgbBm(JNIEnv *env)
87{
88 return RegisterPrimitives(env, IntArgbBmPrimitives,
89 ArraySize(IntArgbBmPrimitives));
90}
91
92jint PixelForIntArgbBm(SurfaceDataRasInfo *pRasInfo, jint rgb)
93{
94 return (rgb | ((rgb >> 31) << 24));
95}
96
97DEFINE_CONVERT_BLIT(IntArgbBm, IntArgb, 1IntArgb)
98
99DEFINE_CONVERT_BLIT(IntArgb, IntArgbBm, 1IntArgb)
100
101DEFINE_CONVERT_BLIT(ByteIndexed, IntArgbBm, 1IntArgb)
102
103DEFINE_SCALE_BLIT(IntArgb, IntArgbBm, 1IntArgb)
104
105DEFINE_SCALE_BLIT(ByteIndexed, IntArgbBm, 1IntArgb)
106
107DEFINE_XPAR_CONVERT_BLIT_LUT8(ByteIndexedBm, IntArgbBm, PreProcessLut)
108
109DEFINE_XPAR_SCALE_BLIT_LUT8(ByteIndexedBm, IntArgbBm, PreProcessLut)
110
111DEFINE_XPAR_BLITBG_LUT8(ByteIndexedBm, IntArgbBm, PreProcessLut)
112
113DEFINE_XOR_BLIT(IntArgb, IntArgbBm, AnyInt)
114
115DEFINE_ALPHA_MASKFILL(IntArgbBm, 4ByteArgb)
116
117DEFINE_ALPHA_MASKBLIT(IntArgb, IntArgbBm, 4ByteArgb)
118
119DEFINE_ALPHA_MASKBLIT(IntArgbPre, IntArgbBm, 4ByteArgb)
120
121DEFINE_SOLID_DRAWGLYPHLISTAA(IntArgbBm, 4ByteArgb)
122
123DEFINE_SOLID_DRAWGLYPHLISTLCD(IntArgbBm, 4ByteArgb)
124
125DEFINE_TRANSFORMHELPERS(IntArgbBm)
126