diff options
| author | 2019-01-14 19:15:44 +0000 | |
|---|---|---|
| committer | 2019-01-14 19:15:44 +0000 | |
| commit | 0c667f03efac539752b3606080e3eeac30fa0838 (patch) | |
| tree | dcb5ff7b3c77cfbe1ffe07b1049632df52a8200c | |
| parent | ff9a870b5bcda9d06c32cae351504d3d6ed59569 (diff) | |
| parent | 227490498662d7a8716e20d9b7dfc6e7650ff910 (diff) | |
Merge "Fix/suppress surfaceflinger google-explicit-constructor warnings"
9 files changed, 21 insertions, 25 deletions
diff --git a/services/surfaceflinger/DisplayHardware/ComposerHal.cpp b/services/surfaceflinger/DisplayHardware/ComposerHal.cpp index 37ba4339c3..f190b7122e 100644 --- a/services/surfaceflinger/DisplayHardware/ComposerHal.cpp +++ b/services/surfaceflinger/DisplayHardware/ComposerHal.cpp @@ -41,13 +41,12 @@ namespace { class BufferHandle { public: - BufferHandle(const native_handle_t* buffer) - { + explicit BufferHandle(const native_handle_t* buffer) { // nullptr is not a valid handle to HIDL mHandle = (buffer) ? buffer : native_handle_init(mStorage, 0, 0); } - operator const hidl_handle&() const + operator const hidl_handle&() const // NOLINT(google-explicit-constructor) { return mHandle; } @@ -81,7 +80,7 @@ public: } } - operator const hidl_handle&() const + operator const hidl_handle&() const // NOLINT(google-explicit-constructor) { return mHandle; } diff --git a/services/surfaceflinger/DisplayHardware/ComposerHal.h b/services/surfaceflinger/DisplayHardware/ComposerHal.h index beee53966f..442006c748 100644 --- a/services/surfaceflinger/DisplayHardware/ComposerHal.h +++ b/services/surfaceflinger/DisplayHardware/ComposerHal.h @@ -267,7 +267,7 @@ private: // Composer is a wrapper to IComposer, a proxy to server-side composer. class Composer final : public Hwc2::Composer { public: - Composer(const std::string& serviceName); + explicit Composer(const std::string& serviceName); ~Composer() override; std::vector<IComposer::Capability> getCapabilities() override; @@ -383,7 +383,7 @@ public: private: class CommandWriter : public CommandWriterBase { public: - CommandWriter(uint32_t initialMaxSize); + explicit CommandWriter(uint32_t initialMaxSize); ~CommandWriter() override; void setLayerInfo(uint32_t type, uint32_t appId); diff --git a/services/surfaceflinger/StartPropertySetThread.h b/services/surfaceflinger/StartPropertySetThread.h index a64c21b21f..bbdcde2809 100644 --- a/services/surfaceflinger/StartPropertySetThread.h +++ b/services/surfaceflinger/StartPropertySetThread.h @@ -33,7 +33,7 @@ class StartPropertySetThread : public Thread { // Any property_set() will block during init stage so need to be offloaded // to this thread. see b/63844978. public: - StartPropertySetThread(bool timestampPropertyValue); + explicit StartPropertySetThread(bool timestampPropertyValue); status_t Start(); private: virtual bool threadLoop(); diff --git a/services/surfaceflinger/tests/Transaction_test.cpp b/services/surfaceflinger/tests/Transaction_test.cpp index 5108279043..79f27dfe0b 100644 --- a/services/surfaceflinger/tests/Transaction_test.cpp +++ b/services/surfaceflinger/tests/Transaction_test.cpp @@ -281,7 +281,7 @@ public: void expectChildColor(uint32_t x, uint32_t y) { checkPixel(x, y, 200, 200, 200); } - ScreenCapture(const sp<GraphicBuffer>& outBuffer) : mOutBuffer(outBuffer) { + explicit ScreenCapture(const sp<GraphicBuffer>& outBuffer) : mOutBuffer(outBuffer) { mOutBuffer->lock(GRALLOC_USAGE_SW_READ_OFTEN, reinterpret_cast<void**>(&mPixels)); } diff --git a/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp b/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp index 973156a7c4..eeb6efe576 100644 --- a/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp +++ b/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp @@ -81,7 +81,7 @@ public: class DelayedEventGenerator { public: - DelayedEventGenerator(std::function<void()> onTimerExpired) + explicit DelayedEventGenerator(std::function<void()> onTimerExpired) : mOnTimerExpired(onTimerExpired), mThread([this]() { loop(); }) {} ~DelayedEventGenerator() { diff --git a/services/surfaceflinger/tests/fakehwc/FakeComposerService.h b/services/surfaceflinger/tests/fakehwc/FakeComposerService.h index c439b7e3b2..a3fb8a6248 100644 --- a/services/surfaceflinger/tests/fakehwc/FakeComposerService.h +++ b/services/surfaceflinger/tests/fakehwc/FakeComposerService.h @@ -26,7 +26,7 @@ namespace sftest { class FakeComposerService : public IComposer { public: - FakeComposerService(android::sp<ComposerClient>& client); + explicit FakeComposerService(android::sp<ComposerClient>& client); virtual ~FakeComposerService(); Return<void> getCapabilities(getCapabilities_cb hidl_cb) override; diff --git a/services/surfaceflinger/tests/fakehwc/FakeComposerUtils.h b/services/surfaceflinger/tests/fakehwc/FakeComposerUtils.h index 1258a970c7..7d20d3c075 100644 --- a/services/surfaceflinger/tests/fakehwc/FakeComposerUtils.h +++ b/services/surfaceflinger/tests/fakehwc/FakeComposerUtils.h @@ -100,10 +100,7 @@ public: */ class TransactionScope : public android::SurfaceComposerClient::Transaction { public: - TransactionScope(FakeComposerClient& composer) : - Transaction(), - mComposer(composer) { - } + explicit TransactionScope(FakeComposerClient& composer) : Transaction(), mComposer(composer) {} ~TransactionScope() { int frameCount = mComposer.getFrameCount(); diff --git a/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.h b/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.h index d7082f3cb5..06ae314899 100644 --- a/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.h +++ b/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.h @@ -171,7 +171,7 @@ class Hwc2TestColor; class Hwc2TestBlendMode : public Hwc2TestProperty<hwc2_blend_mode_t> { public: - Hwc2TestBlendMode(Hwc2TestCoverage coverage); + explicit Hwc2TestBlendMode(Hwc2TestCoverage coverage); std::string dump() const override; @@ -192,8 +192,8 @@ protected: class Hwc2TestColor : public Hwc2TestProperty<hwc_color_t> { public: - Hwc2TestColor(Hwc2TestCoverage coverage, - hwc2_blend_mode_t blendMode = HWC2_BLEND_MODE_NONE); + explicit Hwc2TestColor(Hwc2TestCoverage coverage, + hwc2_blend_mode_t blendMode = HWC2_BLEND_MODE_NONE); std::string dump() const override; @@ -217,7 +217,7 @@ protected: class Hwc2TestComposition : public Hwc2TestProperty<hwc2_composition_t> { public: - Hwc2TestComposition(Hwc2TestCoverage coverage); + explicit Hwc2TestComposition(Hwc2TestCoverage coverage); std::string dump() const override; @@ -232,7 +232,7 @@ protected: class Hwc2TestDataspace : public Hwc2TestProperty<android::ui::Dataspace> { public: - Hwc2TestDataspace(Hwc2TestCoverage coverage); + explicit Hwc2TestDataspace(Hwc2TestCoverage coverage); std::string dump() const override; @@ -248,7 +248,7 @@ class Hwc2TestVirtualBuffer; class Hwc2TestDisplayDimension : public Hwc2TestProperty<UnsignedArea> { public: - Hwc2TestDisplayDimension(Hwc2TestCoverage coverage); + explicit Hwc2TestDisplayDimension(Hwc2TestCoverage coverage); std::string dump() const; @@ -291,7 +291,7 @@ protected: class Hwc2TestPlaneAlpha : public Hwc2TestProperty<float> { public: - Hwc2TestPlaneAlpha(Hwc2TestCoverage coverage); + explicit Hwc2TestPlaneAlpha(Hwc2TestCoverage coverage); std::string dump() const override; @@ -306,7 +306,7 @@ protected: class Hwc2TestSourceCrop : public Hwc2TestProperty<hwc_frect_t> { public: - Hwc2TestSourceCrop(Hwc2TestCoverage coverage, const Area& bufferArea = {0, 0}); + explicit Hwc2TestSourceCrop(Hwc2TestCoverage coverage, const Area& bufferArea = {0, 0}); std::string dump() const override; @@ -330,7 +330,7 @@ protected: class Hwc2TestSurfaceDamage : public Hwc2TestProperty<hwc_region_t> { public: - Hwc2TestSurfaceDamage(Hwc2TestCoverage coverage); + explicit Hwc2TestSurfaceDamage(Hwc2TestCoverage coverage); ~Hwc2TestSurfaceDamage(); std::string dump() const override; @@ -356,7 +356,7 @@ protected: class Hwc2TestTransform : public Hwc2TestProperty<hwc_transform_t> { public: - Hwc2TestTransform(Hwc2TestCoverage coverage); + explicit Hwc2TestTransform(Hwc2TestCoverage coverage); std::string dump() const override; diff --git a/services/surfaceflinger/tests/hwc2/Hwc2TestVirtualDisplay.h b/services/surfaceflinger/tests/hwc2/Hwc2TestVirtualDisplay.h index 10c8ef0f1c..5a74a6c104 100644 --- a/services/surfaceflinger/tests/hwc2/Hwc2TestVirtualDisplay.h +++ b/services/surfaceflinger/tests/hwc2/Hwc2TestVirtualDisplay.h @@ -29,7 +29,7 @@ class Hwc2TestVirtualDisplay { public: - Hwc2TestVirtualDisplay(Hwc2TestCoverage coverage); + explicit Hwc2TestVirtualDisplay(Hwc2TestCoverage coverage); std::string dump() const; |