Mir

Merge lp://qastaging/~kdub/mir/fix-1373698 into lp://qastaging/mir

Proposed by Kevin DuBois
Status: Rejected
Rejected by: Daniel van Vugt
Proposed branch: lp://qastaging/~kdub/mir/fix-1373698
Merge into: lp://qastaging/mir
Diff against target: 134 lines (+47/-4)
7 files modified
include/platform/mir/graphics/renderable.h (+3/-0)
platform-ABI-sha1sums (+1/-1)
server-ABI-sha1sums (+1/-1)
src/server/compositor/gl_renderer.cpp (+1/-1)
src/server/input/touchspot_controller.cpp (+1/-1)
tests/unit-tests/compositor/test_gl_renderer.cpp (+24/-0)
tests/unit-tests/input/test_touchspot_controller.cpp (+16/-0)
To merge this branch: bzr merge lp://qastaging/~kdub/mir/fix-1373698
Reviewer Review Type Date Requested Status
Daniel van Vugt Disapprove
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+236023@code.qastaging.launchpad.net

Commit message

Make sure that touchspots have their alpha blending enabled. Also have the GLRenderer disable alpha blending for renderables that have blending enabled.

LP: #1373698

Description of the change

Make sure that touchspots have their alpha blending enabled. Also have the GLRenderer disable alpha blending for renderables that have blending enabled.

LP: #1373698

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sounds like "alpha_enabled" is a redundant form of "shaped" (shaped means to use the renderable's own alpha channel). We should get back to two alpha-related attributes instead of having three. Or is that too big a job for this fix?

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

See also bug 1236224 :)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK I have a nicer solution rather than building on the "alpha_enabled" attribute which should not exist...

https://code.launchpad.net/~vanvugt/mir/simplify-alpha/+merge/236075

review: Disapprove
Revision history for this message
Kevin DuBois (kdub) wrote :

I think that the alpha settings on Renderable are a bit confusing too. They got this way because we melded the 'original' Renderable class to the BasicSurface class before separating them out again, and we got this jumble of alpha functions.

But now we have 2 competing MP's to address the bug/ambiguity. I was trying to avoid changing the Renderable interface because I knew it would be a more protracted discussion :) But I guess if we're going to break ABI, the important thing is to fix the ambiguity in Renderable.

In trunk now we have:
1) bool Renderable::alpha_enabled()
alpha_enabled() means that blending is enabled for the renderable
2) bool Renderable::shaped()
shaped() means "the pixel format has alpha"
3) float Renderable::alpha()
This is "plane alpha" or "global alpha", that is, it is an additional alpha value that is blended.

So in trunk now, Renderable::alpha_enabled does have some sort of place. It is useful for the renderable to explicitly designate whether it wants itself blended.

Renderable::alpha() doesn't really indicate what's going on here at first glance, I'd suggest Renderable::plane_alpha()

Renderable::shaped() seems to be a mash-up of information already available via the other functions. If the alpha is to be explicitly disabled, mg::Renderable::alpha_enabled() can be checked. If the pixel format doesn't have an alpha channel, mg::Buffer::pixel_format() can be checked. If the plane alpha is less than 1.0f, then mg::Renderable::alpha() can be checked.

So, how about:
mg::Renderable::blend_required();
This is false if blending is 1) explicitly disabled, or 2) no alpha channel in the pixel format. In the great-and-glorious-future, I'd like to see this function just represent 1), and 2) can be encoded into the pixel format details (lp: #1236254)
mg::Renderable::plane_alpha();
This will require an alpha blend if less than 1.0.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I agree with "blend_required()" and was thinking the same thing, although don't like that particular name. Basically it exists already in "shaped()". We just need to rename "shaped" and document the fact that implementers of the interface do have the option of returning false even if the pixel format is RGBA.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The alternate fix has landed. So rejecting.

Unmerged revisions

1944. By Kevin DuBois

update sha1sums (no ABI break, just updating comment)

1943. By Kevin DuBois

update comment in header

1942. By Kevin DuBois

test to pass

1941. By Kevin DuBois

add a failing test that checks that the renderable has alpha_enabled

1940. By Kevin DuBois

test to pass

1939. By Kevin DuBois

add a failing test so that the GLRenderer will disable blending if alpha_enabled is not set

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches