Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.h
41159 views
1
/*
2
* Copyright (c) 2019, 2021, 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
#ifndef MTLPaints_h_Included
27
#define MTLPaints_h_Included
28
29
#import <Metal/Metal.h>
30
#include "RenderOptions.h"
31
32
#define sun_java2d_SunGraphics2D_PAINT_UNDEFINED -1
33
34
@class MTLContext;
35
@class MTLComposite;
36
@class MTLClip;
37
@class MTLPipelineStatesStorage;
38
39
/**
40
* The MTLPaint class represents paint mode (color, gradient etc.)
41
*/
42
43
@interface MTLPaint : NSObject
44
45
- (id)initWithState:(jint)state;
46
- (BOOL)isEqual:(MTLPaint *)other; // used to compare requested with cached
47
- (NSString *)getDescription;
48
49
// For the current paint mode and passed composite (and flags):
50
// 1. Selects vertex+fragment shader (and corresponding pipelineDesc) and set pipelineState
51
// 2. Prepares corresponding buffers of vertex and fragment shaders
52
53
- (void)setPipelineState:(id <MTLRenderCommandEncoder>)encoder
54
context:(MTLContext *)mtlc
55
renderOptions:(const RenderOptions *)renderOptions
56
pipelineStateStorage:(MTLPipelineStatesStorage *)pipelineStateStorage;
57
58
59
- (void)setXorModePipelineState:(id <MTLRenderCommandEncoder>)encoder
60
context:(MTLContext *)mtlc
61
renderOptions:(const RenderOptions *)renderOptions
62
pipelineStateStorage:(MTLPipelineStatesStorage *)pipelineStateStorage;
63
@end
64
65
@interface MTLColorPaint : MTLPaint
66
- (id)initWithColor:(jint)color;
67
@property (nonatomic, readonly) jint color;
68
@end
69
70
@interface MTLBaseGradPaint : MTLPaint
71
- (id)initWithState:(jint)state
72
mask:(jboolean)useMask
73
cyclic:(jboolean)cyclic;
74
@end
75
76
@interface MTLGradPaint : MTLBaseGradPaint
77
78
- (id)initWithUseMask:(jboolean)useMask
79
cyclic:(jboolean)cyclic
80
p0:(jdouble)p0
81
p1:(jdouble)p1
82
p3:(jdouble)p3
83
pixel1:(jint)pixel1
84
pixel2:(jint)pixel2;
85
@end
86
87
@interface MTLBaseMultiGradPaint : MTLBaseGradPaint
88
89
- (id)initWithState:(jint)state
90
mask:(jboolean)useMask
91
linear:(jboolean)linear
92
cycleMethod:(jboolean)cycleMethod
93
numStops:(jint)numStops
94
fractions:(jfloat *)fractions
95
pixels:(jint *)pixels;
96
@end
97
98
@interface MTLLinearGradPaint : MTLBaseMultiGradPaint
99
100
- (id)initWithUseMask:(jboolean)useMask
101
linear:(jboolean)linear
102
cycleMethod:(jboolean)cycleMethod
103
numStops:(jint)numStops
104
p0:(jfloat)p0
105
p1:(jfloat)p1
106
p3:(jfloat)p3
107
fractions:(jfloat *)fractions
108
pixels:(jint *)pixels;
109
@end
110
111
@interface MTLRadialGradPaint : MTLBaseMultiGradPaint
112
113
- (id)initWithUseMask:(jboolean)useMask
114
linear:(jboolean)linear
115
cycleMethod:(jint)cycleMethod
116
numStops:(jint)numStops
117
m00:(jfloat)m00
118
m01:(jfloat)m01
119
m02:(jfloat)m02
120
m10:(jfloat)m10
121
m11:(jfloat)m11
122
m12:(jfloat)m12
123
focusX:(jfloat)focusX
124
fractions:(void *)fractions
125
pixels:(void *)pixels;
126
@end
127
128
@interface MTLTexturePaint : MTLPaint
129
130
- (id)initWithUseMask:(jboolean)useMask
131
textureID:(id <MTLTexture>)textureID
132
isOpaque:(jboolean)isOpaque
133
filter:(jboolean)filter
134
xp0:(jdouble)xp0
135
xp1:(jdouble)xp1
136
xp3:(jdouble)xp3
137
yp0:(jdouble)yp0
138
yp1:(jdouble)yp1
139
yp3:(jdouble)yp3;
140
@end
141
142
#endif /* MTLPaints_h_Included */
143
144