diff options
author | 2016-09-01 01:26:40 +0000 | |
---|---|---|
committer | 2016-09-01 01:26:40 +0000 | |
commit | 25c9f6cede5705406294a5043363952c316facb2 (patch) | |
tree | 8474859828713a024080ed5bb817374157f846d6 | |
parent | 2378ff89f4d9f4f2cb4595ba46fa3a2010c51961 (diff) | |
parent | 1f50f80aab31600406c7b93a1630d396228983f0 (diff) |
Merge "Fix google-explicit-constructor warnings in libs/hwui." am: 7207562ff7 am: d7a69e04eb am: 842f1e48e7
am: 1f50f80aab
Change-Id: I713bd07fee150cc684e630045e02872b23062a5a
-rw-r--r-- | libs/hwui/ClipArea.h | 10 | ||||
-rw-r--r-- | libs/hwui/DeferredLayerUpdater.h | 2 | ||||
-rw-r--r-- | libs/hwui/FontRenderer.h | 2 | ||||
-rw-r--r-- | libs/hwui/GpuMemoryTracker.h | 2 | ||||
-rw-r--r-- | libs/hwui/PropertyValuesAnimatorSet.h | 2 | ||||
-rw-r--r-- | libs/hwui/RecordedOp.h | 2 | ||||
-rw-r--r-- | libs/hwui/VectorDrawable.h | 12 | ||||
-rw-r--r-- | libs/hwui/hwui/Paint.h | 2 | ||||
-rw-r--r-- | libs/hwui/renderstate/OffscreenBufferPool.h | 2 | ||||
-rw-r--r-- | libs/hwui/tests/common/TestScene.h | 2 | ||||
-rw-r--r-- | libs/hwui/tests/common/TestUtils.h | 4 | ||||
-rw-r--r-- | libs/hwui/utils/FatVector.h | 4 | ||||
-rw-r--r-- | libs/hwui/utils/LinearAllocator.h | 6 |
13 files changed, 26 insertions, 26 deletions
diff --git a/libs/hwui/ClipArea.h b/libs/hwui/ClipArea.h index 53d9d03a3629..2e561601d452 100644 --- a/libs/hwui/ClipArea.h +++ b/libs/hwui/ClipArea.h @@ -97,9 +97,9 @@ enum class ClipMode { }; struct ClipBase { - ClipBase(ClipMode mode) + explicit ClipBase(ClipMode mode) : mode(mode) {} - ClipBase(const Rect& rect) + explicit ClipBase(const Rect& rect) : mode(ClipMode::Rectangle) , rect(rect) {} const ClipMode mode; @@ -112,19 +112,19 @@ struct ClipBase { }; struct ClipRect : ClipBase { - ClipRect(const Rect& rect) + explicit ClipRect(const Rect& rect) : ClipBase(rect) {} }; struct ClipRectList : ClipBase { - ClipRectList(const RectangleList& rectList) + explicit ClipRectList(const RectangleList& rectList) : ClipBase(ClipMode::RectangleList) , rectList(rectList) {} RectangleList rectList; }; struct ClipRegion : ClipBase { - ClipRegion(const SkRegion& region) + explicit ClipRegion(const SkRegion& region) : ClipBase(ClipMode::Region) , region(region) {} ClipRegion() diff --git a/libs/hwui/DeferredLayerUpdater.h b/libs/hwui/DeferredLayerUpdater.h index 2376295b7eff..742011253b94 100644 --- a/libs/hwui/DeferredLayerUpdater.h +++ b/libs/hwui/DeferredLayerUpdater.h @@ -35,7 +35,7 @@ class DeferredLayerUpdater : public VirtualLightRefBase { public: // Note that DeferredLayerUpdater assumes it is taking ownership of the layer // 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 bool setSize(int width, int height) { diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h index dedc4944299d..578beaa424b1 100644 --- a/libs/hwui/FontRenderer.h +++ b/libs/hwui/FontRenderer.h @@ -81,7 +81,7 @@ public: class FontRenderer { public: - FontRenderer(const uint8_t* gammaTable); + explicit FontRenderer(const uint8_t* gammaTable); ~FontRenderer(); void flushLargeCaches(std::vector<CacheTexture*>& cacheTextures); diff --git a/libs/hwui/GpuMemoryTracker.h b/libs/hwui/GpuMemoryTracker.h index 851aeae8352c..bfb1bf1ba098 100644 --- a/libs/hwui/GpuMemoryTracker.h +++ b/libs/hwui/GpuMemoryTracker.h @@ -52,7 +52,7 @@ public: static void onFrameCompleted(); protected: - GpuMemoryTracker(GpuObjectType type) : mType(type) { + explicit GpuMemoryTracker(GpuObjectType type) : mType(type) { ASSERT_GPU_THREAD(); startTrackingObject(); } diff --git a/libs/hwui/PropertyValuesAnimatorSet.h b/libs/hwui/PropertyValuesAnimatorSet.h index e208b08cc27a..a5d9e869196f 100644 --- a/libs/hwui/PropertyValuesAnimatorSet.h +++ b/libs/hwui/PropertyValuesAnimatorSet.h @@ -89,7 +89,7 @@ private: class PropertyAnimatorSetListener : public AnimationListener { public: - PropertyAnimatorSetListener(PropertyValuesAnimatorSet* set) : mSet(set) {} + explicit PropertyAnimatorSetListener(PropertyValuesAnimatorSet* set) : mSet(set) {} virtual void onAnimationFinished(BaseRenderNodeAnimator* animator) override; private: diff --git a/libs/hwui/RecordedOp.h b/libs/hwui/RecordedOp.h index f3078ce58503..a65c22c3a555 100644 --- a/libs/hwui/RecordedOp.h +++ b/libs/hwui/RecordedOp.h @@ -508,7 +508,7 @@ struct LayerOp : RecordedOp { , mode(PaintUtils::getXfermodeDirect(paint)) , colorFilter(paint ? paint->getColorFilter() : nullptr) {} - LayerOp(RenderNode& node) + explicit LayerOp(RenderNode& node) : RecordedOp(RecordedOpId::LayerOp, Rect(node.getWidth(), node.getHeight()), Matrix4::identity(), nullptr, nullptr) , layerHandle(node.getLayerHandle()) , alpha(node.properties().layerProperties().alpha() / 255.0f) diff --git a/libs/hwui/VectorDrawable.h b/libs/hwui/VectorDrawable.h index cf77cbbaff94..e68fbf4c6243 100644 --- a/libs/hwui/VectorDrawable.h +++ b/libs/hwui/VectorDrawable.h @@ -97,7 +97,7 @@ class ANDROID_API Node { public: class Properties { public: - Properties(Node* node) : mNode(node) {} + explicit Properties(Node* node) : mNode(node) {} inline void onPropertyChanged() { mNode->onPropertyChanged(this); } @@ -139,7 +139,7 @@ public: 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(); @@ -225,7 +225,7 @@ public: 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); @@ -416,7 +416,7 @@ class ANDROID_API Group: public Node { 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; @@ -546,7 +546,7 @@ private: class ANDROID_API Tree : public VirtualLightRefBase { public: - Tree(Group* rootNode) : mRootNode(rootNode) { + explicit Tree(Group* rootNode) : mRootNode(rootNode) { mRootNode->setPropertyChangedListener(&mPropertyChangedListener); } @@ -583,7 +583,7 @@ public: 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 { diff --git a/libs/hwui/hwui/Paint.h b/libs/hwui/hwui/Paint.h index 6307926ec43e..10a1db9ace3d 100644 --- a/libs/hwui/hwui/Paint.h +++ b/libs/hwui/hwui/Paint.h @@ -30,7 +30,7 @@ class ANDROID_API Paint : public SkPaint { public: Paint(); Paint(const Paint& paint); - Paint(const SkPaint& paint); + Paint(const SkPaint& paint); // NOLINT(implicit) ~Paint(); Paint& operator=(const Paint& other); diff --git a/libs/hwui/renderstate/OffscreenBufferPool.h b/libs/hwui/renderstate/OffscreenBufferPool.h index 73a3392a7811..26d4e3654a48 100644 --- a/libs/hwui/renderstate/OffscreenBufferPool.h +++ b/libs/hwui/renderstate/OffscreenBufferPool.h @@ -126,7 +126,7 @@ private: : width(OffscreenBuffer::computeIdealDimension(layerWidth)) , height(OffscreenBuffer::computeIdealDimension(layerHeight)) {} - Entry(OffscreenBuffer* layer) + explicit Entry(OffscreenBuffer* layer) : layer(layer) , width(layer->texture.width()) , height(layer->texture.height()) { diff --git a/libs/hwui/tests/common/TestScene.h b/libs/hwui/tests/common/TestScene.h index e3777ca2c3c2..f6f7c62a4f63 100644 --- a/libs/hwui/tests/common/TestScene.h +++ b/libs/hwui/tests/common/TestScene.h @@ -52,7 +52,7 @@ public: class Registrar { public: - Registrar(const TestScene::Info& info) { + explicit Registrar(const TestScene::Info& info) { TestScene::registerScene(info); } private: diff --git a/libs/hwui/tests/common/TestUtils.h b/libs/hwui/tests/common/TestUtils.h index 5c28d4d6fb92..78e9bc475826 100644 --- a/libs/hwui/tests/common/TestUtils.h +++ b/libs/hwui/tests/common/TestUtils.h @@ -91,7 +91,7 @@ public: public: SignalingDtor() : mSignal(nullptr) {} - SignalingDtor(int* signal) + explicit SignalingDtor(int* signal) : mSignal(signal) {} void setSignal(int* signal) { mSignal = signal; @@ -213,7 +213,7 @@ public: class TestTask : public renderthread::RenderTask { public: - TestTask(RtCallback rtCallback) + explicit TestTask(RtCallback rtCallback) : rtCallback(rtCallback) {} virtual ~TestTask() {} virtual void run() override; diff --git a/libs/hwui/utils/FatVector.h b/libs/hwui/utils/FatVector.h index 93d37c28f8a4..df8cb076e763 100644 --- a/libs/hwui/utils/FatVector.h +++ b/libs/hwui/utils/FatVector.h @@ -53,7 +53,7 @@ public: typedef T value_type; // needed to implement std::allocator typedef T* pointer; // needed to implement std::allocator - InlineStdAllocator(Allocation& allocation) + explicit InlineStdAllocator(Allocation& allocation) : mAllocation(allocation) {} InlineStdAllocator(const InlineStdAllocator& other) : mAllocation(other.mAllocation) {} @@ -93,7 +93,7 @@ public: this->reserve(SIZE); } - FatVector(size_t capacity) : FatVector() { + explicit FatVector(size_t capacity) : FatVector() { this->resize(capacity); } diff --git a/libs/hwui/utils/LinearAllocator.h b/libs/hwui/utils/LinearAllocator.h index 34c8c6beea81..f95a6fe5060e 100644 --- a/libs/hwui/utils/LinearAllocator.h +++ b/libs/hwui/utils/LinearAllocator.h @@ -157,7 +157,7 @@ public: typedef T value_type; // needed to implement std::allocator typedef T* pointer; // needed to implement std::allocator - LinearStdAllocator(LinearAllocator& allocator) + explicit LinearStdAllocator(LinearAllocator& allocator) : linearAllocator(allocator) {} LinearStdAllocator(const LinearStdAllocator& other) : linearAllocator(other.linearAllocator) {} @@ -170,7 +170,7 @@ public: }; // enable allocators to be constructed from other templated types template <class U> - LinearStdAllocator(const LinearStdAllocator<U>& other) + LinearStdAllocator(const LinearStdAllocator<U>& other) // NOLINT(implicit) : linearAllocator(other.linearAllocator) {} T* allocate(size_t num, const void* = 0) { @@ -195,7 +195,7 @@ bool operator!= (const LinearStdAllocator<T1>&, const LinearStdAllocator<T2>&) { template <class T> class LsaVector : public std::vector<T, LinearStdAllocator<T>> { public: - LsaVector(const LinearStdAllocator<T>& allocator) + explicit LsaVector(const LinearStdAllocator<T>& allocator) : std::vector<T, LinearStdAllocator<T>>(allocator) {} }; |