Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25429cb7 authored by Greg Kaiser's avatar Greg Kaiser
Browse files

surfaceflinger: Description init style change

We move the initialization of fields to Description's
declaration, and switch to using the "default" constructor and
destructor.

This is basically a style change, should essentially have no
difference in behavior, although it does subtly change
Description into being a POD (which might be useful for future
work, but should have no current impact).

Test: Built aosp_arm-eng
Change-Id: I79f91f422ff6ad55dbd9507ee6655f30377339a8
parent b941e695
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -26,16 +26,6 @@

namespace android {

Description::Description() {
    mPremultipliedAlpha = false;
    mOpaque = true;
    mTextureEnabled = false;
    mColorMatrixEnabled = false;
    mIsWideGamut = false;
}

Description::~Description() {}

void Description::setPremultipliedAlpha(bool premultipliedAlpha) {
    mPremultipliedAlpha = premultipliedAlpha;
}
+7 −7
Original line number Diff line number Diff line
@@ -36,27 +36,27 @@ class Description {
    friend class ProgramCache;

    // whether textures are premultiplied
    bool mPremultipliedAlpha;
    bool mPremultipliedAlpha = false;
    // whether this layer is marked as opaque
    bool mOpaque;
    bool mOpaque = true;

    // Texture this layer uses
    Texture mTexture;
    bool mTextureEnabled;
    bool mTextureEnabled = false;

    // color used when texturing is disabled or when setting alpha.
    half4 mColor;
    // projection matrix
    mat4 mProjectionMatrix;

    bool mColorMatrixEnabled;
    bool mColorMatrixEnabled = false;
    mat4 mColorMatrix;

    bool mIsWideGamut;
    bool mIsWideGamut = false;

public:
    Description();
    ~Description();
    Description() = default;
    ~Description() = default;

    void setPremultipliedAlpha(bool premultipliedAlpha);
    void setOpaque(bool opaque);