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/MTLClip.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
#import <limits.h>
27
#ifndef MTLClip_h_Included
28
#define MTLClip_h_Included
29
30
#import <Metal/Metal.h>
31
32
#include <jni.h>
33
34
#include "MTLSurfaceDataBase.h"
35
36
enum Clip {
37
NO_CLIP,
38
RECT_CLIP,
39
SHAPE_CLIP
40
};
41
42
@class MTLContext;
43
@class MTLPipelineStatesStorage;
44
45
/**
46
* The MTLClip class represents clip mode (rect or stencil)
47
* */
48
49
@interface MTLClip : NSObject
50
@property (readonly) id<MTLTexture> stencilTextureRef;
51
@property (readonly) BOOL stencilMaskGenerationInProgress;
52
@property (readwrite ) BOOL stencilMaskGenerationStarted;
53
@property NSUInteger shapeX;
54
@property NSUInteger shapeY;
55
@property NSUInteger shapeWidth;
56
@property NSUInteger shapeHeight;
57
@property (readonly) BMTLSDOps* dstOps;
58
59
- (id)init;
60
- (BOOL)isEqual:(MTLClip *)other; // used to compare requested with cached
61
- (void)copyFrom:(MTLClip *)other; // used to save cached
62
63
- (BOOL)isShape;
64
- (BOOL)isRect;
65
66
// returns null when clipType != RECT_CLIP
67
- (const MTLScissorRect *) getRect;
68
69
- (void)reset;
70
- (void)resetStencilState;
71
- (void)setClipRectX1:(jint)x1 Y1:(jint)y1 X2:(jint)x2 Y2:(jint)y2;
72
- (void)beginShapeClip:(BMTLSDOps *)dstOps context:(MTLContext *)mtlc;
73
- (void)endShapeClip:(BMTLSDOps *)dstOps context:(MTLContext *)mtlc;
74
75
- (void)setScissorOrStencil:(id<MTLRenderCommandEncoder>)encoder
76
destWidth:(NSUInteger)dw
77
destHeight:(NSUInteger)dh
78
device:(id<MTLDevice>)device;
79
80
- (void)setMaskGenerationPipelineState:(id<MTLRenderCommandEncoder>)encoder
81
destWidth:(NSUInteger)dw
82
destHeight:(NSUInteger)dh
83
pipelineStateStorage:(MTLPipelineStatesStorage *)pipelineStateStorage;
84
85
- (NSString *)getDescription __unused; // creates autorelease string
86
@end
87
88
#endif // MTLClip_h_Included
89
90