author | jdv |
Fri, 21 Jun 2019 12:08:37 +0530 | |
branch | metal-prototype-branch |
changeset 57416 | e153174dba06 |
child 57426 | 68ec5c5ae381 |
permissions | -rw-r--r-- |
57416
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
1 |
/* |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
2 |
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
4 |
* |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
10 |
* |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
15 |
* accompanied this code). |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
16 |
* |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
20 |
* |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
23 |
* questions. |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
24 |
*/ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
25 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
26 |
#ifndef HEADLESS |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
27 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
28 |
#include <stdlib.h> |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
29 |
#include <string.h> |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
30 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
31 |
#include "sun_java2d_SunGraphics2D.h" |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
32 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
33 |
#include "MTLPaints.h" |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
34 |
#include "MTLVertexCache.h" |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
35 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
36 |
typedef struct _J2DVertex { |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
37 |
jfloat tx, ty; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
38 |
jubyte r, g, b, a; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
39 |
jfloat dx, dy; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
40 |
} J2DVertex; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
41 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
42 |
static J2DVertex *vertexCache = NULL; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
43 |
static jint vertexCacheIndex = 0; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
44 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
45 |
static jint maskCacheTexID = 0; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
46 |
static jint maskCacheIndex = 0; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
47 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
48 |
#define MTLVC_ADD_VERTEX(TX, TY, R, G, B, A, DX, DY) \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
49 |
do { \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
50 |
J2DVertex *v = &vertexCache[vertexCacheIndex++]; \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
51 |
v->tx = TX; \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
52 |
v->ty = TY; \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
53 |
v->r = R; \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
54 |
v->g = G; \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
55 |
v->b = B; \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
56 |
v->a = A; \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
57 |
v->dx = DX; \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
58 |
v->dy = DY; \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
59 |
} while (0) |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
60 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
61 |
#define MTLVC_ADD_QUAD(TX1, TY1, TX2, TY2, DX1, DY1, DX2, DY2, R, G, B, A) \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
62 |
do { \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
63 |
MTLVC_ADD_VERTEX(TX1, TY1, R, G, B, A, DX1, DY1); \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
64 |
MTLVC_ADD_VERTEX(TX2, TY1, R, G, B, A, DX2, DY1); \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
65 |
MTLVC_ADD_VERTEX(TX2, TY2, R, G, B, A, DX2, DY2); \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
66 |
MTLVC_ADD_VERTEX(TX1, TY2, R, G, B, A, DX1, DY2); \ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
67 |
} while (0) |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
68 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
69 |
jboolean |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
70 |
MTLVertexCache_InitVertexCache(MTLContext *mtlc) |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
71 |
{ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
72 |
//TODO |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
73 |
J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_InitVertexCache"); |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
74 |
return JNI_TRUE; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
75 |
} |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
76 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
77 |
void |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
78 |
MTLVertexCache_FlushVertexCache() |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
79 |
{ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
80 |
// TODO |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
81 |
J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_FlushVertexCache"); |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
82 |
vertexCacheIndex = 0; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
83 |
} |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
84 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
85 |
/** |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
86 |
* This method is somewhat hacky, but necessary for the foreseeable future. |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
87 |
* The problem is the way OpenGL handles color values in vertex arrays. When |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
88 |
* a vertex in a vertex array contains a color, and then the vertex array |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
89 |
* is rendered via glDrawArrays(), the global OpenGL color state is actually |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
90 |
* modified each time a vertex is rendered. This means that after all |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
91 |
* vertices have been flushed, the global OpenGL color state will be set to |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
92 |
* the color of the most recently rendered element in the vertex array. |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
93 |
* |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
94 |
* The reason this is a problem for us is that we do not want to flush the |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
95 |
* vertex array (in the case of mask/glyph operations) or issue a glEnd() |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
96 |
* (in the case of non-antialiased primitives) everytime the current color |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
97 |
* changes, which would defeat any benefit from batching in the first place. |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
98 |
* We handle this in practice by not calling CHECK/RESET_PREVIOUS_OP() when |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
99 |
* the simple color state is changing in MTLPaints_SetColor(). This is |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
100 |
* problematic for vertex caching because we may end up with the following |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
101 |
* situation, for example: |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
102 |
* SET_COLOR (orange) |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
103 |
* MASK_FILL |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
104 |
* MASK_FILL |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
105 |
* SET_COLOR (blue; remember, this won't cause a flush) |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
106 |
* FILL_RECT (this will cause the vertex array to be flushed) |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
107 |
* |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
108 |
* In this case, we would actually end up rendering an orange FILL_RECT, |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
109 |
* not a blue one as intended, because flushing the vertex cache flush would |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
110 |
* override the color state from the most recent SET_COLOR call. |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
111 |
* |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
112 |
* Long story short, the easiest way to resolve this problem is to call |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
113 |
* this method just after disabling the mask/glyph cache, which will ensure |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
114 |
* that the appropriate color state is restored. |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
115 |
*/ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
116 |
void |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
117 |
MTLVertexCache_RestoreColorState(MTLContext *mtlc) |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
118 |
{ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
119 |
// TODO |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
120 |
if (mtlc.paintState == sun_java2d_SunGraphics2D_PAINT_ALPHACOLOR) { |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
121 |
[mtlc setColor:mtlc.pixel]; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
122 |
} |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
123 |
} |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
124 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
125 |
static jboolean |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
126 |
MTLVertexCache_InitMaskCache() |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
127 |
{ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
128 |
// TODO |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
129 |
J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_InitMaskCache"); |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
130 |
return JNI_TRUE; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
131 |
} |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
132 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
133 |
void |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
134 |
MTLVertexCache_EnableMaskCache(MTLContext *mtlc) |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
135 |
{ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
136 |
// TODO |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
137 |
J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_EnableMaskCache"); |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
138 |
} |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
139 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
140 |
void |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
141 |
MTLVertexCache_DisableMaskCache(MTLContext *mtlc) |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
142 |
{ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
143 |
// TODO |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
144 |
J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_DisableMaskCache"); |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
145 |
maskCacheIndex = 0; |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
146 |
} |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
147 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
148 |
void |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
149 |
MTLVertexCache_AddMaskQuad(MTLContext *mtlc, |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
150 |
jint srcx, jint srcy, |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
151 |
jint dstx, jint dsty, |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
152 |
jint width, jint height, |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
153 |
jint maskscan, void *mask) |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
154 |
{ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
155 |
// TODO |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
156 |
} |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
157 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
158 |
void |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
159 |
MTLVertexCache_AddGlyphQuad(MTLContext *mtlc, |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
160 |
jfloat tx1, jfloat ty1, jfloat tx2, jfloat ty2, |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
161 |
jfloat dx1, jfloat dy1, jfloat dx2, jfloat dy2) |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
162 |
{ |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
163 |
// TODO |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
164 |
J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_AddGlyphQuad"); |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
165 |
} |
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
166 |
|
e153174dba06
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff
changeset
|
167 |
#endif /* !HEADLESS */ |