/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
mGLES->SetGlesVersion(glesVersion);
+
+ mGraphicsController.SetGLESVersion(static_cast<Graphics::GLES::GLESVersion>(glesVersion));
}
void EglGraphics::SetIsSurfacelessContextSupported(const bool isSupported)
// Make the shared surfaceless context as current before rendering
mEglImplementation->MakeContextCurrent(EGL_NO_SURFACE, mEglImplementation->GetContext());
}
+
+ mGraphicsController.ActivateResourceContext();
+}
+
+void EglGraphics::ActivateSurfaceContext(Dali::RenderSurfaceInterface* surface)
+{
+ if(surface)
+ {
+ surface->InitializeGraphics();
+ surface->MakeContextCurrent();
+ }
+
+ mGraphicsController.ActivateSurfaceContext(surface);
+}
+
+void EglGraphics::PostRender()
+{
+ ActivateResourceContext();
+
+ if(mGraphicsController.GetCurrentContext())
+ {
+ mGraphicsController.GetCurrentContext()->InvalidateDepthStencilBuffers();
+ }
+
+ mGraphicsController.PostRender();
}
void EglGraphics::SetFirstFrameAfterResume()
EglInitialize();
// Sync and context helper require EGL to be initialized first (can't execute in the constructor)
- mGraphicsController.Initialize(*mEglSync.get(), *mEglContextHelper.get());
+ mGraphicsController.Initialize(*mEglSync.get(), *mEglContextHelper.get(), *this);
}
void EglGraphics::Initialize(bool depth, bool stencil, bool partialRendering, int msaa)
{
// Create a surfaceless OpenGL context for shared resources
mEglImplementation->CreateContext();
- mEglImplementation->MakeContextCurrent(EGL_NO_SURFACE, mEglImplementation->GetContext());
+ ActivateResourceContext();
}
else
{
currentSurface = surface;
if(currentSurface)
{
- currentSurface->InitializeGraphics();
- currentSurface->MakeContextCurrent();
+ ActivateSurfaceContext(currentSurface);
}
}