Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/windows/native/sun/java2d/d3d/D3DMaskCache.h
32288 views
1
/*
2
* Copyright (c) 2007, 2008, 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 D3DMASKCACHE_H
27
#define D3DMASKCACHE_H
28
29
#include "jni.h"
30
#include "D3DContext.h"
31
32
/**
33
* Constants that control the size of the texture tile cache used for
34
* mask operations.
35
*/
36
#define D3D_MASK_CACHE_TILE_WIDTH 32
37
#define D3D_MASK_CACHE_TILE_HEIGHT 32
38
#define D3D_MASK_CACHE_TILE_SIZE \
39
(D3D_MASK_CACHE_TILE_WIDTH * D3D_MASK_CACHE_TILE_HEIGHT)
40
41
#define D3D_MASK_CACHE_WIDTH_IN_TILES 8
42
#define D3D_MASK_CACHE_HEIGHT_IN_TILES 4
43
44
#define D3D_MASK_CACHE_WIDTH_IN_TEXELS \
45
(D3D_MASK_CACHE_TILE_WIDTH * D3D_MASK_CACHE_WIDTH_IN_TILES)
46
#define D3D_MASK_CACHE_HEIGHT_IN_TEXELS \
47
(D3D_MASK_CACHE_TILE_HEIGHT * D3D_MASK_CACHE_HEIGHT_IN_TILES)
48
49
/*
50
* We reserve one (fully opaque) tile in the upper-right corner for
51
* operations where the mask is null.
52
*/
53
#define D3D_MASK_CACHE_MAX_INDEX \
54
((D3D_MASK_CACHE_WIDTH_IN_TILES * D3D_MASK_CACHE_HEIGHT_IN_TILES) - 1)
55
#define D3D_MASK_CACHE_SPECIAL_TILE_X \
56
(D3D_MASK_CACHE_WIDTH_IN_TEXELS - D3D_MASK_CACHE_TILE_WIDTH)
57
#define D3D_MASK_CACHE_SPECIAL_TILE_Y \
58
(D3D_MASK_CACHE_HEIGHT_IN_TEXELS - D3D_MASK_CACHE_TILE_HEIGHT)
59
60
class D3DContext;
61
62
class D3DMaskCache {
63
public:
64
HRESULT Init(D3DContext *pCtx);
65
void ReleaseDefPoolResources() {};
66
~D3DMaskCache();
67
HRESULT Enable();
68
HRESULT Disable();
69
HRESULT AddMaskQuad(int srcx, int srcy,
70
int dstx, int dsty,
71
int width, int height,
72
int maskscan, void *mask);
73
74
static
75
HRESULT CreateInstance(D3DContext *pCtx, D3DMaskCache **ppMaskCache);
76
77
private:
78
D3DMaskCache();
79
UINT maskCacheIndex;
80
D3DContext *pCtx;
81
};
82
83
#endif // D3DMASKCACHE_H
84
85