Path: blob/master/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.h
41159 views
/*1* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#ifndef MTLPaints_h_Included26#define MTLPaints_h_Included2728#import <Metal/Metal.h>29#include "RenderOptions.h"3031#define sun_java2d_SunGraphics2D_PAINT_UNDEFINED -13233@class MTLContext;34@class MTLComposite;35@class MTLClip;36@class MTLPipelineStatesStorage;3738/**39* The MTLPaint class represents paint mode (color, gradient etc.)40*/4142@interface MTLPaint : NSObject4344- (id)initWithState:(jint)state;45- (BOOL)isEqual:(MTLPaint *)other; // used to compare requested with cached46- (NSString *)getDescription;4748// For the current paint mode and passed composite (and flags):49// 1. Selects vertex+fragment shader (and corresponding pipelineDesc) and set pipelineState50// 2. Prepares corresponding buffers of vertex and fragment shaders5152- (void)setPipelineState:(id <MTLRenderCommandEncoder>)encoder53context:(MTLContext *)mtlc54renderOptions:(const RenderOptions *)renderOptions55pipelineStateStorage:(MTLPipelineStatesStorage *)pipelineStateStorage;565758- (void)setXorModePipelineState:(id <MTLRenderCommandEncoder>)encoder59context:(MTLContext *)mtlc60renderOptions:(const RenderOptions *)renderOptions61pipelineStateStorage:(MTLPipelineStatesStorage *)pipelineStateStorage;62@end6364@interface MTLColorPaint : MTLPaint65- (id)initWithColor:(jint)color;66@property (nonatomic, readonly) jint color;67@end6869@interface MTLBaseGradPaint : MTLPaint70- (id)initWithState:(jint)state71mask:(jboolean)useMask72cyclic:(jboolean)cyclic;73@end7475@interface MTLGradPaint : MTLBaseGradPaint7677- (id)initWithUseMask:(jboolean)useMask78cyclic:(jboolean)cyclic79p0:(jdouble)p080p1:(jdouble)p181p3:(jdouble)p382pixel1:(jint)pixel183pixel2:(jint)pixel2;84@end8586@interface MTLBaseMultiGradPaint : MTLBaseGradPaint8788- (id)initWithState:(jint)state89mask:(jboolean)useMask90linear:(jboolean)linear91cycleMethod:(jboolean)cycleMethod92numStops:(jint)numStops93fractions:(jfloat *)fractions94pixels:(jint *)pixels;95@end9697@interface MTLLinearGradPaint : MTLBaseMultiGradPaint9899- (id)initWithUseMask:(jboolean)useMask100linear:(jboolean)linear101cycleMethod:(jboolean)cycleMethod102numStops:(jint)numStops103p0:(jfloat)p0104p1:(jfloat)p1105p3:(jfloat)p3106fractions:(jfloat *)fractions107pixels:(jint *)pixels;108@end109110@interface MTLRadialGradPaint : MTLBaseMultiGradPaint111112- (id)initWithUseMask:(jboolean)useMask113linear:(jboolean)linear114cycleMethod:(jint)cycleMethod115numStops:(jint)numStops116m00:(jfloat)m00117m01:(jfloat)m01118m02:(jfloat)m02119m10:(jfloat)m10120m11:(jfloat)m11121m12:(jfloat)m12122focusX:(jfloat)focusX123fractions:(void *)fractions124pixels:(void *)pixels;125@end126127@interface MTLTexturePaint : MTLPaint128129- (id)initWithUseMask:(jboolean)useMask130textureID:(id <MTLTexture>)textureID131isOpaque:(jboolean)isOpaque132filter:(jboolean)filter133xp0:(jdouble)xp0134xp1:(jdouble)xp1135xp3:(jdouble)xp3136yp0:(jdouble)yp0137yp1:(jdouble)yp1138yp3:(jdouble)yp3;139@end140141#endif /* MTLPaints_h_Included */142143144