D8039: Support software QtQuickRendering in Aurorae

2017-11-01 Thread David Edmundson
This revision was automatically updated to reflect the committed changes.
Closed by commit R108:54b36325f717: Support software QtQuickRendering in 
Aurorae (authored by davidedmundson).

REPOSITORY
  R108 KWin

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D8039?vs=21699=21707

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

AFFECTED FILES
  plugins/kdecorations/aurorae/src/aurorae.cpp

To: davidedmundson, #plasma, graesslin
Cc: graesslin, apol, plasma-devel, kwin, #kwin, bwowk, ZrenBot, progwolff, 
lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, mart


D8039: Support software QtQuickRendering in Aurorae

2017-11-01 Thread Martin Flöser
graesslin accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
  R108 KWin

BRANCH
  master

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

To: davidedmundson, #plasma, graesslin
Cc: graesslin, apol, plasma-devel, kwin, #kwin, bwowk, ZrenBot, progwolff, 
lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, mart


D8039: Support software QtQuickRendering in Aurorae

2017-11-01 Thread David Edmundson
davidedmundson updated this revision to Diff 21699.
davidedmundson added a comment.
Restricted Application edited projects, added KWin; removed Plasma.


  Avoid all GL in software mode.
  
  Had a bit of a reshuffle to create the view first, so we can use the 
graphicsAPI from that
  rather than the static methods.

REPOSITORY
  R108 KWin

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D8039?vs=20565=21699

BRANCH
  master

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

AFFECTED FILES
  plugins/kdecorations/aurorae/src/aurorae.cpp

To: davidedmundson, #plasma
Cc: graesslin, apol, plasma-devel, kwin, #kwin, bwowk, ZrenBot, progwolff, 
lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, mart


D8039: Support software QtQuickRendering in Aurorae

2017-10-10 Thread Martin Flöser
graesslin added inline comments.

INLINE COMMENTS

> davidedmundson wrote in aurorae.cpp:354
> Changing the rendering doesn't block making calls to any of the openGL calls 
> in QtBase.  
> The only changes are purely inside QtQuick
> 
> So:
> creating a context still works fine
> creating an FBO still works fine
> 
> why m_view->setRenderTarget and m_view->resetOpenGLState still work are the 
> more interesting questions
> but that's because they're virtual methods that no-op.
> 
> With this code:
> we create an OpenGL context
> set it to be active
> then ignore it and do something completely different with QPainter instead

then I would suggest to guard it to only do it in the OpenGL case. Especially 
on Wayland without OpenGL support this could be very nasty.

REPOSITORY
  R108 KWin

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

To: davidedmundson, #plasma
Cc: graesslin, apol, plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, mart


D8039: Support software QtQuickRendering in Aurorae

2017-10-10 Thread Martin Flöser
graesslin added a comment.


  Ah sorry, I had my comment here for weeks, just unsubmitted :-(

REPOSITORY
  R108 KWin

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

To: davidedmundson, #plasma
Cc: graesslin, apol, plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, mart


D8039: Support software QtQuickRendering in Aurorae

2017-10-10 Thread David Edmundson
davidedmundson updated this revision to Diff 20565.
davidedmundson added a comment.
Restricted Application edited projects, added Plasma; removed KWin.


  Check Qt version

REPOSITORY
  R108 KWin

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D8039?vs=20050=20565

BRANCH
  master

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

AFFECTED FILES
  plugins/kdecorations/aurorae/src/aurorae.cpp

To: davidedmundson, #plasma
Cc: graesslin, apol, plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, mart


D8039: Support software QtQuickRendering in Aurorae

2017-09-29 Thread David Edmundson
davidedmundson added inline comments.

INLINE COMMENTS

> apol wrote in aurorae.cpp:344
> `#if QT_VERSION < QT_VERSION_CHECK(5,10,0)`?

Yeah, makes sense, it got +2'd quicker than I expected.

> graesslin wrote in aurorae.cpp:354
> stupid question: but why is this code working? I would assume that making the 
> context current will fail here and then we return? And even if the creation 
> of the FBO should fail and then also return?

Changing the rendering doesn't block making calls to any of the openGL calls in 
QtBase.  
The only changes are purely inside QtQuick

So:
creating a context still works fine
creating an FBO still works fine

why m_view->setRenderTarget and m_view->resetOpenGLState still work are the 
more interesting questions
but that's because they're virtual methods that no-op.

With this code:
we create an OpenGL context
set it to be active
then ignore it and do something completely different with QPainter instead

REPOSITORY
  R108 KWin

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

To: davidedmundson, #plasma
Cc: graesslin, apol, plasma-devel, kwin, #kwin, bwowk, ZrenBot, progwolff, 
lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, mart


D8039: Support software QtQuickRendering in Aurorae

2017-09-29 Thread Martin Flöser
graesslin added inline comments.

INLINE COMMENTS

> aurorae.cpp:354
>  [this] {
>  if (!m_context->makeCurrent(m_offscreenSurface.data())) {
>  return;

stupid question: but why is this code working? I would assume that making the 
context current will fail here and then we return? And even if the creation of 
the FBO should fail and then also return?

REPOSITORY
  R108 KWin

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

To: davidedmundson, #plasma
Cc: graesslin, apol, plasma-devel, kwin, #kwin, bwowk, ZrenBot, progwolff, 
lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, mart


D8039: Support software QtQuickRendering in Aurorae

2017-09-28 Thread Aleix Pol Gonzalez
apol added inline comments.

INLINE COMMENTS

> aurorae.cpp:344
>  
> +//workaround for https://codereview.qt-project.org/#/c/207198/
> +m_renderControl->sync();

`#if QT_VERSION < QT_VERSION_CHECK(5,10,0)`?

REPOSITORY
  R108 KWin

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

To: davidedmundson, #plasma
Cc: apol, plasma-devel, kwin, #kwin, bwowk, ZrenBot, progwolff, lesliezhai, 
ali-mohamed, hardening, jensreuterberg, abetts, sebas, mart


D8039: Support software QtQuickRendering in Aurorae

2017-09-28 Thread David Edmundson
davidedmundson created this revision.
davidedmundson added a reviewer: Plasma.
Restricted Application added a project: KWin.
Restricted Application added subscribers: KWin, kwin, plasma-devel.

REVISION SUMMARY
  For software QtQuick rendering we want to create a pixmap buffer and
  render our contents in there.
  
  m_rendercontrol->grab does this, but also covers the GL side in pretty
  much the same way that we were currently doing.
  
  Some calls are redundant in software mode, but they don't do any harm,
  and I didn't want to pollute the code.
  
  In doing so I found a bug in Qt, that's submitted upstream, and also worked 
round.

TEST PLAN
  Tested with forced software mode, could see an Aurorae decorations
  Tested without (so normal code), could see an Aurorae
  
  Whether we then end up using GL, painter or xrender rendering is irrelevant
  (but I tested two of them anyway)

REPOSITORY
  R108 KWin

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

AFFECTED FILES
  plugins/kdecorations/aurorae/src/aurorae.cpp

To: davidedmundson, #plasma
Cc: plasma-devel, kwin, #kwin, bwowk, ZrenBot, progwolff, lesliezhai, 
ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart