From fe94a225a556265e93b1ebfe520d3637fe7cc67d Mon Sep 17 00:00:00 2001 From: chaviw Date: Wed, 21 Aug 2019 13:52:59 -0700 Subject: [Mirror Layers] Added mirrorSurface API to enable mirroring (3/4) Added a new SurfaceComposer API called mirrorSurface that allows a client to request a mirror of a particular heirarchy starting from the passed in layer. The API will return a SurfaceControl that's the parent of the mirrored layer that can be updated by the client. Test: MirrorLayerTest Bug: 131622422 Change-Id: Ia6047f0334eabfc59d6222b2edfd4e9576ba31e5 --- services/surfaceflinger/Client.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'services/surfaceflinger/Client.cpp') diff --git a/services/surfaceflinger/Client.cpp b/services/surfaceflinger/Client.cpp index 6bfd302b5c..c7ed9b0412 100644 --- a/services/surfaceflinger/Client.cpp +++ b/services/surfaceflinger/Client.cpp @@ -106,6 +106,10 @@ status_t Client::createWithSurfaceParent(const String8& name, uint32_t w, uint32 nullptr, layer); } +status_t Client::mirrorSurface(const sp& mirrorFromHandle, sp* outHandle) { + return mFlinger->mirrorLayer(this, mirrorFromHandle, outHandle); +} + status_t Client::clearLayerFrameStats(const sp& handle) const { sp layer = getLayerUser(handle); if (layer == nullptr) { -- cgit v1.2.3-59-g8ed1b From 1acd6961737cc32627d8298999878c2674328b6b Mon Sep 17 00:00:00 2001 From: Valerie Hau Date: Mon, 28 Oct 2019 16:35:48 -0700 Subject: Pass back transformHint on Surface Creation Bug: 141939598 Test: build, boot, SurfaceFlinger_test, libgui_test, libsurfaceflinger_unittest Change-Id: I35a77ac1399ad4248cb1c2357afb869de4c15170 --- libs/gui/ISurfaceComposerClient.cpp | 13 +++++---- libs/gui/SurfaceComposerClient.cpp | 29 +++++++++++++----- libs/gui/SurfaceControl.cpp | 34 +++++++++++++++------- libs/gui/include/gui/ISurfaceComposerClient.h | 5 ++-- libs/gui/include/gui/SurfaceComposerClient.h | 16 +++++----- libs/gui/include/gui/SurfaceControl.h | 7 ++++- services/surfaceflinger/BufferStateLayer.h | 1 + services/surfaceflinger/Client.cpp | 9 +++--- services/surfaceflinger/Client.h | 6 ++-- services/surfaceflinger/SurfaceFlinger.cpp | 11 ++++--- services/surfaceflinger/SurfaceFlinger.h | 6 ++-- .../tests/LayerRenderTypeTransaction_test.cpp | 11 ++++++- .../surfaceflinger/tests/LayerTransactionTest.h | 18 +++++++----- .../tests/TransactionTestHarnesses.h | 6 ++-- 14 files changed, 116 insertions(+), 56 deletions(-) (limited to 'services/surfaceflinger/Client.cpp') diff --git a/libs/gui/ISurfaceComposerClient.cpp b/libs/gui/ISurfaceComposerClient.cpp index b98e48b52a..621cf5950b 100644 --- a/libs/gui/ISurfaceComposerClient.cpp +++ b/libs/gui/ISurfaceComposerClient.cpp @@ -49,25 +49,28 @@ public: status_t createSurface(const String8& name, uint32_t width, uint32_t height, PixelFormat format, uint32_t flags, const sp& parent, LayerMetadata metadata, - sp* handle, sp* gbp) override { + sp* handle, sp* gbp, + uint32_t* outTransformHint) override { return callRemote(Tag::CREATE_SURFACE, name, width, height, format, flags, parent, std::move(metadata), - handle, gbp); + handle, gbp, + outTransformHint); } status_t createWithSurfaceParent(const String8& name, uint32_t width, uint32_t height, PixelFormat format, uint32_t flags, const sp& parent, LayerMetadata metadata, sp* handle, - sp* gbp) override { + sp* gbp, + uint32_t* outTransformHint) override { return callRemote(Tag::CREATE_WITH_SURFACE_PARENT, name, width, height, format, flags, parent, - std::move(metadata), handle, - gbp); + std::move(metadata), handle, gbp, + outTransformHint); } status_t clearLayerFrameStats(const sp& handle) const override { diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index e9079efd29..3178b6af8d 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -224,6 +224,8 @@ void TransactionCompletedListener::onTransactionCompleted(ListenerStats listener surfaceStats.acquireTime, surfaceStats.previousReleaseFence, surfaceStats.transformHint); + surfaceControls[surfaceStats.surfaceControl]->setTransformHint( + surfaceStats.transformHint); } callbackFunction(transactionStats.latchTime, transactionStats.presentFence, @@ -1451,16 +1453,19 @@ void SurfaceComposerClient::dispose() { sp SurfaceComposerClient::createSurface(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, SurfaceControl* parent, - LayerMetadata metadata) { + LayerMetadata metadata, + uint32_t* outTransformHint) { sp s; - createSurfaceChecked(name, w, h, format, &s, flags, parent, std::move(metadata)); + createSurfaceChecked(name, w, h, format, &s, flags, parent, std::move(metadata), + outTransformHint); return s; } sp SurfaceComposerClient::createWithSurfaceParent(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, Surface* parent, - LayerMetadata metadata) { + LayerMetadata metadata, + uint32_t* outTransformHint) { sp sur; status_t err = mStatus; @@ -1469,8 +1474,12 @@ sp SurfaceComposerClient::createWithSurfaceParent(const String8& sp parentGbp = parent->getIGraphicBufferProducer(); sp gbp; + uint32_t transformHint = 0; err = mClient->createWithSurfaceParent(name, w, h, format, flags, parentGbp, - std::move(metadata), &handle, &gbp); + std::move(metadata), &handle, &gbp, &transformHint); + if (outTransformHint) { + *outTransformHint = transformHint; + } ALOGE_IF(err, "SurfaceComposerClient::createWithSurfaceParent error %s", strerror(-err)); if (err == NO_ERROR) { return new SurfaceControl(this, handle, gbp, true /* owned */); @@ -1482,8 +1491,8 @@ sp SurfaceComposerClient::createWithSurfaceParent(const String8& status_t SurfaceComposerClient::createSurfaceChecked(const String8& name, uint32_t w, uint32_t h, PixelFormat format, sp* outSurface, uint32_t flags, - SurfaceControl* parent, - LayerMetadata metadata) { + SurfaceControl* parent, LayerMetadata metadata, + uint32_t* outTransformHint) { sp sur; status_t err = mStatus; @@ -1496,11 +1505,15 @@ status_t SurfaceComposerClient::createSurfaceChecked(const String8& name, uint32 parentHandle = parent->getHandle(); } + uint32_t transformHint = 0; err = mClient->createSurface(name, w, h, format, flags, parentHandle, std::move(metadata), - &handle, &gbp); + &handle, &gbp, &transformHint); + if (outTransformHint) { + *outTransformHint = transformHint; + } ALOGE_IF(err, "SurfaceComposerClient::createSurface error %s", strerror(-err)); if (err == NO_ERROR) { - *outSurface = new SurfaceControl(this, handle, gbp, true /* owned */); + *outSurface = new SurfaceControl(this, handle, gbp, true /* owned */, transformHint); } } return err; diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp index 071314f082..6292388ac3 100644 --- a/libs/gui/SurfaceControl.cpp +++ b/libs/gui/SurfaceControl.cpp @@ -45,20 +45,21 @@ namespace android { // SurfaceControl // ============================================================================ -SurfaceControl::SurfaceControl( - const sp& client, - const sp& handle, - const sp& gbp, - bool owned) - : mClient(client), mHandle(handle), mGraphicBufferProducer(gbp), mOwned(owned) -{ -} +SurfaceControl::SurfaceControl(const sp& client, const sp& handle, + const sp& gbp, bool owned, + uint32_t transform) + : mClient(client), + mHandle(handle), + mGraphicBufferProducer(gbp), + mOwned(owned), + mTransformHint(transform) {} SurfaceControl::SurfaceControl(const sp& other) { mClient = other->mClient; mHandle = other->mHandle; mGraphicBufferProducer = other->mGraphicBufferProducer; mOwned = false; + mTransformHint = other->mTransformHint; } SurfaceControl::~SurfaceControl() @@ -171,11 +172,22 @@ sp SurfaceControl::getClient() const return mClient; } +uint32_t SurfaceControl::getTransformHint() const { + Mutex::Autolock _l(mLock); + return mTransformHint; +} + +void SurfaceControl::setTransformHint(uint32_t hint) { + Mutex::Autolock _l(mLock); + mTransformHint = hint; +} + void SurfaceControl::writeToParcel(Parcel* parcel) { parcel->writeStrongBinder(ISurfaceComposerClient::asBinder(mClient->getClient())); parcel->writeStrongBinder(mHandle); parcel->writeStrongBinder(IGraphicBufferProducer::asBinder(mGraphicBufferProducer)); + parcel->writeUint32(mTransformHint); } sp SurfaceControl::readFromParcel(const Parcel* parcel) { @@ -189,10 +201,12 @@ sp SurfaceControl::readFromParcel(const Parcel* parcel) { sp gbp; parcel->readNullableStrongBinder(&gbp); + uint32_t transformHint = parcel->readUint32(); // We aren't the original owner of the surface. return new SurfaceControl(new SurfaceComposerClient( - interface_cast(client)), - handle.get(), interface_cast(gbp), false /* owned */); + interface_cast(client)), + handle.get(), interface_cast(gbp), + false /* owned */, transformHint); } // ---------------------------------------------------------------------------- diff --git a/libs/gui/include/gui/ISurfaceComposerClient.h b/libs/gui/include/gui/ISurfaceComposerClient.h index 5fe7ca5344..2b65d2f42d 100644 --- a/libs/gui/include/gui/ISurfaceComposerClient.h +++ b/libs/gui/include/gui/ISurfaceComposerClient.h @@ -56,7 +56,7 @@ public: virtual status_t createSurface(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, const sp& parent, LayerMetadata metadata, sp* handle, - sp* gbp) = 0; + sp* gbp, uint32_t* outTransformHint) = 0; /* * Requires ACCESS_SURFACE_FLINGER permission @@ -65,7 +65,8 @@ public: PixelFormat format, uint32_t flags, const sp& parent, LayerMetadata metadata, sp* handle, - sp* gbp) = 0; + sp* gbp, + uint32_t* outTransformHint) = 0; /* * Requires ACCESS_SURFACE_FLINGER permission diff --git a/libs/gui/include/gui/SurfaceComposerClient.h b/libs/gui/include/gui/SurfaceComposerClient.h index 08f4e9e9d3..7a9598cddd 100644 --- a/libs/gui/include/gui/SurfaceComposerClient.h +++ b/libs/gui/include/gui/SurfaceComposerClient.h @@ -226,18 +226,18 @@ public: PixelFormat format, // pixel-format desired uint32_t flags = 0, // usage flags SurfaceControl* parent = nullptr, // parent - LayerMetadata metadata = LayerMetadata() // metadata - ); + LayerMetadata metadata = LayerMetadata(), // metadata + uint32_t* outTransformHint = nullptr); status_t createSurfaceChecked(const String8& name, // name of the surface uint32_t w, // width in pixel uint32_t h, // height in pixel PixelFormat format, // pixel-format desired sp* outSurface, - uint32_t flags = 0, // usage flags - SurfaceControl* parent = nullptr, // parent - LayerMetadata metadata = LayerMetadata() // metadata - ); + uint32_t flags = 0, // usage flags + SurfaceControl* parent = nullptr, // parent + LayerMetadata metadata = LayerMetadata(), // metadata + uint32_t* outTransformHint = nullptr); //! Create a surface sp createWithSurfaceParent(const String8& name, // name of the surface @@ -246,8 +246,8 @@ public: PixelFormat format, // pixel-format desired uint32_t flags = 0, // usage flags Surface* parent = nullptr, // parent - LayerMetadata metadata = LayerMetadata() // metadata - ); + LayerMetadata metadata = LayerMetadata(), // metadata + uint32_t* outTransformHint = nullptr); // Creates a mirrored hierarchy for the mirrorFromSurface. This returns a SurfaceControl // which is a parent of the root of the mirrored hierarchy. diff --git a/libs/gui/include/gui/SurfaceControl.h b/libs/gui/include/gui/SurfaceControl.h index ae4a14690f..7bc7c686c9 100644 --- a/libs/gui/include/gui/SurfaceControl.h +++ b/libs/gui/include/gui/SurfaceControl.h @@ -82,10 +82,14 @@ public: sp getClient() const; + uint32_t getTransformHint() const; + + void setTransformHint(uint32_t hint); + explicit SurfaceControl(const sp& other); SurfaceControl(const sp& client, const sp& handle, - const sp& gbp, bool owned); + const sp& gbp, bool owned, uint32_t transformHint = 0); private: // can't be copied @@ -106,6 +110,7 @@ private: mutable Mutex mLock; mutable sp mSurfaceData; bool mOwned; + uint32_t mTransformHint; }; }; // namespace android diff --git a/services/surfaceflinger/BufferStateLayer.h b/services/surfaceflinger/BufferStateLayer.h index 289bb1756f..8e6a70c748 100644 --- a/services/surfaceflinger/BufferStateLayer.h +++ b/services/surfaceflinger/BufferStateLayer.h @@ -63,6 +63,7 @@ public: } Rect getCrop(const Layer::State& s) const; + uint32_t getTransformHint() const { return mTransformHint; } bool setTransform(uint32_t transform) override; bool setTransformToDisplayInverse(bool transformToDisplayInverse) override; bool setCrop(const Rect& crop) override; diff --git a/services/surfaceflinger/Client.cpp b/services/surfaceflinger/Client.cpp index c7ed9b0412..f3313645fa 100644 --- a/services/surfaceflinger/Client.cpp +++ b/services/surfaceflinger/Client.cpp @@ -75,17 +75,18 @@ sp Client::getLayerUser(const sp& handle) const status_t Client::createSurface(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, const sp& parentHandle, LayerMetadata metadata, sp* handle, - sp* gbp) { + sp* gbp, uint32_t* outTransformHint) { // We rely on createLayer to check permissions. return mFlinger->createLayer(name, this, w, h, format, flags, std::move(metadata), handle, gbp, - parentHandle); + parentHandle, nullptr, outTransformHint); } status_t Client::createWithSurfaceParent(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, const sp& parent, LayerMetadata metadata, sp* handle, - sp* gbp) { + sp* gbp, + uint32_t* outTransformHint) { if (mFlinger->authenticateSurfaceTexture(parent) == false) { ALOGE("failed to authenticate surface texture"); // The extra parent layer check below before returning is to help with debugging @@ -103,7 +104,7 @@ status_t Client::createWithSurfaceParent(const String8& name, uint32_t w, uint32 } return mFlinger->createLayer(name, this, w, h, format, flags, std::move(metadata), handle, gbp, - nullptr, layer); + nullptr, layer, outTransformHint); } status_t Client::mirrorSurface(const sp& mirrorFromHandle, sp* outHandle) { diff --git a/services/surfaceflinger/Client.h b/services/surfaceflinger/Client.h index 7d7cef8c50..e9063e5bb6 100644 --- a/services/surfaceflinger/Client.h +++ b/services/surfaceflinger/Client.h @@ -54,13 +54,15 @@ private: virtual status_t createSurface(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, const sp& parent, LayerMetadata metadata, sp* handle, - sp* gbp); + sp* gbp, + uint32_t* outTransformHint = nullptr); virtual status_t createWithSurfaceParent(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, const sp& parent, LayerMetadata metadata, sp* handle, - sp* gbp); + sp* gbp, + uint32_t* outTransformHint = nullptr); status_t mirrorSurface(const sp& mirrorFromHandle, sp* handle); diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 057669b376..018d687574 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3432,8 +3432,8 @@ status_t SurfaceFlinger::createLayer(const String8& name, const sp& clie uint32_t h, PixelFormat format, uint32_t flags, LayerMetadata metadata, sp* handle, sp* gbp, - const sp& parentHandle, - const sp& parentLayer) { + const sp& parentHandle, const sp& parentLayer, + uint32_t* outTransformHint) { if (int32_t(w|h) < 0) { ALOGE("createLayer() failed, w or h is negative (w=%d, h=%d)", int(w), int(h)); @@ -3470,7 +3470,7 @@ status_t SurfaceFlinger::createLayer(const String8& name, const sp& clie break; case ISurfaceComposerClient::eFXSurfaceBufferState: result = createBufferStateLayer(client, std::move(uniqueName), w, h, flags, - std::move(metadata), handle, &layer); + std::move(metadata), handle, outTransformHint, &layer); break; case ISurfaceComposerClient::eFXSurfaceColor: // check if buffer size is set for color layer. @@ -3585,11 +3585,14 @@ status_t SurfaceFlinger::createBufferQueueLayer(const sp& client, std::s status_t SurfaceFlinger::createBufferStateLayer(const sp& client, std::string name, uint32_t w, uint32_t h, uint32_t flags, LayerMetadata metadata, sp* handle, - sp* outLayer) { + uint32_t* outTransformHint, sp* outLayer) { LayerCreationArgs args(this, client, std::move(name), w, h, flags, std::move(metadata)); args.displayDevice = getDefaultDisplayDevice(); args.textureName = getNewTexture(); sp layer = getFactory().createBufferStateLayer(args); + if (outTransformHint) { + *outTransformHint = layer->getTransformHint(); + } *handle = layer->getHandle(); *outLayer = layer; diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index b719245caa..a5987b7861 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -605,7 +605,8 @@ private: status_t createLayer(const String8& name, const sp& client, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, LayerMetadata metadata, sp* handle, sp* gbp, - const sp& parentHandle, const sp& parentLayer = nullptr); + const sp& parentHandle, const sp& parentLayer = nullptr, + uint32_t* outTransformHint = nullptr); status_t createBufferQueueLayer(const sp& client, std::string name, uint32_t w, uint32_t h, uint32_t flags, LayerMetadata metadata, @@ -614,7 +615,8 @@ private: status_t createBufferStateLayer(const sp& client, std::string name, uint32_t w, uint32_t h, uint32_t flags, LayerMetadata metadata, - sp* outHandle, sp* outLayer); + sp* outHandle, uint32_t* outTransformHint, + sp* outLayer); status_t createColorLayer(const sp& client, std::string name, uint32_t w, uint32_t h, uint32_t flags, LayerMetadata metadata, sp* outHandle, diff --git a/services/surfaceflinger/tests/LayerRenderTypeTransaction_test.cpp b/services/surfaceflinger/tests/LayerRenderTypeTransaction_test.cpp index a48f553d74..999e82dbd2 100644 --- a/services/surfaceflinger/tests/LayerRenderTypeTransaction_test.cpp +++ b/services/surfaceflinger/tests/LayerRenderTypeTransaction_test.cpp @@ -15,9 +15,9 @@ */ #include +#include #include #include "TransactionTestHarnesses.h" - namespace android { using android::hardware::graphics::common::V1_1::BufferUsage; @@ -188,6 +188,15 @@ TEST_P(LayerRenderTypeTransactionTest, SetSizeWithScaleToWindow_BufferQueue) { getScreenCapture()->expectColor(Rect(0, 0, 64, 64), Color::RED); } +TEST_P(LayerRenderTypeTransactionTest, CreateLayer_BufferState) { + uint32_t transformHint = ui::Transform::orientation_flags::ROT_INVALID; + sp layer; + ASSERT_NO_FATAL_FAILURE(layer = createLayer("test", 32, 32, + ISurfaceComposerClient::eFXSurfaceBufferState, + /*parent*/ nullptr, &transformHint)); + ASSERT_NE(ui::Transform::orientation_flags::ROT_INVALID, transformHint); +} + void LayerRenderTypeTransactionTest::setRelativeZBasicHelper(uint32_t layerType) { sp layerR; sp layerG; diff --git a/services/surfaceflinger/tests/LayerTransactionTest.h b/services/surfaceflinger/tests/LayerTransactionTest.h index 7edddb6ea3..f7a6d964f0 100644 --- a/services/surfaceflinger/tests/LayerTransactionTest.h +++ b/services/surfaceflinger/tests/LayerTransactionTest.h @@ -53,9 +53,10 @@ protected: virtual sp createLayer(const sp& client, const char* name, uint32_t width, uint32_t height, - uint32_t flags = 0, SurfaceControl* parent = nullptr) { - auto layer = - createSurface(client, name, width, height, PIXEL_FORMAT_RGBA_8888, flags, parent); + uint32_t flags = 0, SurfaceControl* parent = nullptr, + uint32_t* outTransformHint = nullptr) { + auto layer = createSurface(client, name, width, height, PIXEL_FORMAT_RGBA_8888, flags, + parent, outTransformHint); Transaction t; t.setLayerStack(layer, mDisplayLayerStack).setLayer(layer, mLayerZBase); @@ -72,15 +73,18 @@ protected: virtual sp createSurface(const sp& client, const char* name, uint32_t width, uint32_t height, PixelFormat format, uint32_t flags, - SurfaceControl* parent = nullptr) { - auto layer = client->createSurface(String8(name), width, height, format, flags, parent); + SurfaceControl* parent = nullptr, + uint32_t* outTransformHint = nullptr) { + auto layer = client->createSurface(String8(name), width, height, format, flags, parent, + LayerMetadata(), outTransformHint); EXPECT_NE(nullptr, layer.get()) << "failed to create SurfaceControl"; return layer; } virtual sp createLayer(const char* name, uint32_t width, uint32_t height, - uint32_t flags = 0, SurfaceControl* parent = nullptr) { - return createLayer(mClient, name, width, height, flags, parent); + uint32_t flags = 0, SurfaceControl* parent = nullptr, + uint32_t* outTransformHint = nullptr) { + return createLayer(mClient, name, width, height, flags, parent, outTransformHint); } sp createColorLayer(const char* name, const Color& color, diff --git a/services/surfaceflinger/tests/TransactionTestHarnesses.h b/services/surfaceflinger/tests/TransactionTestHarnesses.h index 8fdcde40b6..5612bb21c7 100644 --- a/services/surfaceflinger/tests/TransactionTestHarnesses.h +++ b/services/surfaceflinger/tests/TransactionTestHarnesses.h @@ -114,12 +114,14 @@ public: LayerTypeTransactionHarness(uint32_t layerType) : mLayerType(layerType) {} sp createLayer(const char* name, uint32_t width, uint32_t height, - uint32_t flags = 0, SurfaceControl* parent = nullptr) { + uint32_t flags = 0, SurfaceControl* parent = nullptr, + uint32_t* outTransformHint = nullptr) { // if the flags already have a layer type specified, return an error if (flags & ISurfaceComposerClient::eFXSurfaceMask) { return nullptr; } - return LayerTransactionTest::createLayer(name, width, height, flags | mLayerType, parent); + return LayerTransactionTest::createLayer(name, width, height, flags | mLayerType, parent, + outTransformHint); } void fillLayerColor(const sp& layer, const Color& color, int32_t bufferWidth, -- cgit v1.2.3-59-g8ed1b From b0dbdaaf3b1a42ab072af9d111d56900b1197af4 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Mon, 6 Jan 2020 16:19:42 -0800 Subject: SurfaceFlinger: Enable -WConversion in Android.bp Enable global -WConversion in Android.bp and turn it off in individual files. This is the first step to enable -WConversion in SurfaceFlinger. Test: boot Bug: 129481165 Change-Id: Ia752df39ef380bde71705a32582d618242c466f7 --- libs/renderengine/tests/RenderEngineTest.cpp | 7 +++++++ services/surfaceflinger/Android.bp | 1 + services/surfaceflinger/BufferLayer.cpp | 7 +++++++ services/surfaceflinger/BufferLayerConsumer.cpp | 7 +++++++ services/surfaceflinger/BufferQueueLayer.cpp | 7 +++++++ services/surfaceflinger/BufferStateLayer.cpp | 7 +++++++ services/surfaceflinger/Client.cpp | 7 +++++++ services/surfaceflinger/ColorLayer.cpp | 7 +++++++ .../CompositionEngine/mock/Display.cpp | 7 +++++++ .../CompositionEngine/mock/Layer.cpp | 7 +++++++ .../CompositionEngine/mock/LayerFE.cpp | 7 +++++++ .../CompositionEngine/mock/Output.cpp | 7 +++++++ .../CompositionEngine/mock/OutputLayer.cpp | 7 +++++++ .../CompositionEngine/src/CompositionEngine.cpp | 7 +++++++ .../CompositionEngine/src/Display.cpp | 7 +++++++ .../CompositionEngine/src/HwcBufferCache.cpp | 7 +++++++ .../surfaceflinger/CompositionEngine/src/Layer.cpp | 7 +++++++ .../src/LayerFECompositionState.cpp | 7 +++++++ .../CompositionEngine/src/Output.cpp | 7 +++++++ .../CompositionEngine/src/OutputLayer.cpp | 7 +++++++ .../src/OutputLayerCompositionState.cpp | 7 +++++++ .../CompositionEngine/src/RenderSurface.cpp | 7 +++++++ .../tests/CompositionEngineTest.cpp | 7 +++++++ .../CompositionEngine/tests/DisplayTest.cpp | 7 +++++++ .../CompositionEngine/tests/LayerTest.cpp | 7 +++++++ .../CompositionEngine/tests/OutputLayerTest.cpp | 7 +++++++ .../CompositionEngine/tests/OutputTest.cpp | 7 +++++++ .../CompositionEngine/tests/RenderSurfaceTest.cpp | 7 +++++++ services/surfaceflinger/ContainerLayer.cpp | 7 +++++++ services/surfaceflinger/DisplayDevice.cpp | 7 +++++++ .../surfaceflinger/DisplayHardware/ComposerHal.cpp | 7 +++++++ .../DisplayHardware/DisplayIdentification.cpp | 7 +++++++ .../DisplayHardware/FramebufferSurface.cpp | 7 +++++++ services/surfaceflinger/DisplayHardware/HWC2.cpp | 7 +++++++ .../surfaceflinger/DisplayHardware/HWComposer.cpp | 7 +++++++ .../DisplayHardware/VirtualDisplaySurface.cpp | 7 +++++++ services/surfaceflinger/Effects/Daltonizer.cpp | 7 +++++++ services/surfaceflinger/EventLog/EventLog.cpp | 7 +++++++ .../surfaceflinger/FrameTracer/FrameTracer.cpp | 7 +++++++ services/surfaceflinger/FrameTracker.cpp | 7 +++++++ services/surfaceflinger/Layer.cpp | 7 +++++++ services/surfaceflinger/LayerProtoHelper.cpp | 7 +++++++ services/surfaceflinger/LayerRejecter.cpp | 7 +++++++ services/surfaceflinger/LayerVector.cpp | 7 +++++++ services/surfaceflinger/MonitoredProducer.cpp | 7 +++++++ services/surfaceflinger/RefreshRateOverlay.cpp | 7 +++++++ services/surfaceflinger/RegionSamplingThread.cpp | 7 +++++++ services/surfaceflinger/RenderArea.cpp | 23 ++++++++++++++++++++++ services/surfaceflinger/Scheduler/DispSync.cpp | 7 +++++++ .../surfaceflinger/Scheduler/DispSyncSource.cpp | 7 +++++++ .../Scheduler/EventControlThread.cpp | 7 +++++++ services/surfaceflinger/Scheduler/EventThread.cpp | 7 +++++++ services/surfaceflinger/Scheduler/LayerHistory.cpp | 7 +++++++ services/surfaceflinger/Scheduler/MessageQueue.cpp | 7 +++++++ services/surfaceflinger/Scheduler/PhaseOffsets.cpp | 7 +++++++ .../Scheduler/RefreshRateConfigs.cpp | 6 ++++++ services/surfaceflinger/Scheduler/Scheduler.cpp | 7 +++++++ .../surfaceflinger/Scheduler/SchedulerUtils.cpp | 7 +++++++ .../surfaceflinger/Scheduler/VSyncModulator.cpp | 7 +++++++ .../surfaceflinger/Scheduler/VSyncPredictor.cpp | 7 +++++++ services/surfaceflinger/SurfaceFlinger.cpp | 7 +++++++ .../SurfaceFlingerDefaultFactory.cpp | 7 +++++++ services/surfaceflinger/SurfaceFlingerFactory.cpp | 7 +++++++ services/surfaceflinger/SurfaceInterceptor.cpp | 7 +++++++ services/surfaceflinger/SurfaceTracing.cpp | 7 +++++++ services/surfaceflinger/TimeStats/TimeStats.cpp | 7 +++++++ .../surfaceflinger/TransactionCompletedThread.cpp | 7 +++++++ services/surfaceflinger/main_surfaceflinger.cpp | 7 +++++++ services/surfaceflinger/tests/BufferGenerator.cpp | 7 +++++++ services/surfaceflinger/tests/Credentials_test.cpp | 7 +++++++ .../tests/DereferenceSurfaceControl_test.cpp | 7 +++++++ .../surfaceflinger/tests/DisplayConfigs_test.cpp | 7 +++++++ .../surfaceflinger/tests/LayerCallback_test.cpp | 7 +++++++ .../tests/LayerRenderTypeTransaction_test.cpp | 7 +++++++ .../surfaceflinger/tests/LayerTransaction_test.cpp | 7 +++++++ .../LayerTypeAndRenderTypeTransaction_test.cpp | 7 +++++++ .../tests/LayerTypeTransaction_test.cpp | 7 +++++++ services/surfaceflinger/tests/LayerUpdate_test.cpp | 7 +++++++ services/surfaceflinger/tests/MirrorLayer_test.cpp | 7 +++++++ .../tests/MultiDisplayLayerBounds_test.cpp | 7 +++++++ services/surfaceflinger/tests/RelativeZ_test.cpp | 7 +++++++ services/surfaceflinger/tests/SetGeometry_test.cpp | 7 +++++++ services/surfaceflinger/tests/Stress_test.cpp | 7 +++++++ .../tests/SurfaceInterceptor_test.cpp | 7 +++++++ .../tests/fakehwc/FakeComposerClient.cpp | 7 +++++++ .../tests/fakehwc/FakeComposerService.cpp | 7 +++++++ .../tests/fakehwc/FakeComposerUtils.cpp | 7 +++++++ .../tests/fakehwc/SFFakeHwc_test.cpp | 7 +++++++ services/surfaceflinger/tests/hwc2/Hwc2Test.cpp | 7 +++++++ .../surfaceflinger/tests/hwc2/Hwc2TestBuffer.cpp | 7 +++++++ .../surfaceflinger/tests/hwc2/Hwc2TestLayers.cpp | 7 +++++++ .../tests/hwc2/Hwc2TestPixelComparator.cpp | 7 +++++++ .../tests/hwc2/Hwc2TestProperties.cpp | 7 +++++++ .../surfaceflinger/tests/unittests/CachingTest.cpp | 7 +++++++ .../tests/unittests/CompositionTest.cpp | 7 +++++++ .../tests/unittests/DisplayTransactionTest.cpp | 7 +++++++ .../tests/unittests/FrameTracerTest.cpp | 7 +++++++ .../tests/unittests/LayerHistoryTest.cpp | 23 ++++++++++++++++++++++ .../tests/unittests/PhaseOffsetsTest.cpp | 7 +++++++ .../tests/unittests/RefreshRateConfigsTest.cpp | 8 ++++---- .../tests/unittests/RefreshRateStatsTest.cpp | 7 +++++++ .../tests/unittests/RegionSamplingTest.cpp | 7 +++++++ .../tests/unittests/SchedulerTest.cpp | 23 ++++++++++++++++++++++ .../tests/unittests/SchedulerUtilsTest.cpp | 8 +++++++- .../tests/unittests/TimeStatsTest.cpp | 7 +++++++ .../tests/unittests/TransactionApplicationTest.cpp | 7 +++++++ .../unittests/VSyncDispatchTimerQueueTest.cpp | 7 +++++++ .../tests/unittests/VSyncPredictorTest.cpp | 7 +++++++ .../mock/DisplayHardware/MockComposer.cpp | 7 +++++++ .../unittests/mock/MockSurfaceInterceptor.cpp | 7 +++++++ services/surfaceflinger/tests/vsync/vsync.cpp | 7 +++++++ 111 files changed, 815 insertions(+), 5 deletions(-) (limited to 'services/surfaceflinger/Client.cpp') diff --git a/libs/renderengine/tests/RenderEngineTest.cpp b/libs/renderengine/tests/RenderEngineTest.cpp index ba5a3f5550..7700b2e01f 100644 --- a/libs/renderengine/tests/RenderEngineTest.cpp +++ b/libs/renderengine/tests/RenderEngineTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -1339,3 +1343,6 @@ TEST_F(RenderEngineTest, drawLayers_fillShadow_translucentCasterWithAlpha) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Android.bp b/services/surfaceflinger/Android.bp index 4c5e5da36a..8fa35d83e7 100644 --- a/services/surfaceflinger/Android.bp +++ b/services/surfaceflinger/Android.bp @@ -7,6 +7,7 @@ cc_defaults { "-Wthread-safety", "-Wunused", "-Wunreachable-code", + "-Wconversion", ], } diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp index 3b1b796076..7845cab397 100644 --- a/services/surfaceflinger/BufferLayer.cpp +++ b/services/surfaceflinger/BufferLayer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + //#define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "BufferLayer" @@ -795,3 +799,6 @@ void BufferLayer::updateCloneBufferInfo() { #if defined(__gl2_h_) #error "don't include gl2/gl2.h in this file" #endif + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/BufferLayerConsumer.cpp b/services/surfaceflinger/BufferLayerConsumer.cpp index ea55795119..5e04d9597a 100644 --- a/services/surfaceflinger/BufferLayerConsumer.cpp +++ b/services/surfaceflinger/BufferLayerConsumer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "BufferLayerConsumer" #define ATRACE_TAG ATRACE_TAG_GRAPHICS @@ -519,3 +523,6 @@ BufferLayerConsumer::Image::~Image() { } } }; // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/BufferQueueLayer.cpp b/services/surfaceflinger/BufferQueueLayer.cpp index e4e4bc7db6..c1b87751a4 100644 --- a/services/surfaceflinger/BufferQueueLayer.cpp +++ b/services/surfaceflinger/BufferQueueLayer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "BufferQueueLayer" #define ATRACE_TAG ATRACE_TAG_GRAPHICS @@ -612,3 +616,6 @@ void BufferQueueLayer::ContentsChangedListener::abandon() { // ----------------------------------------------------------------------- } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/BufferStateLayer.cpp b/services/surfaceflinger/BufferStateLayer.cpp index 067aa46b71..c173c66b4e 100644 --- a/services/surfaceflinger/BufferStateLayer.cpp +++ b/services/surfaceflinger/BufferStateLayer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + //#define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "BufferStateLayer" @@ -681,3 +685,6 @@ sp BufferStateLayer::createClone() { return layer; } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Client.cpp b/services/surfaceflinger/Client.cpp index f3313645fa..fb72ab8065 100644 --- a/services/surfaceflinger/Client.cpp +++ b/services/surfaceflinger/Client.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -131,3 +135,6 @@ status_t Client::getLayerFrameStats(const sp& handle, FrameStats* outSt // --------------------------------------------------------------------------- }; // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/ColorLayer.cpp b/services/surfaceflinger/ColorLayer.cpp index 8bfa569eeb..6aea88abd6 100644 --- a/services/surfaceflinger/ColorLayer.cpp +++ b/services/surfaceflinger/ColorLayer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + // #define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "ColorLayer" @@ -116,3 +120,6 @@ sp ColorLayer::createClone() { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/mock/Display.cpp b/services/surfaceflinger/CompositionEngine/mock/Display.cpp index 01cf11278b..dc303d736f 100644 --- a/services/surfaceflinger/CompositionEngine/mock/Display.cpp +++ b/services/surfaceflinger/CompositionEngine/mock/Display.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include namespace android::compositionengine::mock { @@ -24,3 +28,6 @@ Display::Display() = default; Display::~Display() = default; } // namespace android::compositionengine::mock + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/mock/Layer.cpp b/services/surfaceflinger/CompositionEngine/mock/Layer.cpp index 08483cb301..a733bacee9 100644 --- a/services/surfaceflinger/CompositionEngine/mock/Layer.cpp +++ b/services/surfaceflinger/CompositionEngine/mock/Layer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include namespace android::compositionengine::mock { @@ -24,3 +28,6 @@ Layer::Layer() = default; Layer::~Layer() = default; } // namespace android::compositionengine::mock + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/mock/LayerFE.cpp b/services/surfaceflinger/CompositionEngine/mock/LayerFE.cpp index 607eaad826..232756f247 100644 --- a/services/surfaceflinger/CompositionEngine/mock/LayerFE.cpp +++ b/services/surfaceflinger/CompositionEngine/mock/LayerFE.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include namespace android::compositionengine::mock { @@ -24,3 +28,6 @@ LayerFE::LayerFE() = default; LayerFE::~LayerFE() = default; } // namespace android::compositionengine::mock + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/mock/Output.cpp b/services/surfaceflinger/CompositionEngine/mock/Output.cpp index 44df4c3da3..2608ef0cc0 100644 --- a/services/surfaceflinger/CompositionEngine/mock/Output.cpp +++ b/services/surfaceflinger/CompositionEngine/mock/Output.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include namespace android::compositionengine::mock { @@ -24,3 +28,6 @@ Output::Output() = default; Output::~Output() = default; } // namespace android::compositionengine::mock + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/mock/OutputLayer.cpp b/services/surfaceflinger/CompositionEngine/mock/OutputLayer.cpp index 4da9377123..c1153e3596 100644 --- a/services/surfaceflinger/CompositionEngine/mock/OutputLayer.cpp +++ b/services/surfaceflinger/CompositionEngine/mock/OutputLayer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include namespace android::compositionengine::mock { @@ -24,3 +28,6 @@ OutputLayer::OutputLayer() = default; OutputLayer::~OutputLayer() = default; } // namespace android::compositionengine::mock + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/src/CompositionEngine.cpp b/services/surfaceflinger/CompositionEngine/src/CompositionEngine.cpp index 5eabecd3ca..030c7039f7 100644 --- a/services/surfaceflinger/CompositionEngine/src/CompositionEngine.cpp +++ b/services/surfaceflinger/CompositionEngine/src/CompositionEngine.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -155,3 +159,6 @@ void CompositionEngine::updateLayerStateFromFE(CompositionRefreshArgs& args) { } // namespace impl } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/src/Display.cpp b/services/surfaceflinger/CompositionEngine/src/Display.cpp index e885629c4b..20f765c4a8 100644 --- a/services/surfaceflinger/CompositionEngine/src/Display.cpp +++ b/services/surfaceflinger/CompositionEngine/src/Display.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -337,3 +341,6 @@ void Display::finishFrame(const compositionengine::CompositionRefreshArgs& refre } } // namespace android::compositionengine::impl + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/src/HwcBufferCache.cpp b/services/surfaceflinger/CompositionEngine/src/HwcBufferCache.cpp index f72862be07..995a0ca71f 100644 --- a/services/surfaceflinger/CompositionEngine/src/HwcBufferCache.cpp +++ b/services/surfaceflinger/CompositionEngine/src/HwcBufferCache.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -48,3 +52,6 @@ void HwcBufferCache::getHwcBuffer(int slot, const sp& buffer, uin } } // namespace android::compositionengine::impl + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/src/Layer.cpp b/services/surfaceflinger/CompositionEngine/src/Layer.cpp index ecacaeee9c..22ecd33a2a 100644 --- a/services/surfaceflinger/CompositionEngine/src/Layer.cpp +++ b/services/surfaceflinger/CompositionEngine/src/Layer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -41,3 +45,6 @@ void Layer::dump(std::string& out) const { } // namespace impl } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/src/LayerFECompositionState.cpp b/services/surfaceflinger/CompositionEngine/src/LayerFECompositionState.cpp index e74052994a..085e83838e 100644 --- a/services/surfaceflinger/CompositionEngine/src/LayerFECompositionState.cpp +++ b/services/surfaceflinger/CompositionEngine/src/LayerFECompositionState.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -86,3 +90,6 @@ void LayerFECompositionState::dump(std::string& out) const { } } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp index 6e2816715f..01413b9478 100644 --- a/services/surfaceflinger/CompositionEngine/src/Output.cpp +++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -1058,3 +1062,6 @@ compositionengine::Output::FrameFences Output::presentAndGetFrameFences() { } // namespace impl } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp index 82d24222f1..ac66d8cbe3 100644 --- a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp +++ b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -645,3 +649,6 @@ void OutputLayer::dump(std::string& out) const { } // namespace impl } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp index cc3c54c8b1..20c8f9a112 100644 --- a/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp +++ b/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -70,3 +74,6 @@ void OutputLayerCompositionState::dump(std::string& out) const { } } // namespace android::compositionengine::impl + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/src/RenderSurface.cpp b/services/surfaceflinger/CompositionEngine/src/RenderSurface.cpp index 949feb4041..10512eb9e9 100644 --- a/services/surfaceflinger/CompositionEngine/src/RenderSurface.cpp +++ b/services/surfaceflinger/CompositionEngine/src/RenderSurface.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include @@ -249,3 +253,6 @@ sp& RenderSurface::mutableGraphicBufferForTest() { } // namespace impl } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/tests/CompositionEngineTest.cpp b/services/surfaceflinger/CompositionEngine/tests/CompositionEngineTest.cpp index 989494d13f..ebcd0a0594 100644 --- a/services/surfaceflinger/CompositionEngine/tests/CompositionEngineTest.cpp +++ b/services/surfaceflinger/CompositionEngine/tests/CompositionEngineTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -298,3 +302,6 @@ TEST_F(CompositionTestPreComposition, } // namespace } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp b/services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp index ae939693fa..0fe5843331 100644 --- a/services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp +++ b/services/surfaceflinger/CompositionEngine/tests/DisplayTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -833,3 +837,6 @@ TEST_F(DisplayFunctionalTest, postFramebufferCriticalCallsAreOrdered) { } // namespace } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/tests/LayerTest.cpp b/services/surfaceflinger/CompositionEngine/tests/LayerTest.cpp index 787f973215..44df2893d7 100644 --- a/services/surfaceflinger/CompositionEngine/tests/LayerTest.cpp +++ b/services/surfaceflinger/CompositionEngine/tests/LayerTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -59,3 +63,6 @@ TEST_F(LayerTest, canInstantiateLayer) {} } // namespace } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp b/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp index 0e579fa7e1..bd830be68c 100644 --- a/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp +++ b/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -1054,3 +1058,6 @@ TEST_F(OutputLayerTest, needsFilteringReturnsTrueIfDisplaySizeDifferentFromSourc } // namespace } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp b/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp index 80528e3cb9..24311c7e5b 100644 --- a/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp +++ b/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -3781,3 +3785,6 @@ TEST_F(GenerateClientCompositionRequestsTest_ThreeLayers, } // namespace } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/CompositionEngine/tests/RenderSurfaceTest.cpp b/services/surfaceflinger/CompositionEngine/tests/RenderSurfaceTest.cpp index fd47e453c8..4fba10bf66 100644 --- a/services/surfaceflinger/CompositionEngine/tests/RenderSurfaceTest.cpp +++ b/services/surfaceflinger/CompositionEngine/tests/RenderSurfaceTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -350,3 +354,6 @@ TEST_F(RenderSurfaceTest, flipForwardsSignal) { } // namespace } // namespace android::compositionengine + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/ContainerLayer.cpp b/services/surfaceflinger/ContainerLayer.cpp index ab664be5e2..841e79f8af 100644 --- a/services/surfaceflinger/ContainerLayer.cpp +++ b/services/surfaceflinger/ContainerLayer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + // #define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "ContainerLayer" @@ -39,3 +43,6 @@ sp ContainerLayer::createClone() { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index e0dc3e7751..e2122d1d30 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + // #define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "DisplayDevice" @@ -327,3 +331,6 @@ const HdrCapabilities& DisplayDevice::getHdrCapabilities() const { std::atomic DisplayDeviceState::sNextSequenceId(1); } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/DisplayHardware/ComposerHal.cpp b/services/surfaceflinger/DisplayHardware/ComposerHal.cpp index eb032f3fe8..6892dd8ed0 100644 --- a/services/surfaceflinger/DisplayHardware/ComposerHal.cpp +++ b/services/surfaceflinger/DisplayHardware/ComposerHal.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "HwcComposer" @@ -1622,3 +1626,6 @@ void CommandReader::takePresentOrValidateStage(Display display, uint32_t* state) } // namespace Hwc2 } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/DisplayHardware/DisplayIdentification.cpp b/services/surfaceflinger/DisplayHardware/DisplayIdentification.cpp index ba7818dd02..277081f230 100644 --- a/services/surfaceflinger/DisplayHardware/DisplayIdentification.cpp +++ b/services/surfaceflinger/DisplayHardware/DisplayIdentification.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "DisplayIdentification" @@ -204,3 +208,6 @@ DisplayId getVirtualDisplayId(uint32_t id) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp index 7370b0ccb2..36544b6653 100644 --- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp +++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp @@ -15,6 +15,10 @@ ** limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + // #define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "FramebufferSurface" @@ -193,3 +197,6 @@ const sp& FramebufferSurface::getClientTargetAcquireFence() const { // ---------------------------------------------------------------------------- }; // namespace android // ---------------------------------------------------------------------------- + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/DisplayHardware/HWC2.cpp b/services/surfaceflinger/DisplayHardware/HWC2.cpp index 12b0ddd26d..41e787980a 100644 --- a/services/surfaceflinger/DisplayHardware/HWC2.cpp +++ b/services/surfaceflinger/DisplayHardware/HWC2.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + // #define LOG_NDEBUG 0 #undef LOG_TAG @@ -977,3 +981,6 @@ Error Layer::setColorTransform(const android::mat4& matrix) { } // namespace impl } // namespace HWC2 + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 1960f431a8..153cfe7f9d 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + // #define LOG_NDEBUG 0 #undef LOG_TAG @@ -948,3 +952,6 @@ uint32_t HWComposer::getMaxVirtualDisplayCount() const { } // namespace impl } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp index 56b0ea61e3..fba3261388 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + // #define LOG_NDEBUG 0 #include "VirtualDisplaySurface.h" @@ -694,3 +698,6 @@ const char* VirtualDisplaySurface::dbgSourceStr(Source s) { // --------------------------------------------------------------------------- } // namespace android // --------------------------------------------------------------------------- + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Effects/Daltonizer.cpp b/services/surfaceflinger/Effects/Daltonizer.cpp index 01c9c0fc68..a7090c51f2 100644 --- a/services/surfaceflinger/Effects/Daltonizer.cpp +++ b/services/surfaceflinger/Effects/Daltonizer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "Daltonizer.h" #include @@ -171,3 +175,6 @@ void Daltonizer::update() { } } /* namespace android */ + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/EventLog/EventLog.cpp b/services/surfaceflinger/EventLog/EventLog.cpp index a532fc130f..3b609524e8 100644 --- a/services/surfaceflinger/EventLog/EventLog.cpp +++ b/services/surfaceflinger/EventLog/EventLog.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -124,3 +128,6 @@ void EventLog::TagBuffer::writeString(const std::string_view& value) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/FrameTracer/FrameTracer.cpp b/services/surfaceflinger/FrameTracer/FrameTracer.cpp index 441811646b..b986f3844a 100644 --- a/services/surfaceflinger/FrameTracer/FrameTracer.cpp +++ b/services/surfaceflinger/FrameTracer/FrameTracer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "FrameTracer" #define ATRACE_TAG ATRACE_TAG_GRAPHICS @@ -179,3 +183,6 @@ std::string FrameTracer::miniDump() { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/FrameTracker.cpp b/services/surfaceflinger/FrameTracker.cpp index a6e511e76e..8ad805b1d8 100644 --- a/services/surfaceflinger/FrameTracker.cpp +++ b/services/surfaceflinger/FrameTracker.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + // This is needed for stdint.h to define INT64_MAX in C++ #define __STDC_LIMIT_MACROS @@ -246,3 +250,6 @@ void FrameTracker::dumpStats(std::string& result) const { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 2593681b6b..b0c94a279e 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + //#define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "Layer" @@ -2304,3 +2308,6 @@ void Layer::addChildToDrawing(const sp& layer) { #if defined(__gl2_h_) #error "don't include gl2/gl2.h in this file" #endif + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/LayerProtoHelper.cpp b/services/surfaceflinger/LayerProtoHelper.cpp index b4022704d5..0fe1421926 100644 --- a/services/surfaceflinger/LayerProtoHelper.cpp +++ b/services/surfaceflinger/LayerProtoHelper.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "LayerProtoHelper.h" namespace android { @@ -165,3 +169,6 @@ void LayerProtoHelper::writeToProto(const mat4 matrix, ColorTransformProto* colo } // namespace surfaceflinger } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/LayerRejecter.cpp b/services/surfaceflinger/LayerRejecter.cpp index 412f9779c8..d3364a0929 100644 --- a/services/surfaceflinger/LayerRejecter.cpp +++ b/services/surfaceflinger/LayerRejecter.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "LayerRejecter.h" #include @@ -136,3 +140,6 @@ bool LayerRejecter::reject(const sp& buf, const BufferItem& item) } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/LayerVector.cpp b/services/surfaceflinger/LayerVector.cpp index 8271fd97ea..7c959b9e56 100644 --- a/services/surfaceflinger/LayerVector.cpp +++ b/services/surfaceflinger/LayerVector.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "LayerVector.h" #include "Layer.h" @@ -83,3 +87,6 @@ void LayerVector::traverseInReverseZOrder(StateSet stateSet, const Visitor& visi } } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/MonitoredProducer.cpp b/services/surfaceflinger/MonitoredProducer.cpp index 7a959f7b19..5009e10532 100644 --- a/services/surfaceflinger/MonitoredProducer.cpp +++ b/services/surfaceflinger/MonitoredProducer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "MonitoredProducer.h" #include "Layer.h" #include "SurfaceFlinger.h" @@ -168,3 +172,6 @@ sp MonitoredProducer::getLayer() const { // --------------------------------------------------------------------------- }; // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/RefreshRateOverlay.cpp b/services/surfaceflinger/RefreshRateOverlay.cpp index c69859e32a..33e5796e6f 100644 --- a/services/surfaceflinger/RefreshRateOverlay.cpp +++ b/services/surfaceflinger/RefreshRateOverlay.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "RefreshRateOverlay.h" #include "Client.h" #include "Layer.h" @@ -211,3 +215,6 @@ void RefreshRateOverlay::changeRefreshRate(const RefreshRate& refreshRate) { } }; // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp index 73de4f8b78..0031d70160 100644 --- a/services/surfaceflinger/RegionSamplingThread.cpp +++ b/services/surfaceflinger/RegionSamplingThread.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + //#define LOG_NDEBUG 0 #define ATRACE_TAG ATRACE_TAG_GRAPHICS #undef LOG_TAG @@ -472,3 +476,6 @@ void RegionSamplingThread::threadMain() NO_THREAD_SAFETY_ANALYSIS { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/RenderArea.cpp b/services/surfaceflinger/RenderArea.cpp index 93759e8ad7..9a6c8533ea 100644 --- a/services/surfaceflinger/RenderArea.cpp +++ b/services/surfaceflinger/RenderArea.cpp @@ -1,3 +1,23 @@ +/* + * Copyright 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "RenderArea.h" namespace android { @@ -13,3 +33,6 @@ float RenderArea::getCaptureFillValue(CaptureFill captureFill) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/DispSync.cpp b/services/surfaceflinger/Scheduler/DispSync.cpp index 4bdfad94eb..ca41608c1c 100644 --- a/services/surfaceflinger/Scheduler/DispSync.cpp +++ b/services/surfaceflinger/Scheduler/DispSync.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #define ATRACE_TAG ATRACE_TAG_GRAPHICS //#define LOG_NDEBUG 0 @@ -847,3 +851,6 @@ nsecs_t DispSync::expectedPresentTime() { } // namespace impl } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/DispSyncSource.cpp b/services/surfaceflinger/Scheduler/DispSyncSource.cpp index bd4b0ec0d1..776e98463f 100644 --- a/services/surfaceflinger/Scheduler/DispSyncSource.cpp +++ b/services/surfaceflinger/Scheduler/DispSyncSource.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include "DispSyncSource.h" @@ -104,3 +108,6 @@ void DispSyncSource::onDispSyncEvent(nsecs_t when) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/EventControlThread.cpp b/services/surfaceflinger/Scheduler/EventControlThread.cpp index 85a7f82a3c..7f9db9ca2d 100644 --- a/services/surfaceflinger/Scheduler/EventControlThread.cpp +++ b/services/surfaceflinger/Scheduler/EventControlThread.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -73,3 +77,6 @@ void EventControlThread::threadMain() NO_THREAD_SAFETY_ANALYSIS { } // namespace impl } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/EventThread.cpp b/services/surfaceflinger/Scheduler/EventThread.cpp index 5bdef5807f..14e3ec6ead 100644 --- a/services/surfaceflinger/Scheduler/EventThread.cpp +++ b/services/surfaceflinger/Scheduler/EventThread.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include @@ -517,3 +521,6 @@ const char* EventThread::toCString(State state) { } // namespace impl } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/LayerHistory.cpp b/services/surfaceflinger/Scheduler/LayerHistory.cpp index cf79d9fcf7..db16f8df1f 100644 --- a/services/surfaceflinger/Scheduler/LayerHistory.cpp +++ b/services/surfaceflinger/Scheduler/LayerHistory.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "LayerHistory" #define ATRACE_TAG ATRACE_TAG_GRAPHICS @@ -158,3 +162,6 @@ void LayerHistory::clear() { } } // namespace android::scheduler::impl + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/MessageQueue.cpp b/services/surfaceflinger/Scheduler/MessageQueue.cpp index 5318b00983..005d157fd5 100644 --- a/services/surfaceflinger/Scheduler/MessageQueue.cpp +++ b/services/surfaceflinger/Scheduler/MessageQueue.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -159,3 +163,6 @@ int MessageQueue::eventReceiver(int /*fd*/, int /*events*/) { } // namespace impl } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/PhaseOffsets.cpp b/services/surfaceflinger/Scheduler/PhaseOffsets.cpp index 13014c789b..106aa9bccb 100644 --- a/services/surfaceflinger/Scheduler/PhaseOffsets.cpp +++ b/services/surfaceflinger/Scheduler/PhaseOffsets.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "PhaseOffsets.h" #include @@ -330,3 +334,6 @@ void PhaseDurations::dump(std::string& result) const { } // namespace impl } // namespace android::scheduler + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp b/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp index 692ded928d..45d1f23029 100644 --- a/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp +++ b/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + // #define LOG_NDEBUG 0 #include "RefreshRateConfigs.h" @@ -217,3 +221,5 @@ void RefreshRateConfigs::init(const std::vector& configs, } } // namespace android::scheduler +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/Scheduler.cpp b/services/surfaceflinger/Scheduler/Scheduler.cpp index 73dc753c7e..c96eba40fd 100644 --- a/services/surfaceflinger/Scheduler/Scheduler.cpp +++ b/services/surfaceflinger/Scheduler/Scheduler.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "Scheduler" #define ATRACE_TAG ATRACE_TAG_GRAPHICS @@ -595,3 +599,6 @@ void Scheduler::onDisplayRefreshed(nsecs_t timestamp) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/SchedulerUtils.cpp b/services/surfaceflinger/Scheduler/SchedulerUtils.cpp index fb5414fd4b..27120be272 100644 --- a/services/surfaceflinger/Scheduler/SchedulerUtils.cpp +++ b/services/surfaceflinger/Scheduler/SchedulerUtils.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "SchedulerUtils.h" #include @@ -36,3 +40,6 @@ int64_t calculate_median(std::vector* v) { } // namespace scheduler } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/VSyncModulator.cpp b/services/surfaceflinger/Scheduler/VSyncModulator.cpp index 8de35b1c2f..40a992cf01 100644 --- a/services/surfaceflinger/Scheduler/VSyncModulator.cpp +++ b/services/surfaceflinger/Scheduler/VSyncModulator.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include "VSyncModulator.h" @@ -144,3 +148,6 @@ void VSyncModulator::updateOffsetsLocked() { } } // namespace android::scheduler + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/Scheduler/VSyncPredictor.cpp b/services/surfaceflinger/Scheduler/VSyncPredictor.cpp index 3b99a58838..915419154f 100644 --- a/services/surfaceflinger/Scheduler/VSyncPredictor.cpp +++ b/services/surfaceflinger/Scheduler/VSyncPredictor.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #define ATRACE_TAG ATRACE_TAG_GRAPHICS //#define LOG_NDEBUG 0 #include "VSyncPredictor.h" @@ -224,3 +228,6 @@ bool VSyncPredictor::needsMoreSamples(nsecs_t now) const { } } // namespace android::scheduler + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index b7a2c760e6..3dcf7d1665 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + //#define LOG_NDEBUG 0 #define ATRACE_TAG ATRACE_TAG_GRAPHICS @@ -5772,3 +5776,6 @@ status_t SurfaceFlinger::setGlobalShadowSettings(const half4& ambientColor, cons #if defined(__gl2_h_) #error "don't include gl2/gl2.h in this file" #endif + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/SurfaceFlingerDefaultFactory.cpp b/services/surfaceflinger/SurfaceFlingerDefaultFactory.cpp index d5c2306e1f..e12d31a99a 100644 --- a/services/surfaceflinger/SurfaceFlingerDefaultFactory.cpp +++ b/services/surfaceflinger/SurfaceFlingerDefaultFactory.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -138,3 +142,6 @@ sp DefaultFactory::createColorLayer(const LayerCreationArgs& args) { } } // namespace android::surfaceflinger + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/SurfaceFlingerFactory.cpp b/services/surfaceflinger/SurfaceFlingerFactory.cpp index 9b1f658661..3997b04f5f 100644 --- a/services/surfaceflinger/SurfaceFlingerFactory.cpp +++ b/services/surfaceflinger/SurfaceFlingerFactory.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "SurfaceFlinger.h" #include "SurfaceFlingerDefaultFactory.h" @@ -26,3 +30,6 @@ sp createSurfaceFlinger() { } } // namespace android::surfaceflinger + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/SurfaceInterceptor.cpp b/services/surfaceflinger/SurfaceInterceptor.cpp index 8e0462ab52..79123f979b 100644 --- a/services/surfaceflinger/SurfaceInterceptor.cpp +++ b/services/surfaceflinger/SurfaceInterceptor.cpp @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" #undef LOG_TAG #define LOG_TAG "SurfaceInterceptor" #define ATRACE_TAG ATRACE_TAG_GRAPHICS @@ -677,3 +681,6 @@ void SurfaceInterceptor::savePowerModeUpdate(int32_t sequenceId, int32_t mode) { } // namespace impl } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/SurfaceTracing.cpp b/services/surfaceflinger/SurfaceTracing.cpp index eb26cd0379..6fd4e46c73 100644 --- a/services/surfaceflinger/SurfaceTracing.cpp +++ b/services/surfaceflinger/SurfaceTracing.cpp @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" #undef LOG_TAG #define LOG_TAG "SurfaceTracing" #define ATRACE_TAG ATRACE_TAG_GRAPHICS @@ -202,3 +206,6 @@ void SurfaceTracing::dump(std::string& result) const { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/TimeStats/TimeStats.cpp b/services/surfaceflinger/TimeStats/TimeStats.cpp index a5fabf2c16..0939fa4f9b 100644 --- a/services/surfaceflinger/TimeStats/TimeStats.cpp +++ b/services/surfaceflinger/TimeStats/TimeStats.cpp @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" #undef LOG_TAG #define LOG_TAG "TimeStats" #define ATRACE_TAG ATRACE_TAG_GRAPHICS @@ -657,3 +661,6 @@ void TimeStats::dump(bool asProto, std::optional maxLayers, std::strin } // namespace impl } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/TransactionCompletedThread.cpp b/services/surfaceflinger/TransactionCompletedThread.cpp index 1475889cd9..daa67ae043 100644 --- a/services/surfaceflinger/TransactionCompletedThread.cpp +++ b/services/surfaceflinger/TransactionCompletedThread.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + //#define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "TransactionCompletedThread" @@ -355,3 +359,6 @@ CallbackHandle::CallbackHandle(const sp& transactionListener, : listener(transactionListener), callbackIds(ids), surfaceControl(sc) {} } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/main_surfaceflinger.cpp b/services/surfaceflinger/main_surfaceflinger.cpp index e7986d3344..d7ad9deb03 100644 --- a/services/surfaceflinger/main_surfaceflinger.cpp +++ b/services/surfaceflinger/main_surfaceflinger.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -121,3 +125,6 @@ int main(int, char**) { return 0; } + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/BufferGenerator.cpp b/services/surfaceflinger/tests/BufferGenerator.cpp index 8ddda60cd2..293738cfcb 100644 --- a/services/surfaceflinger/tests/BufferGenerator.cpp +++ b/services/surfaceflinger/tests/BufferGenerator.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -379,3 +383,6 @@ void BufferGenerator::setBuffer(const sp& buffer, int32_t fence, } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/Credentials_test.cpp b/services/surfaceflinger/tests/Credentials_test.cpp index f6188738b2..a7c095d327 100644 --- a/services/surfaceflinger/tests/Credentials_test.cpp +++ b/services/surfaceflinger/tests/Credentials_test.cpp @@ -31,6 +31,10 @@ const float FRAME_SCALE = 1.0f; * Methods like EnableVsyncInjections and InjectVsync are not tested since they do not * return anything meaningful. */ + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" class CredentialsTest : public ::testing::Test { protected: void SetUp() override { @@ -362,3 +366,6 @@ TEST_F(CredentialsTest, GetActiveColorModeBasicCorrectness) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/DereferenceSurfaceControl_test.cpp b/services/surfaceflinger/tests/DereferenceSurfaceControl_test.cpp index 0cef0d1c87..46b98f9193 100644 --- a/services/surfaceflinger/tests/DereferenceSurfaceControl_test.cpp +++ b/services/surfaceflinger/tests/DereferenceSurfaceControl_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "LayerTransactionTest.h" namespace android { @@ -67,3 +71,6 @@ TEST_F(DereferenceSurfaceControlTest, LayerInTransaction) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/DisplayConfigs_test.cpp b/services/surfaceflinger/tests/DisplayConfigs_test.cpp index d51b9a146f..3aa4474b6b 100644 --- a/services/surfaceflinger/tests/DisplayConfigs_test.cpp +++ b/services/surfaceflinger/tests/DisplayConfigs_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include "LayerTransactionTest.h" namespace android { @@ -68,3 +72,6 @@ TEST_F(RefreshRateRangeTest, setAllConfigs) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" \ No newline at end of file diff --git a/services/surfaceflinger/tests/LayerCallback_test.cpp b/services/surfaceflinger/tests/LayerCallback_test.cpp index 7a5ed484d1..6d28e621ac 100644 --- a/services/surfaceflinger/tests/LayerCallback_test.cpp +++ b/services/surfaceflinger/tests/LayerCallback_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "LayerTransactionTest.h" #include "utils/CallbackUtils.h" @@ -870,3 +874,6 @@ TEST_F(LayerCallbackTest, DesiredPresentTime_Past) { EXPECT_NO_FATAL_FAILURE(waitForCallback(callback, expected, true)); } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/LayerRenderTypeTransaction_test.cpp b/services/surfaceflinger/tests/LayerRenderTypeTransaction_test.cpp index 92698f0142..24874b010b 100644 --- a/services/surfaceflinger/tests/LayerRenderTypeTransaction_test.cpp +++ b/services/surfaceflinger/tests/LayerRenderTypeTransaction_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -1841,3 +1845,6 @@ TEST_P(LayerRenderTypeTransactionTest, SetColorTransformOnChildAndParent) { } } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/LayerTransaction_test.cpp b/services/surfaceflinger/tests/LayerTransaction_test.cpp index 7816c667bb..97cba63192 100644 --- a/services/surfaceflinger/tests/LayerTransaction_test.cpp +++ b/services/surfaceflinger/tests/LayerTransaction_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include "LayerTransactionTest.h" @@ -190,3 +194,6 @@ TEST_F(LayerTransactionTest, DISABLED_BufferQueueLayerMergeDamageRegionWhenDropp ASSERT_EQ(OK, producer->disconnect(NATIVE_WINDOW_API_CPU)); } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/LayerTypeAndRenderTypeTransaction_test.cpp b/services/surfaceflinger/tests/LayerTypeAndRenderTypeTransaction_test.cpp index daeff17ea3..71f01b0c1d 100644 --- a/services/surfaceflinger/tests/LayerTypeAndRenderTypeTransaction_test.cpp +++ b/services/surfaceflinger/tests/LayerTypeAndRenderTypeTransaction_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include "TransactionTestHarnesses.h" @@ -267,3 +271,6 @@ TEST_P(LayerTypeAndRenderTypeTransactionTest, SetLayerStackBasic) { } } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/LayerTypeTransaction_test.cpp b/services/surfaceflinger/tests/LayerTypeTransaction_test.cpp index 42ec34a129..7e9202bb82 100644 --- a/services/surfaceflinger/tests/LayerTypeTransaction_test.cpp +++ b/services/surfaceflinger/tests/LayerTypeTransaction_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include "TransactionTestHarnesses.h" @@ -186,3 +190,6 @@ TEST_P(LayerTypeTransactionTest, RefreshRateIsInitialized) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/LayerUpdate_test.cpp b/services/surfaceflinger/tests/LayerUpdate_test.cpp index 0ad122b5ed..0459386936 100644 --- a/services/surfaceflinger/tests/LayerUpdate_test.cpp +++ b/services/surfaceflinger/tests/LayerUpdate_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "LayerTransactionTest.h" namespace android { @@ -1708,3 +1712,6 @@ TEST_F(ScreenCaptureTest, CaptureInvalidLayer) { ASSERT_EQ(NAME_NOT_FOUND, sf->captureLayers(redLayerHandle, &outBuffer, Rect::EMPTY_RECT, 1.0)); } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/MirrorLayer_test.cpp b/services/surfaceflinger/tests/MirrorLayer_test.cpp index 0bcac1a880..b49bd54599 100644 --- a/services/surfaceflinger/tests/MirrorLayer_test.cpp +++ b/services/surfaceflinger/tests/MirrorLayer_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "LayerTransactionTest.h" namespace android { @@ -224,3 +228,6 @@ TEST_F(MirrorLayerTest, MirrorBufferLayer) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/MultiDisplayLayerBounds_test.cpp b/services/surfaceflinger/tests/MultiDisplayLayerBounds_test.cpp index 066c9aa3ce..e525e2af9b 100644 --- a/services/surfaceflinger/tests/MultiDisplayLayerBounds_test.cpp +++ b/services/surfaceflinger/tests/MultiDisplayLayerBounds_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "LayerTransactionTest.h" namespace android { @@ -122,3 +126,6 @@ TEST_F(MultiDisplayLayerBoundsTest, RenderLayerInMirroredVirtualDisplay) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/RelativeZ_test.cpp b/services/surfaceflinger/tests/RelativeZ_test.cpp index 8c56d27e8a..1180cacf7f 100644 --- a/services/surfaceflinger/tests/RelativeZ_test.cpp +++ b/services/surfaceflinger/tests/RelativeZ_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "LayerTransactionTest.h" namespace android { @@ -204,3 +208,6 @@ TEST_F(RelativeZTest, LayerAndRelativeRemoved) { } } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/SetGeometry_test.cpp b/services/surfaceflinger/tests/SetGeometry_test.cpp index dca06ec8d4..5fe2513bb3 100644 --- a/services/surfaceflinger/tests/SetGeometry_test.cpp +++ b/services/surfaceflinger/tests/SetGeometry_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "LayerTransactionTest.h" namespace android { @@ -97,3 +101,6 @@ TEST_F(SetGeometryTest, Scale) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/Stress_test.cpp b/services/surfaceflinger/tests/Stress_test.cpp index ee857b01f2..e9b6ba0f64 100644 --- a/services/surfaceflinger/tests/Stress_test.cpp +++ b/services/surfaceflinger/tests/Stress_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -107,3 +111,6 @@ TEST(LayerProtoStress, mem_info) { } } + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/SurfaceInterceptor_test.cpp b/services/surfaceflinger/tests/SurfaceInterceptor_test.cpp index 1fa426d14e..75d0761907 100644 --- a/services/surfaceflinger/tests/SurfaceInterceptor_test.cpp +++ b/services/surfaceflinger/tests/SurfaceInterceptor_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -1011,3 +1015,6 @@ TEST_F(SurfaceInterceptorTest, InterceptSimultaneousUpdatesWorks) { ASSERT_TRUE(singleIncrementFound(capturedTrace, Increment::IncrementCase::kSurfaceCreation)); } } + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp b/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp index 0c370a6fdb..5824e589d1 100644 --- a/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp +++ b/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + //#define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "FakeComposer" @@ -896,3 +900,6 @@ Layer FakeComposerClient::getLayer(size_t index) const { // this might get more involving. return static_cast(index); } + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/fakehwc/FakeComposerService.cpp b/services/surfaceflinger/tests/fakehwc/FakeComposerService.cpp index f727bc4079..c656eed0fb 100644 --- a/services/surfaceflinger/tests/fakehwc/FakeComposerService.cpp +++ b/services/surfaceflinger/tests/fakehwc/FakeComposerService.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "FakeHwcService" @@ -170,3 +174,6 @@ Return FakeComposerService_2_4::createClient_2_4(createClient_2_4_cb hidl_ } } // namespace sftest + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/fakehwc/FakeComposerUtils.cpp b/services/surfaceflinger/tests/fakehwc/FakeComposerUtils.cpp index 4d2146810b..2f89696e8e 100644 --- a/services/surfaceflinger/tests/fakehwc/FakeComposerUtils.cpp +++ b/services/surfaceflinger/tests/fakehwc/FakeComposerUtils.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "FakeHwcUtil" @@ -183,3 +187,6 @@ void FakeHwcEnvironment::TearDown() { } } // namespace sftest + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp b/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp index 09fdbdf114..18572064b6 100644 --- a/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp +++ b/services/surfaceflinger/tests/fakehwc/SFFakeHwc_test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + // #define LOG_NDEBUG 0 #undef LOG_TAG #define LOG_TAG "FakeHwcTest" @@ -1970,3 +1974,6 @@ int main(int argc, char** argv) { ::testing::InitGoogleMock(&argc, argv); return RUN_ALL_TESTS(); } + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/hwc2/Hwc2Test.cpp b/services/surfaceflinger/tests/hwc2/Hwc2Test.cpp index 13774b4ed3..f9a1fe9a73 100644 --- a/services/surfaceflinger/tests/hwc2/Hwc2Test.cpp +++ b/services/surfaceflinger/tests/hwc2/Hwc2Test.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -4770,3 +4774,6 @@ TEST_F(Hwc2Test, PRESENT_VIRTUAL_DISPLAY_default_5) ASSERT_NO_FATAL_FAILURE(createAndPresentVirtualDisplay(layerCnt, coverage, virtualDisplayExceptions)); } + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/hwc2/Hwc2TestBuffer.cpp b/services/surfaceflinger/tests/hwc2/Hwc2TestBuffer.cpp index 648456295d..fcd0d31078 100644 --- a/services/surfaceflinger/tests/hwc2/Hwc2TestBuffer.cpp +++ b/services/surfaceflinger/tests/hwc2/Hwc2TestBuffer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -789,3 +793,6 @@ int Hwc2TestOutputBuffer::getOutputBuffer(buffer_handle_t* outHandle, return 0; } + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/hwc2/Hwc2TestLayers.cpp b/services/surfaceflinger/tests/hwc2/Hwc2TestLayers.cpp index 90127a1302..b76ace8752 100644 --- a/services/surfaceflinger/tests/hwc2/Hwc2TestLayers.cpp +++ b/services/surfaceflinger/tests/hwc2/Hwc2TestLayers.cpp @@ -13,6 +13,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -279,3 +283,6 @@ bool Hwc2TestLayers::setVisibleRegions() return optimized; } + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/hwc2/Hwc2TestPixelComparator.cpp b/services/surfaceflinger/tests/hwc2/Hwc2TestPixelComparator.cpp index 904b927abf..8ca88150e9 100644 --- a/services/surfaceflinger/tests/hwc2/Hwc2TestPixelComparator.cpp +++ b/services/surfaceflinger/tests/hwc2/Hwc2TestPixelComparator.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include @@ -111,3 +115,6 @@ std::string ComparatorResult::dumpComparison() const } return stream.str(); } + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.cpp b/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.cpp index c5b92d0664..1efb21e639 100644 --- a/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.cpp +++ b/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -780,3 +784,6 @@ const std::array Hwc2TestSurfaceDamage::mCompositionSupport = {{ const std::array Hwc2TestTransform::mCompositionSupport = {{ false, true, true, false, true, true, }}; + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/CachingTest.cpp b/services/surfaceflinger/tests/unittests/CachingTest.cpp index 74ce540626..1b8c76d1b9 100644 --- a/services/surfaceflinger/tests/unittests/CachingTest.cpp +++ b/services/surfaceflinger/tests/unittests/CachingTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "CachingTest" @@ -91,3 +95,6 @@ TEST_F(SlotGenerationTest, getHwcCacheSlot_Reuse) { } } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/CompositionTest.cpp b/services/surfaceflinger/tests/unittests/CompositionTest.cpp index cce21ceddb..8a762d4030 100644 --- a/services/surfaceflinger/tests/unittests/CompositionTest.cpp +++ b/services/surfaceflinger/tests/unittests/CompositionTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "CompositionTest" @@ -1423,3 +1427,6 @@ TEST_F(CompositionTest, DebugOptionForcingClientCompositionOfBufferLayerWithDirt } // namespace } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp b/services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp index 55c3ab8b22..33563eaed6 100644 --- a/services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp +++ b/services/surfaceflinger/tests/unittests/DisplayTransactionTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "LibSurfaceFlingerUnittests" @@ -3239,3 +3243,6 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToUnknownExternalDispla } // namespace } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/FrameTracerTest.cpp b/services/surfaceflinger/tests/unittests/FrameTracerTest.cpp index c334bcf85d..68cb52fe87 100644 --- a/services/surfaceflinger/tests/unittests/FrameTracerTest.cpp +++ b/services/surfaceflinger/tests/unittests/FrameTracerTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "LibSurfaceFlingerUnittests" @@ -394,3 +398,6 @@ TEST_F(FrameTracerTest, traceFenceWithValidStartTime_ShouldHaveCorrectDuration) } // namespace } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/LayerHistoryTest.cpp b/services/surfaceflinger/tests/unittests/LayerHistoryTest.cpp index f055fe72ac..c9af057ae5 100644 --- a/services/surfaceflinger/tests/unittests/LayerHistoryTest.cpp +++ b/services/surfaceflinger/tests/unittests/LayerHistoryTest.cpp @@ -1,3 +1,23 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "LayerHistoryTest" @@ -241,3 +261,6 @@ TEST_F(LayerHistoryTest, multipleLayers) { } // namespace } // namespace android::scheduler + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/PhaseOffsetsTest.cpp b/services/surfaceflinger/tests/unittests/PhaseOffsetsTest.cpp index 6360ec14cd..910e73baf2 100644 --- a/services/surfaceflinger/tests/unittests/PhaseOffsetsTest.cpp +++ b/services/surfaceflinger/tests/unittests/PhaseOffsetsTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "SchedulerUnittests" @@ -124,3 +128,6 @@ TEST_F(PhaseOffsetsTest, getOffsetsForRefreshRate_DefaultOffsets) { } // namespace } // namespace scheduler } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" \ No newline at end of file diff --git a/services/surfaceflinger/tests/unittests/RefreshRateConfigsTest.cpp b/services/surfaceflinger/tests/unittests/RefreshRateConfigsTest.cpp index cc3c985aa1..86aa8fb22b 100644 --- a/services/surfaceflinger/tests/unittests/RefreshRateConfigsTest.cpp +++ b/services/surfaceflinger/tests/unittests/RefreshRateConfigsTest.cpp @@ -242,11 +242,11 @@ TEST_F(RefreshRateConfigsTest, twoDeviceConfigs_getRefreshRateForContent) { TEST_F(RefreshRateConfigsTest, testInPolicy) { RefreshRate expectedDefaultConfig = {HWC_CONFIG_ID_60, VSYNC_60_POINT_4, HWC_GROUP_ID_0, "60fps", 60}; - ASSERT_TRUE(expectedDefaultConfig.inPolicy(60.000004, 60.000004)); + ASSERT_TRUE(expectedDefaultConfig.inPolicy(60.000004f, 60.000004f)); ASSERT_TRUE(expectedDefaultConfig.inPolicy(59.0f, 60.1f)); - ASSERT_FALSE(expectedDefaultConfig.inPolicy(75.0, 90.0)); - ASSERT_FALSE(expectedDefaultConfig.inPolicy(60.0011, 90.0)); - ASSERT_FALSE(expectedDefaultConfig.inPolicy(50.0, 59.998)); + ASSERT_FALSE(expectedDefaultConfig.inPolicy(75.0f, 90.0f)); + ASSERT_FALSE(expectedDefaultConfig.inPolicy(60.0011f, 90.0f)); + ASSERT_FALSE(expectedDefaultConfig.inPolicy(50.0f, 59.998f)); } } // namespace diff --git a/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp b/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp index ef4699f628..8e07c79656 100644 --- a/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp +++ b/services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "SchedulerUnittests" @@ -195,3 +199,6 @@ TEST_F(RefreshRateStatsTest, twoConfigsTest) { } // namespace } // namespace scheduler } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/RegionSamplingTest.cpp b/services/surfaceflinger/tests/unittests/RegionSamplingTest.cpp index d8de804ad8..f19e55409c 100644 --- a/services/surfaceflinger/tests/unittests/RegionSamplingTest.cpp +++ b/services/surfaceflinger/tests/unittests/RegionSamplingTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "RegionSamplingTest" @@ -137,3 +141,6 @@ TEST_F(RegionSamplingTest, orientation_90) { } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/SchedulerTest.cpp b/services/surfaceflinger/tests/unittests/SchedulerTest.cpp index 40536abc5d..b1ecf4da6e 100644 --- a/services/surfaceflinger/tests/unittests/SchedulerTest.cpp +++ b/services/surfaceflinger/tests/unittests/SchedulerTest.cpp @@ -1,3 +1,23 @@ +/* + * Copyright 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "SchedulerUnittests" @@ -144,3 +164,6 @@ TEST_F(SchedulerTest, validConnectionHandle) { } // namespace } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/SchedulerUtilsTest.cpp b/services/surfaceflinger/tests/unittests/SchedulerUtilsTest.cpp index 5865579641..5f6a7150d6 100644 --- a/services/surfaceflinger/tests/unittests/SchedulerUtilsTest.cpp +++ b/services/surfaceflinger/tests/unittests/SchedulerUtilsTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "SchedulerUnittests" @@ -128,4 +132,6 @@ TEST_F(SchedulerUtilsTest, calculate_mode) { } // namespace } // namespace scheduler -} // namespace android \ No newline at end of file +} // namespace android +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/TimeStatsTest.cpp b/services/surfaceflinger/tests/unittests/TimeStatsTest.cpp index 3e808c0abb..bcf3ba8856 100644 --- a/services/surfaceflinger/tests/unittests/TimeStatsTest.cpp +++ b/services/surfaceflinger/tests/unittests/TimeStatsTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "LibSurfaceFlingerUnittests" @@ -656,3 +660,6 @@ TEST_F(TimeStatsTest, canSurviveMonkey) { } // namespace } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/TransactionApplicationTest.cpp b/services/surfaceflinger/tests/unittests/TransactionApplicationTest.cpp index 994a509e4f..f1739e5e8a 100644 --- a/services/surfaceflinger/tests/unittests/TransactionApplicationTest.cpp +++ b/services/surfaceflinger/tests/unittests/TransactionApplicationTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "CompositionTest" @@ -321,3 +325,6 @@ TEST_F(TransactionApplicationTest, FromHandle) { EXPECT_EQ(nullptr, ret.get()); } } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/VSyncDispatchTimerQueueTest.cpp b/services/surfaceflinger/tests/unittests/VSyncDispatchTimerQueueTest.cpp index 5aff4296f9..82919abe03 100644 --- a/services/surfaceflinger/tests/unittests/VSyncDispatchTimerQueueTest.cpp +++ b/services/surfaceflinger/tests/unittests/VSyncDispatchTimerQueueTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "LibSurfaceFlingerUnittests" #define LOG_NDEBUG 0 @@ -803,3 +807,6 @@ TEST_F(VSyncDispatchTimerQueueEntryTest, reportsScheduledIfStillTime) { } } // namespace android::scheduler + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/VSyncPredictorTest.cpp b/services/surfaceflinger/tests/unittests/VSyncPredictorTest.cpp index 4cb6a38217..00d3cc6e0b 100644 --- a/services/surfaceflinger/tests/unittests/VSyncPredictorTest.cpp +++ b/services/surfaceflinger/tests/unittests/VSyncPredictorTest.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #undef LOG_TAG #define LOG_TAG "LibSurfaceFlingerUnittests" #define LOG_NDEBUG 0 @@ -352,3 +356,6 @@ TEST_F(VSyncPredictorTest, doesNotPredictBeforeTimePointWithHigherIntercept) { } } // namespace android::scheduler + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/mock/DisplayHardware/MockComposer.cpp b/services/surfaceflinger/tests/unittests/mock/DisplayHardware/MockComposer.cpp index 7ed57b9d96..0780af1f26 100644 --- a/services/surfaceflinger/tests/unittests/mock/DisplayHardware/MockComposer.cpp +++ b/services/surfaceflinger/tests/unittests/mock/DisplayHardware/MockComposer.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "mock/DisplayHardware/MockComposer.h" namespace android { @@ -27,3 +31,6 @@ Composer::~Composer() = default; } // namespace mock } // namespace Hwc2 } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/unittests/mock/MockSurfaceInterceptor.cpp b/services/surfaceflinger/tests/unittests/mock/MockSurfaceInterceptor.cpp index 4129328ba9..7e925b94ee 100644 --- a/services/surfaceflinger/tests/unittests/mock/MockSurfaceInterceptor.cpp +++ b/services/surfaceflinger/tests/unittests/mock/MockSurfaceInterceptor.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include "mock/MockSurfaceInterceptor.h" namespace android { @@ -25,3 +29,6 @@ SurfaceInterceptor::~SurfaceInterceptor() = default; } // namespace mock } // namespace android + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/tests/vsync/vsync.cpp b/services/surfaceflinger/tests/vsync/vsync.cpp index a1b45e6adb..667dfb92d5 100644 --- a/services/surfaceflinger/tests/vsync/vsync.cpp +++ b/services/surfaceflinger/tests/vsync/vsync.cpp @@ -14,6 +14,10 @@ * limitations under the License. */ +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" + #include #include #include @@ -82,3 +86,6 @@ int main(int /*argc*/, char** /*argv*/) return 0; } + +// TODO(b/129481165): remove the #pragma below and fix conversion issues +#pragma clang diagnostic pop // ignored "-Wconversion" -- cgit v1.2.3-59-g8ed1b From c91b4f56b857376e22148b9116146d737fc4c8d1 Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Tue, 28 Apr 2020 10:57:38 -0700 Subject: Remove unsafe cast in Client::createWithSurfaceParent Logs were initially added to debug an issue which has since been fixed. Bug: b/150226994, b/134888387 Test: POC from file does not crash on device with AddressSanitizer Change-Id: I582b1737026bd1dae62539a88e86dd2fd8edb539 --- services/surfaceflinger/Client.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'services/surfaceflinger/Client.cpp') diff --git a/services/surfaceflinger/Client.cpp b/services/surfaceflinger/Client.cpp index fb72ab8065..78bbcba4b4 100644 --- a/services/surfaceflinger/Client.cpp +++ b/services/surfaceflinger/Client.cpp @@ -93,11 +93,6 @@ status_t Client::createWithSurfaceParent(const String8& name, uint32_t w, uint32 uint32_t* outTransformHint) { if (mFlinger->authenticateSurfaceTexture(parent) == false) { ALOGE("failed to authenticate surface texture"); - // The extra parent layer check below before returning is to help with debugging - // b/134888387. Once the bug is fixed the check can be deleted. - if ((static_cast(parent.get()))->getLayer() == nullptr) { - ALOGE("failed to find parent layer"); - } return BAD_VALUE; } -- cgit v1.2.3-59-g8ed1b