Path: blob/master/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.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 MTLVertexCache_h_Included26#define MTLVertexCache_h_Included27#include "j2d_md.h"28#include "MTLContext.h"29#include "fontscalerdefs.h"3031/**32* Constants that control the size of the vertex cache.33*/34#define MTLVC_MAX_INDEX 2503536/**37* Constants that control the size of the texture tile cache used for38* mask operations.39*/40#define MTLVC_MASK_CACHE_TILE_WIDTH 3241#define MTLVC_MASK_CACHE_TILE_HEIGHT 3242#define MTLVC_MASK_CACHE_TILE_SIZE \43(MTLVC_MASK_CACHE_TILE_WIDTH * MTLVC_MASK_CACHE_TILE_HEIGHT)4445#define MTLVC_MASK_CACHE_WIDTH_IN_TILES 846#define MTLVC_MASK_CACHE_HEIGHT_IN_TILES 44748#define MTLVC_MASK_CACHE_WIDTH_IN_TEXELS \49(MTLVC_MASK_CACHE_TILE_WIDTH * MTLVC_MASK_CACHE_WIDTH_IN_TILES)50#define MTLVC_MASK_CACHE_HEIGHT_IN_TEXELS \51(MTLVC_MASK_CACHE_TILE_HEIGHT * MTLVC_MASK_CACHE_HEIGHT_IN_TILES)5253/*54* We reserve one (fully opaque) tile in the upper-right corner for55* operations where the mask is null.56*/57#define MTLVC_MASK_CACHE_MAX_INDEX \58((MTLVC_MASK_CACHE_WIDTH_IN_TILES * MTLVC_MASK_CACHE_HEIGHT_IN_TILES) - 1)59#define MTLVC_MASK_CACHE_SPECIAL_TILE_X \60(MTLVC_MASK_CACHE_WIDTH_IN_TEXELS - MTLVC_MASK_CACHE_TILE_WIDTH)61#define MTLVC_MASK_CACHE_SPECIAL_TILE_Y \62(MTLVC_MASK_CACHE_HEIGHT_IN_TEXELS - MTLVC_MASK_CACHE_TILE_HEIGHT)6364/**65* Exported methods.66*/67jboolean MTLVertexCache_InitVertexCache();68void MTLVertexCache_FlushVertexCache(MTLContext *mtlc);69void MTLVertexCache_FlushGlyphVertexCache();70void MTLVertexCache_FreeVertexCache();7172void MTLVertexCache_EnableMaskCache(MTLContext *mtlc, BMTLSDOps *dstOps);73void MTLVertexCache_DisableMaskCache(MTLContext *mtlc);74void MTLVertexCache_AddMaskQuad(MTLContext *mtlc,75jint srcx, jint srcy,76jint dstx, jint dsty,77jint width, jint height,78jint maskscan, void *mask,79BMTLSDOps *dstOps);80void81MTLVertexCache_AddGlyphQuad(MTLContext *mtlc,82jfloat tx1, jfloat ty1, jfloat tx2, jfloat ty2,83jfloat dx1, jfloat dy1, jfloat dx2, jfloat dy2);84void MTLVertexCache_CreateSamplingEncoder(MTLContext *mtlc, BMTLSDOps *dstOps);85#endif /* MTLVertexCache_h_Included */868788