Path: blob/master/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLClip.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#import <limits.h>26#ifndef MTLClip_h_Included27#define MTLClip_h_Included2829#import <Metal/Metal.h>3031#include <jni.h>3233#include "MTLSurfaceDataBase.h"3435enum Clip {36NO_CLIP,37RECT_CLIP,38SHAPE_CLIP39};4041@class MTLContext;42@class MTLPipelineStatesStorage;4344/**45* The MTLClip class represents clip mode (rect or stencil)46* */4748@interface MTLClip : NSObject49@property (readonly) id<MTLTexture> stencilTextureRef;50@property (readonly) BOOL stencilMaskGenerationInProgress;51@property (readwrite ) BOOL stencilMaskGenerationStarted;52@property NSUInteger shapeX;53@property NSUInteger shapeY;54@property NSUInteger shapeWidth;55@property NSUInteger shapeHeight;56@property (readonly) BMTLSDOps* dstOps;5758- (id)init;59- (BOOL)isEqual:(MTLClip *)other; // used to compare requested with cached60- (void)copyFrom:(MTLClip *)other; // used to save cached6162- (BOOL)isShape;63- (BOOL)isRect;6465// returns null when clipType != RECT_CLIP66- (const MTLScissorRect *) getRect;6768- (void)reset;69- (void)resetStencilState;70- (void)setClipRectX1:(jint)x1 Y1:(jint)y1 X2:(jint)x2 Y2:(jint)y2;71- (void)beginShapeClip:(BMTLSDOps *)dstOps context:(MTLContext *)mtlc;72- (void)endShapeClip:(BMTLSDOps *)dstOps context:(MTLContext *)mtlc;7374- (void)setScissorOrStencil:(id<MTLRenderCommandEncoder>)encoder75destWidth:(NSUInteger)dw76destHeight:(NSUInteger)dh77device:(id<MTLDevice>)device;7879- (void)setMaskGenerationPipelineState:(id<MTLRenderCommandEncoder>)encoder80destWidth:(NSUInteger)dw81destHeight:(NSUInteger)dh82pipelineStateStorage:(MTLPipelineStatesStorage *)pipelineStateStorage;8384- (NSString *)getDescription __unused; // creates autorelease string85@end8687#endif // MTLClip_h_Included888990