[plugins/qpa] Add debug output for the KWin internal QPA plugin
Reviewed-By: bshah
This commit is contained in:
parent
fb8434671f
commit
dce3ea6a20
5 changed files with 20 additions and 0 deletions
|
@ -15,3 +15,4 @@ kwin_decorations KWin Decorations
|
||||||
kwin_scripting KWin Scripting
|
kwin_scripting KWin Scripting
|
||||||
aurorae KWin Aurorae Window Decoration Engine
|
aurorae KWin Aurorae Window Decoration Engine
|
||||||
kwin_xkbcommon KWin xkbcommon integration
|
kwin_xkbcommon KWin xkbcommon integration
|
||||||
|
kwin_qpa_plugin KWin QtPlatformAbstraction plugin
|
||||||
|
|
|
@ -15,6 +15,9 @@ set(QPA_SOURCES
|
||||||
window.cpp
|
window.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
include(ECMQtDeclareLoggingCategory)
|
||||||
|
ecm_qt_declare_logging_category(QPA_SOURCES HEADER logging.h IDENTIFIER KWIN_QPA CATEGORY_NAME kwin_qpa_plugin DEFAULT_SEVERITY Critical)
|
||||||
|
|
||||||
add_library(KWinQpaPlugin MODULE ${QPA_SOURCES})
|
add_library(KWinQpaPlugin MODULE ${QPA_SOURCES})
|
||||||
target_link_libraries(KWinQpaPlugin
|
target_link_libraries(KWinQpaPlugin
|
||||||
kwin
|
kwin
|
||||||
|
|
|
@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
#include "abstractplatformcontext.h"
|
#include "abstractplatformcontext.h"
|
||||||
#include "integration.h"
|
#include "integration.h"
|
||||||
|
#include <logging.h>
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
@ -54,9 +55,11 @@ static EGLConfig configFromGLFormat(EGLDisplay dpy, const QSurfaceFormat &format
|
||||||
EGLint count;
|
EGLint count;
|
||||||
EGLConfig configs[1024];
|
EGLConfig configs[1024];
|
||||||
if (eglChooseConfig(dpy, config_attribs, configs, 1, &count) == EGL_FALSE) {
|
if (eglChooseConfig(dpy, config_attribs, configs, 1, &count) == EGL_FALSE) {
|
||||||
|
qCWarning(KWIN_QPA) << "eglChooseConfig failed";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (count != 1) {
|
if (count != 1) {
|
||||||
|
qCWarning(KWIN_QPA) << "eglChooseConfig did not return any configs";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return configs[0];
|
return configs[0];
|
||||||
|
@ -135,6 +138,7 @@ bool AbstractPlatformContext::isValid() const
|
||||||
bool AbstractPlatformContext::bindApi()
|
bool AbstractPlatformContext::bindApi()
|
||||||
{
|
{
|
||||||
if (eglBindAPI(isOpenGLES() ? EGL_OPENGL_ES_API : EGL_OPENGL_API) == EGL_FALSE) {
|
if (eglBindAPI(isOpenGLES() ? EGL_OPENGL_ES_API : EGL_OPENGL_API) == EGL_FALSE) {
|
||||||
|
qCWarning(KWIN_QPA) << "eglBindAPI failed";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -211,6 +215,7 @@ void AbstractPlatformContext::createContext(EGLContext shareContext)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context == EGL_NO_CONTEXT) {
|
if (context == EGL_NO_CONTEXT) {
|
||||||
|
qCWarning(KWIN_QPA) << "Failed to create EGL context";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_context = context;
|
m_context = context;
|
||||||
|
|
|
@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "../../platform.h"
|
#include "../../platform.h"
|
||||||
#include "../../wayland_server.h"
|
#include "../../wayland_server.h"
|
||||||
#include "../../shell_client.h"
|
#include "../../shell_client.h"
|
||||||
|
#include <logging.h>
|
||||||
|
|
||||||
#include <QOpenGLFramebufferObject>
|
#include <QOpenGLFramebufferObject>
|
||||||
|
|
||||||
|
@ -45,6 +46,8 @@ bool SharingPlatformContext::makeCurrent(QPlatformSurface *surface)
|
||||||
window->bindContentFBO();
|
window->bindContentFBO();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
qCWarning(KWIN_QPA) << "Failed to make context current";
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +61,7 @@ void SharingPlatformContext::swapBuffers(QPlatformSurface *surface)
|
||||||
Window *window = static_cast<Window*>(surface);
|
Window *window = static_cast<Window*>(surface);
|
||||||
auto c = window->shellClient();
|
auto c = window->shellClient();
|
||||||
if (!c) {
|
if (!c) {
|
||||||
|
qCDebug(KWIN_QPA) << "SwapBuffers called but there is no ShellClient";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
makeCurrent(surface);
|
makeCurrent(surface);
|
||||||
|
@ -74,15 +78,18 @@ GLuint SharingPlatformContext::defaultFramebufferObject(QPlatformSurface *surfac
|
||||||
return fbo->handle();
|
return fbo->handle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
qCDebug(KWIN_QPA) << "No default framebuffer object for internal window";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharingPlatformContext::create()
|
void SharingPlatformContext::create()
|
||||||
{
|
{
|
||||||
if (config() == 0) {
|
if (config() == 0) {
|
||||||
|
qCWarning(KWIN_QPA) << "Did not get an EGL config";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!bindApi()) {
|
if (!bindApi()) {
|
||||||
|
qCWarning(KWIN_QPA) << "Could not bind API.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
createContext(kwinApp()->platform()->sceneEglContext());
|
createContext(kwinApp()->platform()->sceneEglContext());
|
||||||
|
|
|
@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "../../shell_client.h"
|
#include "../../shell_client.h"
|
||||||
#include "../../wayland_server.h"
|
#include "../../wayland_server.h"
|
||||||
|
#include <logging.h>
|
||||||
|
|
||||||
#include <QOpenGLFramebufferObject>
|
#include <QOpenGLFramebufferObject>
|
||||||
|
|
||||||
|
@ -149,6 +150,9 @@ void Window::createFBO()
|
||||||
{
|
{
|
||||||
const QRect &r = geometry();
|
const QRect &r = geometry();
|
||||||
m_contentFBO.reset(new QOpenGLFramebufferObject(r.width(), r.height(), QOpenGLFramebufferObject::CombinedDepthStencil));
|
m_contentFBO.reset(new QOpenGLFramebufferObject(r.width(), r.height(), QOpenGLFramebufferObject::CombinedDepthStencil));
|
||||||
|
if (!m_contentFBO->isValid()) {
|
||||||
|
qCWarning(KWIN_QPA) << "Content FBO is not valid";
|
||||||
|
}
|
||||||
m_resized = false;
|
m_resized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue