Mir

Merge lp://qastaging/~albaguirre/mir/make-screencast-capture-opaque into lp://qastaging/mir

Proposed by Alberto Aguirre
Status: Rejected
Rejected by: Alberto Aguirre
Proposed branch: lp://qastaging/~albaguirre/mir/make-screencast-capture-opaque
Merge into: lp://qastaging/mir
Diff against target: 135 lines (+46/-9)
7 files modified
examples/demo-shell/demo_renderer.cpp (+0/-4)
include/test/mir_test_doubles/mock_gl.h (+1/-0)
src/server/compositor/gl_renderer.cpp (+0/-4)
src/server/compositor/screencast_display_buffer.cpp (+18/-0)
tests/mir_test_doubles/mock_gl.cpp (+6/-0)
tests/unit-tests/compositor/test_gl_renderer.cpp (+0/-1)
tests/unit-tests/compositor/test_screencast_display_buffer.cpp (+21/-0)
To merge this branch: bzr merge lp://qastaging/~albaguirre/mir/make-screencast-capture-opaque
Reviewer Review Type Date Requested Status
Daniel van Vugt Needs Fixing
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+218889@code.qastaging.launchpad.net

Commit message

Make screencast capture opaque.

This is an alternative fix to LP: #1301210 which also addresses LP: #1317260

Description of the change

Make screencast capture opaque.

This is an alternative fix to LP: #1301210 which also addresses LP: #1317260

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

I suggest this perhaps should not be fixed. If we have any nested servers utilizing the alpha channel that's an unacceptable performance hit on anything other than high-end hardware. Fixing this bug just supports people writing very bad graphics code.

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

Oh, I remember now. We agreed nested servers would sometimes need to be blended for fancy shaped transitions. But we also agreed they must not use the alpha channel during regular usage. So a fix will be required at some stage. But at the same time, it does suggest we have slow-rendering nested Mir servers around that need improving.

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

(1) There's a performance issue here; glGet functions require a round-trip stalling the pipeline:
57 + glGetFloatv(GL_COLOR_CLEAR_VALUE, old_clear_color);
58 + glGetBooleanv(GL_COLOR_WRITEMASK, old_color_mask);
[http://www.opengl.org/wiki/Common_Mistakes#glGetFloatv_glGetBooleanv_glGetDoublev_glGetIntegerv]
But maybe it's OK in this case since it's immediately before glFinish() which is a definitive round-trip sync anyway.

(2) glClear() in the post_update() function looks like it's almost certainly in the wrong place. It can only work if you assume the compositor recycles the framebuffer, which is a dangerous assumption(?)
74 + make_opaque();
75 glFinish();

(3) Calling glClear() twice per frame is a major bottleneck [1] which should be avoided. How about something like:
void mc::GLRenderer::begin() const
{
    glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
    glClear(GL_COLOR_BUFFER_BIT);
    glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
}
...?

[1] https://bugs.launchpad.net/mir/+bug/1170243

review: Needs Fixing
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

(1) Ack - but I didn't want to just change state and not restore it though.
(2) Ack - I just don't know of any better place that only appliest to screencasting though.

(3) That's what I had on the previous MP (https://code.launchpad.net/~albaguirre/mir/render-opaque-background/+merge/218712)
    Except you have to set the clear color since the default has alpha set to 0.0

However, should be messing with the alpha at all in the normal rendering path? Or should we just impose that the compositor will enforce opaqueness once it's done? I think it *NEEDS DISCUSSION* - but I'm leaning towards opaqueness.

In any case the purpose of this MP was to *FOR NOW* limit the opaqueness decision to screencasting only.

Revision history for this message
Alberto Aguirre (albaguirre) wrote :

OK, after some more thought I do think the previous MP (https://code.launchpad.net/~albaguirre/mir/render-opaque-background/+merge/218712) is a better solution.

Currently mir does not support transparent framebuffers properly anyway (per-pixel alpha in resulting framebuffer is not correct).

Unmerged revisions

1613. By Alberto Aguirre

Make screencast capture opaque.

This is an alternative fix to LP: #1301210 which also addresses LP: #1317260

1612. By Alberto Aguirre

Revert r1581.

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