| 4 | import io.github.humbleui.jwm.impl.RefCounted; |
| 5 | |
| 6 | public class LayerRaster extends RefCounted implements Layer { |
| 7 | @ApiStatus.Internal public Window _window; |
| 8 | @ApiStatus.Internal public int _width; |
| 9 | @ApiStatus.Internal public int _height; |
| 10 | |
| 11 | public LayerRaster() { |
| 12 | super(_nMake()); |
| 13 | } |
| 14 | |
| 15 | @Override |
| 16 | public void attach(Window window) { |
| 17 | assert _onUIThread() : "Should be run on UI thread"; |
| 18 | _nAttach(window); |
| 19 | _window = window; |
| 20 | } |
| 21 | |
| 22 | @Override |
| 23 | public void reconfigure() { |
| 24 | assert _onUIThread() : "Should be run on UI thread"; |
| 25 | _nReconfigure(); |
| 26 | } |
| 27 | |
| 28 | @Override |
| 29 | public void resize(int width, int height) { |
| 30 | assert _onUIThread() : "Should be run on UI thread"; |
| 31 | _width = width; |
| 32 | _height = height; |
| 33 | _nResize(width, height); |
| 34 | } |
| 35 | |
| 36 | @Override |
| 37 | public int getWidth() { |
| 38 | assert _onUIThread() : "Should be run on UI thread"; |
| 39 | return _width; |
| 40 | } |
| 41 | |
| 42 | @Override |
| 43 | public int getHeight() { |
| 44 | assert _onUIThread() : "Should be run on UI thread"; |
| 45 | return _height; |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public void swapBuffers() { |
| 50 | assert _onUIThread() : "Should be run on UI thread"; |
| 51 | _nSwapBuffers(); |
| 52 | } |
| 53 | |
| 54 | @Override |
| 55 | public void close() { |
| 56 | assert _onUIThread() : "Should be run on UI thread"; |
| 57 | assert !isClosed() : "Layer is already closed"; |
| 58 | _nClose(); |
| 59 | super.close(); |
| 60 | } |
| 61 | |
| 62 | public long getPixelsPtr() { |
| 63 | assert _onUIThread() : "Should be run on UI thread"; |
nothing calls this directly
no outgoing calls
no test coverage detected