/* EGLBoolean eglReleaseThread ( void ) */ static jboolean android_eglReleaseThread (JNIEnv *_env, jobject _this) { EGLBoolean _returnValue = (EGLBoolean) 0; _returnValue = eglReleaseThread(); return (jboolean)_returnValue; }
void eng_window_free(Evas_GL_Wl_Window *gw) { int ref = 0; win_count--; eng_window_use(gw); if (gw == _evas_gl_wl_window) _evas_gl_wl_window = NULL; // if (gw->win) wl_egl_window_destroy(gw->win); if (gw->gl_context) { ref = gw->gl_context->references - 1; evas_gl_common_context_free(gw->gl_context); } if (gw->egl_surface[0] != EGL_NO_SURFACE) eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (ref == 0) { if (context) eglDestroyContext(gw->egl_disp, context); context = EGL_NO_CONTEXT; /* NB: This is causing an unknown hang when we run elm apps as * wayland clients inside the weston compositor */ /* eglTerminate(gw->egl_disp); */ eglReleaseThread(); } free(gw); }
static void MainL() { CActiveScheduler* sched=NULL; sched=new(ELeave) CActiveScheduler; CActiveScheduler::Install(sched); #ifdef __WINS__ // Construct and destroy a process-wide state object in emulator builds. // This will cause initialisation of PLS for EGL and SgDriver // and allow checking for leaks in tests if(!eglReleaseThread()) { // Call to eglReleaseThread failed User::Leave(KErrGeneral); } #endif //__WINS__ CTestEGLRefServer* server = NULL; // Create the CTestServer derived server TRAPD(err, server = CTestEGLRefServer::NewL()); if(!err) { // Sync with the client and enter the active scheduler RProcess::Rendezvous(KErrNone); sched->Start(); } delete server; delete sched; }
// Release OpenGL resources void closeGL() { #ifdef PLATFORM_RPI eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (surface != EGL_NO_SURFACE && eglDestroySurface(display, surface)) { printf("Surface destroyed ok\n"); } if (context != EGL_NO_CONTEXT && eglDestroyContext(display, context)) { printf("Main context destroyed ok\n"); } if (display != EGL_NO_DISPLAY && eglTerminate(display)) { printf("Display terminated ok\n"); } if (eglReleaseThread()) { printf("EGL thread resources released ok\n"); } if (vc_dispmanx_display_close(dispman_display) == 0) { printf("Dispmanx display rleased ok\n"); } bcm_host_deinit(); #else // ---------------------------------------- using GLFW // glfwTerminate(); #endif }
/* * Releases EGL. How we do that depends on the type of test we're * running. */ bool eglRelease_l() { if (mEglDisplay == EGL_NO_DISPLAY) { ALOGW("No display to release"); return false; } switch (mTestType) { case TEST_CORRECT: eglTerminate(mEglDisplay); eglReleaseThread(); break; case TEST_NO_RELEASE_CURRENT: eglDestroyContext(mEglDisplay, mEglContext); eglDestroySurface(mEglDisplay, mEglSurface); eglTerminate(mEglDisplay); break; default: ALOGE("Unknown test type %d", mTestType); break; } int err = eglGetError(); if (err != EGL_SUCCESS) { ALOGW("eglRelease failed: 0x%x", err); return false; } return true; }
/** * Free SdkEnv resource */ int freeSdkEnv(SdkEnv *env) { if (NULL == env) { return -1; } if (env->egl.display != EGL_NO_DISPLAY) { eglMakeCurrent(env->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (env->egl.context != EGL_NO_CONTEXT) { eglDestroyContext(env->egl.display, env->egl.context); } if (env->egl.surface != EGL_NO_SURFACE) { eglDestroySurface(env->egl.display, env->egl.surface); } eglTerminate(env->egl.display); eglReleaseThread(); } env->egl.display = EGL_NO_DISPLAY; env->egl.context = EGL_NO_CONTEXT; env->egl.surface = EGL_NO_SURFACE; if (ACTIVE_PATH == env->userData.active && NULL != env->userData.inputPath) { free (env->userData.inputPath); env->userData.inputPath = NULL; } if (ACTIVE_PARAM == env->userData.active && NULL != env->userData.param) { Bitmap_t *img = (Bitmap_t *) env->userData.param; freeBitmap (img); env->userData.param = NULL; } if (NULL != env->userCmd) { freeChrbuf (env->userCmd); env->userCmd = NULL; } if (NULL != env->userData.inputPath) { free (env->userData.inputPath); env->userData.inputPath = NULL; } if (NULL != env->userData.outputPath) { free (env->userData.outputPath); env->userData.outputPath = NULL; } releaseShader(env); if (OFF_SCREEN_RENDER == env->type) { glDeleteFramebuffers (1, &env->handle.fboIdx); glDeleteTextures (1, &env->handle.texture2Idx); } freeEffectCmd(&env->effectCmd); free (env); }
static void gst_gl_context_egl_destroy_context (GstGLContext * context) { GstGLContextEGL *egl; egl = GST_GL_CONTEXT_EGL (context); gst_gl_context_egl_activate (context, FALSE); if (egl->egl_surface) { eglDestroySurface (egl->egl_display, egl->egl_surface); egl->egl_surface = EGL_NO_SURFACE; } if (egl->egl_context) { eglDestroyContext (egl->egl_display, egl->egl_context); egl->egl_context = NULL; } egl->window_handle = 0; eglReleaseThread (); if (egl->display_egl) { gst_object_unref (egl->display_egl); egl->display_egl = NULL; } }
window_t::~window_t() { eglMakeCurrent(egldisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); assert(eglGetError() == EGL_SUCCESS); eglTerminate(egldisplay); assert(eglGetError() == EGL_SUCCESS); eglReleaseThread(); }
void GLCVUtils::GLEnd (void) { eglMakeCurrent(egldisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglTerminate(egldisplay); eglReleaseThread (); return; }
void fini_egl(struct display *display) { /* Required, otherwise segfault in egl_dri2.c: dri2_make_current() * on eglReleaseThread(). */ eglMakeCurrent(display->egl.dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglTerminate(display->egl.dpy); eglReleaseThread(); }
void deinit(void) { PS_destruct(tiger); eglMakeCurrent(egldisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); assert(eglGetError() == EGL_SUCCESS); eglTerminate(egldisplay); assert(eglGetError() == EGL_SUCCESS); eglReleaseThread(); }
// ----------------------------------------------------------------------------- WindowOffscreenEGL::~WindowOffscreenEGL() { if (m_stream != EGL_NO_STREAM_KHR) eglDestroyStreamKHR(m_display, m_stream); if (m_surface != EGL_NO_SURFACE) eglDestroySurface(m_display, m_surface); eglDestroyContext(m_display, m_context); eglTerminate(m_display); eglReleaseThread(); }
static void egl_state_destroy(struct egl_state *egl) { /* Required, otherwise segfault in egl_dri2.c: dri2_make_current() * on eglReleaseThread(). */ eglMakeCurrent(egl->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglTerminate(egl->dpy); eglReleaseThread(); free(egl); }
void CCEGLView::release() { screen_stop_events(m_screenContext); bps_shutdown(); if (m_eglDisplay != EGL_NO_DISPLAY) { eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); } if (m_eglSurface != EGL_NO_SURFACE) { eglDestroySurface(m_eglDisplay, m_eglSurface); m_eglSurface = EGL_NO_SURFACE; } if (m_eglContext != EGL_NO_CONTEXT) { eglDestroyContext(m_eglDisplay, m_eglContext); m_eglContext = EGL_NO_CONTEXT; } if (m_eglDisplay != EGL_NO_DISPLAY) { eglTerminate(m_eglDisplay); m_eglDisplay = EGL_NO_DISPLAY; } if (m_screenWindow) { screen_destroy_window(m_screenWindow); m_screenWindow = NULL; } if (m_screenEvent) { screen_destroy_event(m_screenEvent); m_screenEvent = NULL; } if (m_screenContext) { screen_destroy_context(m_screenContext); m_screenContext = NULL; } eglReleaseThread(); m_isGLInitialized = false; exit(0); }
void deinit(void) { printf("Cleaning up...\n"); eglMakeCurrent(egldisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); assert(eglGetError() == EGL_SUCCESS); eglDestroyContext(egldisplay, eglcontext); eglDestroySurface(egldisplay, eglsurface); fsl_destroywindow(eglNativeWindow, eglNativeDisplayType); eglTerminate(egldisplay); assert(eglGetError() == EGL_SUCCESS); eglReleaseThread(); }
void CWsTop::DeleteStaticsL() { iShuttingDown=ETrue; delete iRenderOrientationTracker; CClick::DeleteStatics(); TWsPointer::Stop(); CWsClient::DeleteStatics(); // delete iShellStarter; iServer->DestroySessionsForShutdown(); CWsBackedUpWindow::StaticDestroy(); delete iShell; DisableLogging(); CEventQueue::DeleteStaticsL(); CWsSpriteBase::DeleteStatics(); CWsGc::DeleteStatics(); CPlaybackGc::DeleteStatics(); CWsAnimDll::DeleteStatics(); CWsFontCache::DestroyInstance(); iScreens->ResetAndDestroy(); delete iScreens; delete iServer; TWindowServerEvent::DeleteStatics(); // Free singletons on WServ heap created by libraries. Must be called // BEFORE iPluginManager is deleted otherwise the library code could have // been unloaded. DeleteSingleton(KOpenWfcImplCleanupKey); DeleteSingleton(KOpenWfcInteropCleanupKey); eglReleaseThread(); if (!iDoHeapCheckAndRestart) { RFbsSession::GetSession()->SendCommand(RFbsSession_SendCommand_ShutDownMessage); //This line is just being tidy, never really does anything useful. } RFbsSession::Disconnect(); iDebugLib.Close(); iTimer.Close(); TWsPointer::DeleteStatics(); delete TheActiveScheduler; // iPluginManager is not created in InitStaticsL because plugins need to be loaded // before E32Main's loop for EcomSession allocations issues delete iPluginManager; }
static void mali_uninit(struct MPGLContext *ctx) { struct priv *p = ctx->priv; if (p->egl_surface) { eglMakeCurrent(p->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroySurface(p->egl_display, p->egl_surface); } if (p->egl_context) eglDestroyContext(p->egl_display, p->egl_context); eglReleaseThread(); }
static void releaseGlContext_wayland(MPGLContext *ctx) { GL *gl = ctx->gl; struct egl_context * egl_ctx = ctx->priv; gl->Finish(); eglMakeCurrent(egl_ctx->egl.dpy, NULL, NULL, EGL_NO_CONTEXT); eglDestroyContext(egl_ctx->egl.dpy, egl_ctx->egl.ctx); eglTerminate(egl_ctx->egl.dpy); eglReleaseThread(); wl_egl_window_destroy(egl_ctx->egl_window); egl_ctx->egl.ctx = NULL; }
void BlackberryMain::killDisplays() { for (int i = 0; i < ndisplays; i++) { killDisplay(i, true); } if (egl_cont != EGL_NO_CONTEXT) { eglDestroyContext(egl_disp[0], egl_cont); egl_cont = EGL_NO_CONTEXT; } free(egl_disp); free(egl_surf); eglReleaseThread(); free(screen_dpy); }
static void _evas_bufmgr_egl_shutdown(void) { #ifdef HAVE_DRM_HW_ACCEL if (_ebi->egl.disp) { eglMakeCurrent(_ebi->egl.disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglTerminate(_ebi->egl.disp); eglReleaseThread(); } #endif }
EglWaylandBackend::~EglWaylandBackend() { cleanupGL(); checkGLError("Cleanup"); doneCurrent(); eglDestroyContext(m_display, m_context); eglDestroySurface(m_display, m_surface); eglTerminate(m_display); eglReleaseThread(); if (m_overlay) { wl_egl_window_destroy(m_overlay); } }
void AbstractEglBackend::cleanup() { #if HAVE_WAYLAND if (eglUnbindWaylandDisplayWL && eglDisplay() != EGL_NO_DISPLAY) { eglUnbindWaylandDisplayWL(eglDisplay(), *(WaylandServer::self()->display())); } #endif cleanupGL(); doneCurrent(); eglDestroyContext(m_display, m_context); cleanupSurfaces(); eglTerminate(m_display); eglReleaseThread(); }
static void releaseGlContext_wayland(MPGLContext *ctx) { GL *gl = ctx->gl; struct vo_wayland_state *wl = ctx->vo->wayland; gl->Finish(); eglReleaseThread(); wl_egl_window_destroy(wl->egl_context.egl_window); eglDestroySurface(wl->egl_context.egl.dpy, wl->egl_context.egl_surface); eglMakeCurrent(wl->egl_context.egl.dpy, NULL, NULL, EGL_NO_CONTEXT); eglDestroyContext(wl->egl_context.egl.dpy, wl->egl_context.egl.ctx); eglTerminate(wl->egl_context.egl.dpy); wl->egl_context.egl.ctx = NULL; }
int main(void) { EGLDisplay display; EGLContext context; EGLConfig config; EGLSurface surface; EGLBoolean result; EGLint num_config; static const EGLint attribute_list[] = { EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_NONE }; display = eglGetDisplay(EGL_DEFAULT_DISPLAY); result = eglInitialize(display, NULL, NULL); assert(result != EGL_FALSE); eglBindAPI(EGL_OPENVG_API); result = eglChooseConfig(display, attribute_list, &config, 1, &num_config); assert(result != EGL_FALSE); context = eglCreateContext(display, config, NULL, NULL); assert(context != EGL_NO_CONTEXT); surface = eglCreatePbufferSurface(display, config, NULL); eglMakeCurrent(display, surface, surface, context); display_info("Vendor", VG_VENDOR); display_info("Renderer", VG_RENDERER); display_info("Version", VG_VERSION); display_info("Extensions", VG_EXTENSIONS); eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroyContext(display, context); eglTerminate(display); eglReleaseThread(); return 0; }
static void rpi_uninit(struct ra_ctx *ctx) { struct priv *p = ctx->priv; ra_gl_ctx_uninit(ctx); vc_tv_unregister_callback_full(tv_callback, ctx); destroy_dispmanx(ctx); if (p->egl_context) eglDestroyContext(p->egl_display, p->egl_context); p->egl_context = EGL_NO_CONTEXT; eglReleaseThread(); p->egl_display = EGL_NO_DISPLAY; }
void deinitEGL(void) { #ifndef TEST_LOCKSURFACE glDeleteTextures (1, &GLOBALS->tex); #endif eglMakeCurrent (GLOBALS->eglDisplay, KD_NULL, KD_NULL, KD_NULL); #ifndef TEST_LOCKSURFACE eglDestroyContext (GLOBALS->eglDisplay, GLOBALS->eglContextOpenGLES); #endif eglDestroySurface (GLOBALS->eglDisplay, GLOBALS->eglWindowSurface); eglTerminate (GLOBALS->eglDisplay); eglReleaseThread (); }
static void waylandgl_uninit(MPGLContext *ctx) { struct vo_wayland_state *wl = ctx->vo->wayland; if (wl->egl_context.egl.ctx) { eglReleaseThread(); wl_egl_window_destroy(wl->egl_context.egl_window); eglDestroySurface(wl->egl_context.egl.dpy, wl->egl_context.egl_surface); eglMakeCurrent(wl->egl_context.egl.dpy, NULL, NULL, EGL_NO_CONTEXT); eglDestroyContext(wl->egl_context.egl.dpy, wl->egl_context.egl.ctx); } eglTerminate(wl->egl_context.egl.dpy); wl->egl_context.egl.ctx = NULL; vo_wayland_uninit(ctx->vo); }
void CEglTest_TestStep_StressLoad::LoadGpuProcessorL() { CSurface *surface = CSurface::SurfaceFactoryL(ESurfTypeEglWindow); CleanupStack::PushL(surface); surface->CreateL(EStandard128sqSurface, TPoint(128, 128)); TRgb bg = TRgb(0x55, 0x88, 0xff); // Cyan/turqoise-ish. TRgb fg = TRgb(0xff, 0x11, 0x22); // Red (sort of) while(!__e32_atomic_load_acq32(&iStopThreadFlag[EThreadLoadGpuProcessor])) { surface->DrawContentL(bg); surface->DrawComplexL(fg); surface->SubmitContent(ETrue); } CleanupStack::PopAndDestroy(surface); eglReleaseThread(); }
EGLBoolean __xegl_eglReleaseThread(const char *file, int line) { EGLBoolean ret; ret = eglReleaseThread(); __xegl_check_error(file, line, "eglReleaseThread"); if (ret != EGL_TRUE) { fprintf(stderr, "%s:%i: eglReleaseThread(): returned EGL_FALSE\n", file, line); __xegl_on_error(); } return (ret); }
void mp_egl_rpi_destroy(struct mp_egl_rpi *p) { if (p->egl_display) { eglMakeCurrent(p->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); } if (p->egl_surface) eglDestroySurface(p->egl_display, p->egl_surface); if (p->egl_context) eglDestroyContext(p->egl_display, p->egl_context); p->egl_context = EGL_NO_CONTEXT; eglReleaseThread(); p->egl_display = EGL_NO_DISPLAY; talloc_free(p->gl); p->gl = NULL; }