MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / resize_window

Function resize_window

src/main.cpp:389–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389void resize_window(MainStruct& mS) {
390 // Having intermediate surface allows for changing options more easily
391 mS.m->refresh_draw_surfaces();
392
393#ifdef USE_BACKEND_VULKAN
394 mS.vulkanWindowContext->resize(mS.m->window.size.x(), mS.m->window.size.y());
395#elif USE_BACKEND_OPENGL
396
397 GrGLFramebufferInfo info;
398 info.fFBOID = (GrGLuint)mS.defaultFBO;
399 info.fFormat = GL_RGBA8;
400
401 SkSurfaceProps props2;
402 mS.target = GrBackendRenderTargets::MakeGL(mS.m->window.size.x(), mS.m->window.size.y(), 0, mS.kStencilBits, info);
403 mS.m->window.nativeSurface = SkSurfaces::WrapBackendRenderTarget(mS.ctx.get(), mS.target, kBottomLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType, SkColorSpace::MakeSRGB(), &props2);
404
405 if(!mS.m->window.nativeSurface)
406 throw std::runtime_error("[resize_window] Could not make surface");
407 mS.canvas = mS.m->window.nativeSurface->getCanvas();
408 if(!mS.canvas)
409 throw std::runtime_error("[resize_window] No canvas made");
410
411#endif
412}
413
414#ifdef __EMSCRIPTEN__
415const char* emscripten_before_unload(int eventType, const void *reserved, void *userData) {

Callers 2

SDL_AppInitFunction · 0.85
main.cppFile · 0.85

Calls 5

refresh_draw_surfacesMethod · 0.80
resizeMethod · 0.45
xMethod · 0.45
yMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected