D6396: Refactor the specification of OpenGL context attributes

Martin Flöser noreply at phabricator.kde.org
Mon Jun 26 15:52:18 UTC 2017


graesslin created this revision.
Restricted Application added a project: KWin.
Restricted Application added subscribers: kwin, plasma-devel.

REVISION SUMMARY
  The current way to specify the OpenGL context attributes does no longer
  scale as can be seen in https://phabricator.kde.org/D6344. There are too many different context
  attribute sets and with every addition we grow lots of copied code. The
  chances to introduce errors in that code which is difficult to debug are
  very high. As can be seen in the glx backend which defines major 1,
  minor 2, but it should be major 2, minor 1.
  
  This change reworks this code by creating a builder class which contains
  only an abstract definition of what needs to be in the attributes.
  E.g. the version, whether it's robust and so on.
  
  Now we can just have a list of possible attributes in a well described
  way:
  
    auto builder;
    builder.setVersion(3, 1);
    builder.setRobust(true);
  
  All possible builders are added to a list and operated on in a for loop
  which tries to creat a context. Once it succeeded it breaks the list.
  In addition a debug statement is added which prints out the set of
  options which went into the context.
  
  So far this is only done for EGL, GLX can follow once https://phabricator.kde.org/D6344 is merged.

TEST PLAN
  New unit test added, kwin_wayland OpenGL tests run and verified

REPOSITORY
  R108 KWin

BRANCH
  context-attribute-builder

REVISION DETAIL
  https://phabricator.kde.org/D6396

AFFECTED FILES
  CMakeLists.txt
  abstract_egl_backend.cpp
  abstract_opengl_context_attribute_builder.cpp
  abstract_opengl_context_attribute_builder.h
  autotests/CMakeLists.txt
  autotests/opengl_context_attribute_builder_test.cpp
  egl_context_attribute_builder.cpp
  egl_context_attribute_builder.h

To: graesslin, #kwin, #plasma
Cc: plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170626/86904f50/attachment.html>


More information about the Plasma-devel mailing list