-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathLayerRaster.java
More file actions
84 lines (70 loc) · 2.33 KB
/
LayerRaster.java
File metadata and controls
84 lines (70 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package io.github.humbleui.jwm;
import org.jetbrains.annotations.ApiStatus;
import io.github.humbleui.jwm.impl.RefCounted;
public class LayerRaster extends RefCounted implements Layer {
@ApiStatus.Internal public Window _window;
@ApiStatus.Internal public int _width;
@ApiStatus.Internal public int _height;
public LayerRaster() {
super(_nMake());
}
@Override
public void attach(Window window) {
assert _onUIThread() : "Should be run on UI thread";
_nAttach(window);
_window = window;
}
@Override
public void reconfigure() {
assert _onUIThread() : "Should be run on UI thread";
_nReconfigure();
}
@Override
public void resize(int width, int height) {
assert _onUIThread() : "Should be run on UI thread";
_width = width;
_height = height;
_nResize(width, height);
}
@Override
public int getWidth() {
assert _onUIThread() : "Should be run on UI thread";
return _width;
}
@Override
public int getHeight() {
assert _onUIThread() : "Should be run on UI thread";
return _height;
}
@Override
public void swapBuffers() {
assert _onUIThread() : "Should be run on UI thread";
_nSwapBuffers();
}
@Override
public void close() {
assert _onUIThread() : "Should be run on UI thread";
assert !isClosed() : "Layer is already closed";
_nClose();
super.close();
}
public long getPixelsPtr() {
assert _onUIThread() : "Should be run on UI thread";
return _nGetPixelsPtr();
}
public int getRowBytes() {
assert _onUIThread() : "Should be run on UI thread";
return _nGetRowBytes();
}
@ApiStatus.Internal public static boolean _onUIThread() {
return App._onUIThread();
}
@ApiStatus.Internal public static native long _nMake();
@ApiStatus.Internal public native void _nAttach(Window window);
@ApiStatus.Internal public native void _nReconfigure();
@ApiStatus.Internal public native void _nResize(int width, int height);
@ApiStatus.Internal public native void _nSwapBuffers();
@ApiStatus.Internal public native long _nGetPixelsPtr();
@ApiStatus.Internal public native int _nGetRowBytes();
@ApiStatus.Internal public native void _nClose();
}