D10060: Enable blending if a subsurface has an alpha channel
This revision was automatically updated to reflect the committed changes. Closed by commit R108:e22d9d957b12: Enable blending if a subsurface has an alpha channel (authored by graesslin). Restricted Application edited projects, added Plasma; removed KWin. REPOSITORY R108 KWin CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10060?vs=26097=26502 REVISION DETAIL https://phabricator.kde.org/D10060 AFFECTED FILES plugins/scenes/opengl/scene_opengl.cpp plugins/scenes/opengl/scene_opengl.h To: graesslin, #kwin, #plasma, romangg Cc: romangg, plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D10060: Enable blending if a subsurface has an alpha channel
graesslin updated this revision to Diff 26097. graesslin added a comment. Restricted Application edited projects, added Plasma; removed KWin. Always call setBlendEnabled before rendering a subsurface. @romangg: I hope this addresses all your comments. REPOSITORY R108 KWin CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D10060?vs=25844=26097 BRANCH blending-for-subsurfaces REVISION DETAIL https://phabricator.kde.org/D10060 AFFECTED FILES plugins/scenes/opengl/scene_opengl.cpp plugins/scenes/opengl/scene_opengl.h To: graesslin, #kwin, #plasma Cc: romangg, plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
D10060: Enable blending if a subsurface has an alpha channel
romangg added inline comments. Restricted Application edited projects, added KWin; removed Plasma. INLINE COMMENTS > scene_opengl.cpp:1383 > texture->render(region, QRect(0, 0, texture->width() / scale, > texture->height() / scale), hardwareClipping); > texture->unbind(); > } Disable blend again in case it was enabled for this subsurface but following ones have no alpha? > scene_opengl.cpp:1518 > > -setBlendEnabled(false); > - Wouldn't you like to leave this here? Otherwise blend might be enabled depending on the last node through `nodes[i].hasAlpha || nodes[i].opacity < 1.0` in the previous loop even when no subsurface has alpha. REPOSITORY R108 KWin REVISION DETAIL https://phabricator.kde.org/D10060 To: graesslin, #kwin, #plasma Cc: romangg, plasma-devel, kwin, iodelay, bwowk, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
D10060: Enable blending if a subsurface has an alpha channel
graesslin created this revision. graesslin added reviewers: KWin, Plasma. Restricted Application added a project: KWin. Restricted Application added subscribers: kwin, plasma-devel. graesslin requested review of this revision. Restricted Application edited projects, added Plasma; removed KWin. REVISION SUMMARY While investigating BUG 387313 I noticed that blending might be disabled for subsurfaces. Blending was disabled before rendering the subsurfaces and it is not checked whether the surfaces have an alpha channel or not. This change addresses this problem by disabling blending after all subsurfaces have been rendered and enabling blending if a subsurface has an alpha channel. Unfortunately this does not fix the investigated bug. REPOSITORY R108 KWin BRANCH blending-for-subsurfaces REVISION DETAIL https://phabricator.kde.org/D10060 AFFECTED FILES plugins/scenes/opengl/scene_opengl.cpp plugins/scenes/opengl/scene_opengl.h To: graesslin, #kwin, #plasma Cc: plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart