diff options
author | 2018-06-07 23:46:04 +0000 | |
---|---|---|
committer | 2018-06-07 23:46:04 +0000 | |
commit | a160f5a70ffba3715c8a92f4f469922d59635356 (patch) | |
tree | 627f17cbd47a952696913884b21d100cc15c855b /libs/gui/SurfaceComposerClient.cpp | |
parent | 978e43d7a14f75a0d2d32517d906e173de48110b (diff) | |
parent | 9c804c47fc86a45ac517e9c91d3c986cb9d315dd (diff) |
Merge "Replace NULL/0 with nullptr"
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 7ae2672249..053b9afb86 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -80,7 +80,7 @@ void ComposerService::connectLocked() { /*static*/ sp<ISurfaceComposer> ComposerService::getComposerService() { ComposerService& instance = ComposerService::getInstance(); Mutex::Autolock _l(instance.mLock); - if (instance.mComposerService == NULL) { + if (instance.mComposerService == nullptr) { ComposerService::getInstance().connectLocked(); assert(instance.mComposerService != NULL); ALOGD("ComposerService reconnected"); @@ -91,8 +91,8 @@ void ComposerService::connectLocked() { void ComposerService::composerServiceDied() { Mutex::Autolock _l(mLock); - mComposerService = NULL; - mDeathObserver = NULL; + mComposerService = nullptr; + mDeathObserver = nullptr; } // --------------------------------------------------------------------------- @@ -621,12 +621,12 @@ SurfaceComposerClient::SurfaceComposerClient(const sp<IGraphicBufferProducer>& r void SurfaceComposerClient::onFirstRef() { sp<ISurfaceComposer> sm(ComposerService::getComposerService()); - if (sm != 0) { + if (sm != nullptr) { auto rootProducer = mParent.promote(); sp<ISurfaceComposerClient> conn; conn = (rootProducer != nullptr) ? sm->createScopedConnection(rootProducer) : sm->createConnection(); - if (conn != 0) { + if (conn != nullptr) { mClient = conn; mStatus = NO_ERROR; } @@ -656,7 +656,7 @@ void SurfaceComposerClient::dispose() { // this can be called more than once. sp<ISurfaceComposerClient> client; Mutex::Autolock _lm(mLock); - if (mClient != 0) { + if (mClient != nullptr) { client = mClient; // hold ref while lock is held mClient.clear(); } @@ -946,7 +946,7 @@ status_t ScreenshotClient::capture( Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, int32_t minLayerZ, int32_t maxLayerZ, bool useIdentityTransform) { sp<ISurfaceComposer> s(ComposerService::getComposerService()); - if (s == NULL) return NO_INIT; + if (s == nullptr) return NO_INIT; return s->captureScreen(display, producer, sourceCrop, reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform); } @@ -957,7 +957,7 @@ status_t ScreenshotClient::captureToBuffer(const sp<IBinder>& display, uint32_t rotation, sp<GraphicBuffer>* outBuffer) { sp<ISurfaceComposer> s(ComposerService::getComposerService()); - if (s == NULL) return NO_INIT; + if (s == nullptr) return NO_INIT; sp<IGraphicBufferConsumer> gbpConsumer; sp<IGraphicBufferProducer> producer; @@ -988,7 +988,7 @@ ScreenshotClient::~ScreenshotClient() { } sp<CpuConsumer> ScreenshotClient::getCpuConsumer() const { - if (mCpuConsumer == NULL) { + if (mCpuConsumer == nullptr) { sp<IGraphicBufferConsumer> consumer; BufferQueue::createBufferQueue(&mProducer, &consumer); mCpuConsumer = new CpuConsumer(consumer, 1); @@ -1002,7 +1002,7 @@ status_t ScreenshotClient::update(const sp<IBinder>& display, int32_t minLayerZ, int32_t maxLayerZ, bool useIdentityTransform, uint32_t rotation) { sp<ISurfaceComposer> s(ComposerService::getComposerService()); - if (s == NULL) return NO_INIT; + if (s == nullptr) return NO_INIT; sp<CpuConsumer> cpuConsumer = getCpuConsumer(); if (mHaveBuffer) { |