Mir

Merge lp:~brandontschaefer/mir/replace-mir-supported-with-bool into lp:mir

Proposed by Brandon Schaefer
Status: Merged
Approved by: Chris Halse Rogers
Approved revision: no longer in the source branch.
Merged at revision: 3785
Proposed branch: lp:~brandontschaefer/mir/replace-mir-supported-with-bool
Merge into: lp:mir
Diff against target: 34 lines (+4/-5)
2 files modified
include/client/mir_toolkit/mir_display_configuration.h (+2/-3)
src/client/display_configuration_api.cpp (+2/-2)
To merge this branch: bzr merge lp:~brandontschaefer/mir/replace-mir-supported-with-bool
Reviewer Review Type Date Requested Status
Chris Halse Rogers Approve
Alan Griffiths Approve
Daniel van Vugt Needs Information
Mir CI Bot continuous-integration Approve
Cemil Azizoglu (community) Approve
Review via email: mp+308892@code.launchpad.net

Commit message

Replace MirGammaSupported enum with a bool.

Description of the change

Replace MirGammaSupported enum with a bool.

This code is unreleased.

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3776
https://mir-jenkins.ubuntu.com/job/mir-ci/2019/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/2588/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2651
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2643
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2643
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2643
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2617/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2617
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2617/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2617
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2617/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2617
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2617/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2617
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2617/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2617
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2617/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2019/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3776
https://mir-jenkins.ubuntu.com/job/mir-ci/2024/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2593
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2656
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2648
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2648
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2648
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2622
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2622/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2622
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2622/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2622
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2622/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2622
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2622/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2622
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2622/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2622
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2622/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2024/rebuild

review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

+ * \returns ture if gamma is supported on the hardwise, otherwise not supported
11

"ture", "hardwise"
-----------------------

Ok otherwise, so just marking approved.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I don't object to is_supported() returning a bool, but...

- mir_output_gamma_unsupported
+ false

This slippery slope leads to the madness of long sequences of 0s, nullptrs and false that mean nothing to the reader.

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

(1) What Cemil said (actually needs fixing):
ture if gamma is supported on the hardwise, otherwise not supported

(2) You might also consider using a bit flag. Its absence is zero but presence is a named flag rather than "true".

review: Needs Fixing
Revision history for this message
Chris Halse Rogers (raof) wrote :

Concur with Alan - we don't actually want to remove MirOutputGammaSupported, because it's used in non-output positions.

The only change we wanted was
MirOutputGammaSupported mir_output_is_gamma_supported() → bool mir_output_is_gamma_supported().

review: Needs Fixing
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3778
https://mir-jenkins.ubuntu.com/job/mir-ci/2031/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2601
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/2664
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2656
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2656
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2656
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2630
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/2630/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2630
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/2630/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2630
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/2630/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2630
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/2630/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2630
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/2630/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2630
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/2630/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2031/rebuild

review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Is this now an opportunity to privatise the type MirOutputGammaSupported ?

review: Needs Information
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OK

review: Approve
Revision history for this message
Chris Halse Rogers (raof) wrote :

On Fri, Oct 21, 2016 at 10:01 AM, Daniel van Vugt
<email address hidden> wrote:
> Review: Needs Information
>
> Is this now an opportunity to privatise the type
> MirOutputGammaSupported ?

I believe the answer is yes.

There's no reason not to land this now and do that in a second thing.

Revision history for this message
Chris Halse Rogers (raof) wrote :

Yes.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> Is this now an opportunity to privatise the type MirOutputGammaSupported ?

No. I wish DisplayConfigurationOutput wasn't public, but it is.

Revision history for this message
Chris Halse Rogers (raof) wrote :

For now!

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Ill propose an change to remove that from the public API

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

On 21/10/16 12:23, Brandon Schaefer wrote:
> Ill propose an change to remove that from the public API

Only do that after fixing QtMir

--
Alan Griffiths +44 (0)798 9938 758
Octopull Ltd http://www.octopull.co.uk/

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Hmm this should be unreleased? Ill double check

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/client/mir_toolkit/mir_display_configuration.h'
2--- include/client/mir_toolkit/mir_display_configuration.h 2016-10-12 06:03:15 +0000
3+++ include/client/mir_toolkit/mir_display_configuration.h 2016-10-20 15:08:14 +0000
4@@ -477,10 +477,9 @@
5 /** Gets if the platform supports gamma correction
6 *
7 * \param [in] output The MirOutput to query
8- * \returns The MirOutputGammaSupported mir_display_gamma_supported otherwise,
9- * mir_display_gamma_unsupported
10+ * \returns true if gamma is supported on the hardware, otherwise not supported
11 */
12-MirOutputGammaSupported mir_output_is_gamma_supported(MirOutput const* client_output);
13+bool mir_output_is_gamma_supported(MirOutput const* client_output);
14
15 /** Gets the gamma size
16 *
17
18=== modified file 'src/client/display_configuration_api.cpp'
19--- src/client/display_configuration_api.cpp 2016-10-12 06:03:15 +0000
20+++ src/client/display_configuration_api.cpp 2016-10-20 15:08:14 +0000
21@@ -360,11 +360,11 @@
22 return (output->gamma_red().size() / (sizeof(uint16_t) / sizeof(char)));
23 }
24
25-MirOutputGammaSupported mir_output_is_gamma_supported(MirOutput const* client_output)
26+bool mir_output_is_gamma_supported(MirOutput const* client_output)
27 {
28 auto output = client_to_output(client_output);
29
30- return static_cast<MirOutputGammaSupported>(output->gamma_supported());
31+ return output->gamma_supported();
32 }
33
34 void mir_output_get_gamma(MirOutput const* client_output,

Subscribers

People subscribed via source and target branches