summaryrefslogtreecommitdiff
path: root/libs/gui/GLConsumer.cpp
diff options
context:
space:
mode:
author Anton Ivanov <aii@google.com> 2025-02-20 11:52:50 -0800
committer Anton Ivanov <aii@google.com> 2025-02-26 10:51:53 -0800
commit8ed86598b8e5ee2ef1bf1f69e467489e620635e0 (patch)
treeaaea52463dcc535ab2a56ad8941c7d21025ef226 /libs/gui/GLConsumer.cpp
parentaf9a9ce3f96c6a31684f3b5885722919a1f5ec62 (diff)
Revert^2 "Harden construction sites of android::StrongPointer."
This reverts commit f73db7a6242e297ead71df0d0d1fb3a8515245d3. Reason for revert: Scope restricted to sp<>::make which is a safe replacement for assignment from new. Bug: 393217449 Test: ChoreographerTests pass locally. Flag: EXEMPT_refactor Change-Id: I9a38c54c06cc64da099d282c05ccf20f40b70a72
Diffstat (limited to 'libs/gui/GLConsumer.cpp')
-rw-r--r--libs/gui/GLConsumer.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index 052b8edfaa..70c04b3518 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -333,7 +333,7 @@ status_t GLConsumer::releaseTexImage() {
}
if (mReleasedTexImage == nullptr) {
- mReleasedTexImage = new EglImage(getDebugTexImageBuffer());
+ mReleasedTexImage = sp<EglImage>::make(getDebugTexImageBuffer());
}
mCurrentTexture = BufferQueue::INVALID_BUFFER_SLOT;
@@ -365,10 +365,10 @@ sp<GraphicBuffer> GLConsumer::getDebugTexImageBuffer() {
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(
- kDebugData.width, kDebugData.height, PIXEL_FORMAT_RGBA_8888,
- DEFAULT_USAGE_FLAGS | GraphicBuffer::USAGE_SW_WRITE_RARELY,
- "[GLConsumer debug texture]");
+ sp<GraphicBuffer> buffer =
+ sp<GraphicBuffer>::make(kDebugData.width, kDebugData.height, PIXEL_FORMAT_RGBA_8888,
+ DEFAULT_USAGE_FLAGS | GraphicBuffer::USAGE_SW_WRITE_RARELY,
+ "[GLConsumer debug texture]");
uint32_t* bits;
buffer->lock(GraphicBuffer::USAGE_SW_WRITE_RARELY, reinterpret_cast<void**>(&bits));
uint32_t stride = buffer->getStride();
@@ -400,7 +400,7 @@ status_t GLConsumer::acquireBufferLocked(BufferItem *item,
// replaces any old EglImage with a new one (using the new buffer).
if (item->mGraphicBuffer != nullptr) {
int slot = item->mSlot;
- mEglSlots[slot].mEglImage = new EglImage(item->mGraphicBuffer);
+ mEglSlots[slot].mEglImage = sp<EglImage>::make(item->mGraphicBuffer);
}
return NO_ERROR;
@@ -737,7 +737,7 @@ status_t GLConsumer::syncForReleaseLocked(EGLDisplay dpy) {
"fd: %#x", eglGetError());
return UNKNOWN_ERROR;
}
- sp<Fence> fence(new Fence(fenceFd));
+ sp<Fence> fence = sp<Fence>::make(fenceFd);
status_t err = addReleaseFenceLocked(mCurrentTexture,
mCurrentTextureImage->graphicBuffer(), fence);
if (err != OK) {