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
diff --git a/libs/hwui/VectorDrawable.h b/libs/hwui/VectorDrawable.h
index a5d1d4b..3586d8a 100644
--- a/libs/hwui/VectorDrawable.h
+++ b/libs/hwui/VectorDrawable.h
@@ -90,7 +90,7 @@
public:
class Properties {
public:
- Properties(Node* node) : mNode(node) {}
+ explicit Properties(Node* node) : mNode(node) {}
inline void onPropertyChanged() {
mNode->onPropertyChanged(this);
}
@@ -132,7 +132,7 @@
class PathProperties : public Properties {
public:
- PathProperties(Node* node) : Properties(node) {}
+ explicit PathProperties(Node* node) : Properties(node) {}
void syncProperties(const PathProperties& prop) {
mData = prop.mData;
onPropertyChanged();
@@ -218,7 +218,7 @@
float strokeMiterLimit = 4;
int fillType = 0; /* non-zero or kWinding_FillType in Skia */
};
- FullPathProperties(Node* mNode) : Properties(mNode), mTrimDirty(false) {}
+ explicit FullPathProperties(Node* mNode) : Properties(mNode), mTrimDirty(false) {}
~FullPathProperties() {
SkSafeUnref(fillGradient);
SkSafeUnref(strokeGradient);
@@ -409,7 +409,7 @@
public:
class GroupProperties : public Properties {
public:
- GroupProperties(Node* mNode) : Properties(mNode) {}
+ explicit GroupProperties(Node* mNode) : Properties(mNode) {}
struct PrimitiveFields {
float rotate = 0;
float pivotX = 0;
@@ -539,7 +539,7 @@
class ANDROID_API Tree : public VirtualLightRefBase {
public:
- Tree(Group* rootNode) : mRootNode(rootNode) {
+ explicit Tree(Group* rootNode) : mRootNode(rootNode) {
mRootNode->setPropertyChangedListener(&mPropertyChangedListener);
}
@@ -576,7 +576,7 @@
class TreeProperties {
public:
- TreeProperties(Tree* tree) : mTree(tree) {}
+ explicit TreeProperties(Tree* tree) : mTree(tree) {}
// Properties that can only be modified by UI thread, therefore sync should
// only go from UI to RT
struct NonAnimatableProperties {