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

Commit 49796451 authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Fix clang-tidy warnings in libs/hwui.

* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
Test: build with WITH_TIDY=1

Change-Id: Iab3e6636f60a70cb124f29dc19f20f842fa8dfda
parent 04db685c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ protected:
        Finished,
    };

    BaseRenderNodeAnimator(float finalValue);
    explicit BaseRenderNodeAnimator(float finalValue);
    virtual ~BaseRenderNodeAnimator();

    virtual float getValue(RenderNode* target) const = 0;
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ namespace uirenderer {
// Lifecycle
///////////////////////////////////////////////////////////////////////////////

void AssetAtlas::init(sp<GraphicBuffer> buffer, int64_t* map, int count) {
void AssetAtlas::init(const sp<GraphicBuffer>& buffer, int64_t* map, int count) {
    if (mImage) {
        return;
    }
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ public:
     * initialized. To re-initialize the atlas, you must
     * first call terminate().
     */
    ANDROID_API void init(sp<GraphicBuffer> buffer, int64_t* map, int count);
    ANDROID_API void init(const sp<GraphicBuffer>& buffer, int64_t* map, int count);

    /**
     * Destroys the atlas texture. This object can be
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ public:
     * cannot be created, getTexture() will return 0 and getImage() will
     * return EGL_NO_IMAGE_KHR.
     */
    Image(sp<GraphicBuffer> buffer);
    explicit Image(sp<GraphicBuffer> buffer);
    ~Image();

    /**
+6 −6
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ public:

class ANDROID_API AccelerateInterpolator : public Interpolator {
public:
    AccelerateInterpolator(float factor) : mFactor(factor), mDoubleFactor(factor*2) {}
    explicit AccelerateInterpolator(float factor) : mFactor(factor), mDoubleFactor(factor*2) {}
    virtual float interpolate(float input) override;
private:
    const float mFactor;
@@ -52,7 +52,7 @@ private:

class ANDROID_API AnticipateInterpolator : public Interpolator {
public:
    AnticipateInterpolator(float tension) : mTension(tension) {}
    explicit AnticipateInterpolator(float tension) : mTension(tension) {}
    virtual float interpolate(float input) override;
private:
    const float mTension;
@@ -60,7 +60,7 @@ private:

class ANDROID_API AnticipateOvershootInterpolator : public Interpolator {
public:
    AnticipateOvershootInterpolator(float tension) : mTension(tension) {}
    explicit AnticipateOvershootInterpolator(float tension) : mTension(tension) {}
    virtual float interpolate(float input) override;
private:
    const float mTension;
@@ -73,7 +73,7 @@ public:

class ANDROID_API CycleInterpolator : public Interpolator {
public:
    CycleInterpolator(float cycles) : mCycles(cycles) {}
    explicit CycleInterpolator(float cycles) : mCycles(cycles) {}
    virtual float interpolate(float input) override;
private:
    const float mCycles;
@@ -81,7 +81,7 @@ private:

class ANDROID_API DecelerateInterpolator : public Interpolator {
public:
    DecelerateInterpolator(float factor) : mFactor(factor) {}
    explicit DecelerateInterpolator(float factor) : mFactor(factor) {}
    virtual float interpolate(float input) override;
private:
    const float mFactor;
@@ -94,7 +94,7 @@ public:

class ANDROID_API OvershootInterpolator : public Interpolator {
public:
    OvershootInterpolator(float tension) : mTension(tension) {}
    explicit OvershootInterpolator(float tension) : mTension(tension) {}
    virtual float interpolate(float input) override;
private:
    const float mTension;
Loading