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/MTLVertexCache.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
#ifndef MTLVertexCache_h_Included
27
#define MTLVertexCache_h_Included
28
#include "j2d_md.h"
29
#include "MTLContext.h"
30
#include "fontscalerdefs.h"
31
32
/**
33
* Constants that control the size of the vertex cache.
34
*/
35
#define MTLVC_MAX_INDEX 250
36
37
/**
38
* Constants that control the size of the texture tile cache used for
39
* mask operations.
40
*/
41
#define MTLVC_MASK_CACHE_TILE_WIDTH 32
42
#define MTLVC_MASK_CACHE_TILE_HEIGHT 32
43
#define MTLVC_MASK_CACHE_TILE_SIZE \
44
(MTLVC_MASK_CACHE_TILE_WIDTH * MTLVC_MASK_CACHE_TILE_HEIGHT)
45
46
#define MTLVC_MASK_CACHE_WIDTH_IN_TILES 8
47
#define MTLVC_MASK_CACHE_HEIGHT_IN_TILES 4
48
49
#define MTLVC_MASK_CACHE_WIDTH_IN_TEXELS \
50
(MTLVC_MASK_CACHE_TILE_WIDTH * MTLVC_MASK_CACHE_WIDTH_IN_TILES)
51
#define MTLVC_MASK_CACHE_HEIGHT_IN_TEXELS \
52
(MTLVC_MASK_CACHE_TILE_HEIGHT * MTLVC_MASK_CACHE_HEIGHT_IN_TILES)
53
54
/*
55
* We reserve one (fully opaque) tile in the upper-right corner for
56
* operations where the mask is null.
57
*/
58
#define MTLVC_MASK_CACHE_MAX_INDEX \
59
((MTLVC_MASK_CACHE_WIDTH_IN_TILES * MTLVC_MASK_CACHE_HEIGHT_IN_TILES) - 1)
60
#define MTLVC_MASK_CACHE_SPECIAL_TILE_X \
61
(MTLVC_MASK_CACHE_WIDTH_IN_TEXELS - MTLVC_MASK_CACHE_TILE_WIDTH)
62
#define MTLVC_MASK_CACHE_SPECIAL_TILE_Y \
63
(MTLVC_MASK_CACHE_HEIGHT_IN_TEXELS - MTLVC_MASK_CACHE_TILE_HEIGHT)
64
65
/**
66
* Exported methods.
67
*/
68
jboolean MTLVertexCache_InitVertexCache();
69
void MTLVertexCache_FlushVertexCache(MTLContext *mtlc);
70
void MTLVertexCache_FlushGlyphVertexCache();
71
void MTLVertexCache_FreeVertexCache();
72
73
void MTLVertexCache_EnableMaskCache(MTLContext *mtlc, BMTLSDOps *dstOps);
74
void MTLVertexCache_DisableMaskCache(MTLContext *mtlc);
75
void MTLVertexCache_AddMaskQuad(MTLContext *mtlc,
76
jint srcx, jint srcy,
77
jint dstx, jint dsty,
78
jint width, jint height,
79
jint maskscan, void *mask,
80
BMTLSDOps *dstOps);
81
void
82
MTLVertexCache_AddGlyphQuad(MTLContext *mtlc,
83
jfloat tx1, jfloat ty1, jfloat tx2, jfloat ty2,
84
jfloat dx1, jfloat dy1, jfloat dx2, jfloat dy2);
85
void MTLVertexCache_CreateSamplingEncoder(MTLContext *mtlc, BMTLSDOps *dstOps);
86
#endif /* MTLVertexCache_h_Included */
87
88