Enable blending if a subsurface has an alpha channel
ClosedPublic

Authored by graesslin on Jan 23 2018, 7:30 PM.

Details

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.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin created this revision.Jan 23 2018, 7:30 PM
Restricted Application added a project: KWin. · View Herald TranscriptJan 23 2018, 7:30 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
graesslin requested review of this revision.Jan 23 2018, 7:30 PM
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 23 2018, 7:30 PM
romangg added inline comments.
plugins/scenes/opengl/scene_opengl.cpp
1379

Disable blend again in case it was enabled for this subsurface but following ones have no alpha?

1518 ↗(On Diff #26502)

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.

Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 23 2018, 8:01 PM
graesslin updated this revision to Diff 26097.Jan 28 2018, 8:57 AM

Always call setBlendEnabled before rendering a subsurface.

@romangg: I hope this addresses all your comments.

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 28 2018, 8:57 AM
romangg accepted this revision.Jan 28 2018, 11:28 AM
This revision is now accepted and ready to land.Jan 28 2018, 11:28 AM
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 28 2018, 11:28 AM
This revision was automatically updated to reflect the committed changes.
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptFeb 4 2018, 2:02 PM