summaryrefslogtreecommitdiff
path: root/libs/gui/GLConsumer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/GLConsumer.cpp')
-rw-r--r--libs/gui/GLConsumer.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index 14d9937142..59e78cc6bf 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -315,7 +315,7 @@ status_t GLConsumer::releaseTexImage() {
return err;
}
- if (mReleasedTexImage == NULL) {
+ if (mReleasedTexImage == nullptr) {
mReleasedTexImage = new EglImage(getDebugTexImageBuffer());
}
@@ -345,7 +345,7 @@ status_t GLConsumer::releaseTexImage() {
sp<GraphicBuffer> GLConsumer::getDebugTexImageBuffer() {
Mutex::Autolock _l(sStaticInitLock);
- if (CC_UNLIKELY(sReleasedTexImageBuffer == NULL)) {
+ if (CC_UNLIKELY(sReleasedTexImageBuffer == nullptr)) {
// The first time, create the debug texture in case the application
// continues to use it.
sp<GraphicBuffer> buffer = new GraphicBuffer(
@@ -381,7 +381,7 @@ status_t GLConsumer::acquireBufferLocked(BufferItem *item,
// If item->mGraphicBuffer is not null, this buffer has not been acquired
// before, so any prior EglImage created is using a stale buffer. This
// replaces any old EglImage with a new one (using the new buffer).
- if (item->mGraphicBuffer != NULL) {
+ if (item->mGraphicBuffer != nullptr) {
int slot = item->mSlot;
mEglSlots[slot].mEglImage = new EglImage(item->mGraphicBuffer);
}
@@ -455,7 +455,7 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item,
GLC_LOGV("updateAndRelease: (slot=%d buf=%p) -> (slot=%d buf=%p)",
mCurrentTexture, mCurrentTextureImage != NULL ?
- mCurrentTextureImage->graphicBufferHandle() : 0,
+ mCurrentTextureImage->graphicBufferHandle() : nullptr,
slot, mSlots[slot].mGraphicBuffer->handle);
// Hang onto the pointer so that it isn't freed in the call to
@@ -515,7 +515,7 @@ status_t GLConsumer::bindTextureImageLocked() {
glBindTexture(mTexTarget, mTexName);
if (mCurrentTexture == BufferQueue::INVALID_BUFFER_SLOT &&
- mCurrentTextureImage == NULL) {
+ mCurrentTextureImage == nullptr) {
GLC_LOGE("bindTextureImage: no currently-bound texture");
return NO_INIT;
}
@@ -679,7 +679,7 @@ status_t GLConsumer::attachToContext(uint32_t tex) {
mTexName = tex;
mAttached = true;
- if (mCurrentTextureImage != NULL) {
+ if (mCurrentTextureImage != nullptr) {
// This may wait for a buffer a second time. This is likely required if
// this is a different context, since otherwise the wait could be skipped
// by bouncing through another context. For the same context the extra
@@ -700,7 +700,7 @@ status_t GLConsumer::syncForReleaseLocked(EGLDisplay dpy) {
if (mCurrentTexture != BufferQueue::INVALID_BUFFER_SLOT) {
if (SyncFeatures::getInstance().useNativeFenceSync()) {
EGLSyncKHR sync = eglCreateSyncKHR(dpy,
- EGL_SYNC_NATIVE_FENCE_ANDROID, NULL);
+ EGL_SYNC_NATIVE_FENCE_ANDROID, nullptr);
if (sync == EGL_NO_SYNC_KHR) {
GLC_LOGE("syncForReleaseLocked: error creating EGL fence: %#x",
eglGetError());
@@ -744,7 +744,7 @@ status_t GLConsumer::syncForReleaseLocked(EGLDisplay dpy) {
// Create a fence for the outstanding accesses in the current
// OpenGL ES context.
- fence = eglCreateSyncKHR(dpy, EGL_SYNC_FENCE_KHR, NULL);
+ fence = eglCreateSyncKHR(dpy, EGL_SYNC_FENCE_KHR, nullptr);
if (fence == EGL_NO_SYNC_KHR) {
GLC_LOGE("syncForReleaseLocked: error creating fence: %#x",
eglGetError());
@@ -795,11 +795,11 @@ void GLConsumer::setFilteringEnabled(bool enabled) {
bool needsRecompute = mFilteringEnabled != enabled;
mFilteringEnabled = enabled;
- if (needsRecompute && mCurrentTextureImage==NULL) {
+ if (needsRecompute && mCurrentTextureImage==nullptr) {
GLC_LOGD("setFilteringEnabled called with mCurrentTextureImage == NULL");
}
- if (needsRecompute && mCurrentTextureImage != NULL) {
+ if (needsRecompute && mCurrentTextureImage != nullptr) {
computeCurrentTransformMatrixLocked();
}
}
@@ -940,7 +940,7 @@ sp<GraphicBuffer> GLConsumer::getCurrentBuffer(int* outSlot) const {
}
return (mCurrentTextureImage == nullptr) ?
- NULL : mCurrentTextureImage->graphicBuffer();
+ nullptr : mCurrentTextureImage->graphicBuffer();
}
Rect GLConsumer::getCurrentCrop() const {
@@ -1267,7 +1267,7 @@ EGLImageKHR GLConsumer::EglImage::createImage(EGLDisplay dpy,
attrs[3] = attrs[11];
attrs[4] = EGL_NONE;
}
- eglInitialize(dpy, 0, 0);
+ eglInitialize(dpy, nullptr, nullptr);
EGLImageKHR image = eglCreateImageKHR(dpy, EGL_NO_CONTEXT,
EGL_NATIVE_BUFFER_ANDROID, cbuf, attrs);
if (image == EGL_NO_IMAGE_KHR) {