Path: blob/master/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.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 MTLLayer_h_Included26#define MTLLayer_h_Included27#import <Metal/Metal.h>28#import <QuartzCore/CAMetalLayer.h>29#include <CoreVideo/CVDisplayLink.h>30#import "common.h"3132@interface MTLLayer : CAMetalLayer33{34@private35jobject javaLayer;3637// intermediate buffer, used the RQ lock to synchronize38MTLContext* ctx;39float bufferWidth;40float bufferHeight;41id<MTLTexture> buffer;42int nextDrawableCount;43int topInset;44int leftInset;45CVDisplayLinkRef displayLink;46}4748@property (nonatomic) jobject javaLayer;49@property (readwrite, assign) MTLContext* ctx;50@property (readwrite, assign) float bufferWidth;51@property (readwrite, assign) float bufferHeight;52@property (readwrite, assign) id<MTLTexture> buffer;53@property (readwrite, assign) int nextDrawableCount;54@property (readwrite, assign) int topInset;55@property (readwrite, assign) int leftInset;56@property (readwrite, assign) CVDisplayLinkRef displayLink;5758- (id) initWithJavaLayer:(jobject)layer;5960- (void) blitTexture;61- (void) fillParallelogramCtxX:(jfloat)x62Y:(jfloat)y63DX1:(jfloat)dx164DY1:(jfloat)dy165DX2:(jfloat)dx266DY2:(jfloat)dy2;67- (void) blitCallback;68- (void) display;69- (void) redraw;70- (void) startDisplayLink;71- (void) stopDisplayLink;72@end7374#endif /* MTLLayer_h_Included */757677