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

This commit is contained in:
Chih-hung Hsieh
2016-08-31 17:18:56 +00:00
committed by Gerrit Code Review
13 changed files with 26 additions and 26 deletions

View File

@@ -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()

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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();
} }

View File

@@ -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:

View File

@@ -509,7 +509,7 @@ struct LayerOp : RecordedOp {
, mode(PaintUtils::getXfermodeDirect(paint)) , mode(PaintUtils::getXfermodeDirect(paint))
, colorFilter(paint ? paint->getColorFilter() : nullptr) {} , colorFilter(paint ? paint->getColorFilter() : nullptr) {}
LayerOp(RenderNode& node) explicit LayerOp(RenderNode& node)
: RecordedOp(RecordedOpId::LayerOp, Rect(node.getWidth(), node.getHeight()), Matrix4::identity(), nullptr, nullptr) : RecordedOp(RecordedOpId::LayerOp, Rect(node.getWidth(), node.getHeight()), Matrix4::identity(), nullptr, nullptr)
, layerHandle(node.getLayerHandle()) , layerHandle(node.getLayerHandle())
, alpha(node.properties().layerProperties().alpha() / 255.0f) , alpha(node.properties().layerProperties().alpha() / 255.0f)

View File

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

View File

@@ -30,7 +30,7 @@ class ANDROID_API Paint : public SkPaint {
public: public:
Paint(); Paint();
Paint(const Paint& paint); Paint(const Paint& paint);
Paint(const SkPaint& paint); Paint(const SkPaint& paint); // NOLINT(implicit)
~Paint(); ~Paint();
Paint& operator=(const Paint& other); Paint& operator=(const Paint& other);

View File

@@ -126,7 +126,7 @@ private:
: width(OffscreenBuffer::computeIdealDimension(layerWidth)) : width(OffscreenBuffer::computeIdealDimension(layerWidth))
, height(OffscreenBuffer::computeIdealDimension(layerHeight)) {} , height(OffscreenBuffer::computeIdealDimension(layerHeight)) {}
Entry(OffscreenBuffer* layer) explicit Entry(OffscreenBuffer* layer)
: layer(layer) : layer(layer)
, width(layer->texture.width()) , width(layer->texture.width())
, height(layer->texture.height()) { , height(layer->texture.height()) {

View File

@@ -55,7 +55,7 @@ public:
class Registrar { class Registrar {
public: public:
Registrar(const TestScene::Info& info) { explicit Registrar(const TestScene::Info& info) {
TestScene::registerScene(info); TestScene::registerScene(info);
} }
private: private:

View File

@@ -102,7 +102,7 @@ public:
public: public:
SignalingDtor() SignalingDtor()
: mSignal(nullptr) {} : mSignal(nullptr) {}
SignalingDtor(int* signal) explicit SignalingDtor(int* signal)
: mSignal(signal) {} : mSignal(signal) {}
void setSignal(int* signal) { void setSignal(int* signal) {
mSignal = signal; mSignal = signal;
@@ -202,7 +202,7 @@ public:
class TestTask : public renderthread::RenderTask { class TestTask : public renderthread::RenderTask {
public: public:
TestTask(RtCallback rtCallback) explicit TestTask(RtCallback rtCallback)
: rtCallback(rtCallback) {} : rtCallback(rtCallback) {}
virtual ~TestTask() {} virtual ~TestTask() {}
virtual void run() override; virtual void run() override;

View File

@@ -53,7 +53,7 @@ public:
typedef T value_type; // needed to implement std::allocator typedef T value_type; // needed to implement std::allocator
typedef T* pointer; // needed to implement std::allocator typedef T* pointer; // needed to implement std::allocator
InlineStdAllocator(Allocation& allocation) explicit InlineStdAllocator(Allocation& allocation)
: mAllocation(allocation) {} : mAllocation(allocation) {}
InlineStdAllocator(const InlineStdAllocator& other) InlineStdAllocator(const InlineStdAllocator& other)
: mAllocation(other.mAllocation) {} : mAllocation(other.mAllocation) {}
@@ -93,7 +93,7 @@ public:
this->reserve(SIZE); this->reserve(SIZE);
} }
FatVector(size_t capacity) : FatVector() { explicit FatVector(size_t capacity) : FatVector() {
this->resize(capacity); this->resize(capacity);
} }

View File

@@ -157,7 +157,7 @@ public:
typedef T value_type; // needed to implement std::allocator typedef T value_type; // needed to implement std::allocator
typedef T* pointer; // needed to implement std::allocator typedef T* pointer; // needed to implement std::allocator
LinearStdAllocator(LinearAllocator& allocator) explicit LinearStdAllocator(LinearAllocator& allocator)
: linearAllocator(allocator) {} : linearAllocator(allocator) {}
LinearStdAllocator(const LinearStdAllocator& other) LinearStdAllocator(const LinearStdAllocator& other)
: linearAllocator(other.linearAllocator) {} : linearAllocator(other.linearAllocator) {}
@@ -170,7 +170,7 @@ public:
}; };
// enable allocators to be constructed from other templated types // enable allocators to be constructed from other templated types
template <class U> template <class U>
LinearStdAllocator(const LinearStdAllocator<U>& other) LinearStdAllocator(const LinearStdAllocator<U>& other) // NOLINT(implicit)
: linearAllocator(other.linearAllocator) {} : linearAllocator(other.linearAllocator) {}
T* allocate(size_t num, const void* = 0) { T* allocate(size_t num, const void* = 0) {
@@ -195,7 +195,7 @@ bool operator!= (const LinearStdAllocator<T1>&, const LinearStdAllocator<T2>&) {
template <class T> template <class T>
class LsaVector : public std::vector<T, LinearStdAllocator<T>> { class LsaVector : public std::vector<T, LinearStdAllocator<T>> {
public: public:
LsaVector(const LinearStdAllocator<T>& allocator) explicit LsaVector(const LinearStdAllocator<T>& allocator)
: std::vector<T, LinearStdAllocator<T>>(allocator) {} : std::vector<T, LinearStdAllocator<T>>(allocator) {}
}; };