MCPcopy Create free account
hub / github.com/HumbleUI/Skija / onResize

Method onResize

examples/kwinit/src_java/Main.java:135–161  ·  view source on GitHub ↗
(int width, int height)

Source from the content-addressed store, hash-verified

133 }
134
135 public void onResize(int width, int height) {
136 this.width = width;
137 this.height = height;
138
139 if (surface != null)
140 surface.close();
141 if (renderTarget != null)
142 renderTarget.close();
143
144 renderTarget = BackendRenderTarget.makeGL(
145 (int) (width * scale),
146 (int) (height * scale),
147 /*samples*/0,
148 /*stencil*/8,
149 /*fbId*/0,
150 FramebufferFormat.GR_GL_RGBA8);
151
152 surface = Surface.makeFromBackendRenderTarget(
153 context,
154 renderTarget,
155 SurfaceOrigin.BOTTOM_LEFT,
156 ColorType.RGBA_8888,
157 ColorSpace.getDisplayP3(), // TODO load monitor profile
158 new SurfaceProps(PixelGeometry.RGB_H));
159
160 canvas = surface.getCanvas();
161 }
162
163 public void onModifiersChange(boolean shift, boolean ctrl, boolean alt, boolean logo) {
164 this.shift = shift;

Callers 2

runMethod · 0.95
handleUserEventMethod · 0.95

Calls 5

makeGLMethod · 0.95
getDisplayP3Method · 0.95
getCanvasMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected