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

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

Fix google-explicit-constructor warnings in libs/hwui.

* Add explicit keyword to conversion constructors,
  or add NOLINT for implicit converters.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: Id8ca42433a4fc3652e4cb13787c4cb169f20d9a9
parent c4c4a1e7
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -97,9 +97,9 @@ enum class ClipMode {
};
};


struct ClipBase {
struct ClipBase {
    ClipBase(ClipMode mode)
    explicit ClipBase(ClipMode mode)
            : mode(mode) {}
            : mode(mode) {}
    ClipBase(const Rect& rect)
    explicit ClipBase(const Rect& rect)
            : mode(ClipMode::Rectangle)
            : mode(ClipMode::Rectangle)
            , rect(rect) {}
            , rect(rect) {}
    const ClipMode mode;
    const ClipMode mode;
@@ -112,19 +112,19 @@ struct ClipBase {
};
};


struct ClipRect : ClipBase {
struct ClipRect : ClipBase {
    ClipRect(const Rect& rect)
    explicit ClipRect(const Rect& rect)
            : ClipBase(rect) {}
            : ClipBase(rect) {}
};
};


struct ClipRectList : ClipBase {
struct ClipRectList : ClipBase {
    ClipRectList(const RectangleList& rectList)
    explicit ClipRectList(const RectangleList& rectList)
            : ClipBase(ClipMode::RectangleList)
            : ClipBase(ClipMode::RectangleList)
            , rectList(rectList) {}
            , rectList(rectList) {}
    RectangleList rectList;
    RectangleList rectList;
};
};


struct ClipRegion : ClipBase {
struct ClipRegion : ClipBase {
    ClipRegion(const SkRegion& region)
    explicit ClipRegion(const SkRegion& region)
            : ClipBase(ClipMode::Region)
            : ClipBase(ClipMode::Region)
            , region(region) {}
            , region(region) {}
    ClipRegion()
    ClipRegion()
+1 −1
Original line number Original line Diff line number Diff line
@@ -35,7 +35,7 @@ class DeferredLayerUpdater : public VirtualLightRefBase {
public:
public:
    // Note that DeferredLayerUpdater assumes it is taking ownership of the layer
    // Note that DeferredLayerUpdater assumes it is taking ownership of the layer
    // and will not call incrementRef on it as a result.
    // and will not call incrementRef on it as a result.
    ANDROID_API DeferredLayerUpdater(Layer* layer);
    ANDROID_API explicit DeferredLayerUpdater(Layer* layer);
    ANDROID_API ~DeferredLayerUpdater();
    ANDROID_API ~DeferredLayerUpdater();


    ANDROID_API bool setSize(int width, int height) {
    ANDROID_API bool setSize(int width, int height) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -96,7 +96,7 @@ public:


class FontRenderer {
class FontRenderer {
public:
public:
    FontRenderer(const uint8_t* gammaTable);
    explicit FontRenderer(const uint8_t* gammaTable);
    ~FontRenderer();
    ~FontRenderer();


    void flushLargeCaches(std::vector<CacheTexture*>& cacheTextures);
    void flushLargeCaches(std::vector<CacheTexture*>& cacheTextures);
+1 −1
Original line number Original line Diff line number Diff line
@@ -52,7 +52,7 @@ public:
    static void onFrameCompleted();
    static void onFrameCompleted();


protected:
protected:
    GpuMemoryTracker(GpuObjectType type) : mType(type) {
    explicit GpuMemoryTracker(GpuObjectType type) : mType(type) {
        ASSERT_GPU_THREAD();
        ASSERT_GPU_THREAD();
        startTrackingObject();
        startTrackingObject();
    }
    }
+1 −1
Original line number Original line Diff line number Diff line
@@ -73,7 +73,7 @@ private:


class PropertyAnimatorSetListener : public AnimationListener {
class PropertyAnimatorSetListener : public AnimationListener {
public:
public:
    PropertyAnimatorSetListener(PropertyValuesAnimatorSet* set) : mSet(set) {}
    explicit PropertyAnimatorSetListener(PropertyValuesAnimatorSet* set) : mSet(set) {}
    virtual void onAnimationFinished(BaseRenderNodeAnimator* animator) override;
    virtual void onAnimationFinished(BaseRenderNodeAnimator* animator) override;


private:
private:
Loading