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 Original line Diff line number Diff line
@@ -26,16 +26,6 @@


namespace android {
namespace android {


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

Description::~Description() {}

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


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


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


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


    bool mColorMatrixEnabled;
    bool mColorMatrixEnabled = false;
    mat4 mColorMatrix;
    mat4 mColorMatrix;


    bool mIsWideGamut;
    bool mIsWideGamut = false;


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


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