Loading include/gui/GLConsumer.h +17 −2 Original line number Diff line number Diff line Loading @@ -253,10 +253,25 @@ protected: static bool isExternalFormat(PixelFormat format); struct PendingRelease { PendingRelease() : isPending(false), currentTexture(-1), graphicBuffer(), display(nullptr), fence(nullptr) {} bool isPending; int currentTexture; sp<GraphicBuffer> graphicBuffer; EGLDisplay display; EGLSyncKHR fence; }; // This releases the buffer in the slot referenced by mCurrentTexture, // then updates state to refer to the BufferItem, which must be a // newly-acquired buffer. status_t updateAndReleaseLocked(const BufferItem& item); // newly-acquired buffer. If pendingRelease is not null, the parameters // which would have been passed to releaseBufferLocked upon the successful // completion of the method will instead be returned to the caller, so that // it may call releaseBufferLocked itself later. status_t updateAndReleaseLocked(const BufferItem& item, PendingRelease* pendingRelease = nullptr); // Binds mTexName and the current buffer to mTexTarget. Uses // mCurrentTexture if it's set, mCurrentTextureImage if not. If the Loading libs/gui/GLConsumer.cpp +19 −9 Original line number Diff line number Diff line Loading @@ -370,7 +370,8 @@ status_t GLConsumer::releaseBufferLocked(int buf, return err; } status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item) status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item, PendingRelease* pendingRelease) { status_t err = NO_ERROR; Loading Loading @@ -432,6 +433,7 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item) // release old buffer if (mCurrentTexture != BufferQueue::INVALID_BUFFER_SLOT) { if (pendingRelease == nullptr) { status_t status = releaseBufferLocked( mCurrentTexture, mCurrentTextureImage->graphicBuffer(), mEglDisplay, mEglSlots[mCurrentTexture].mEglFence); Loading @@ -441,6 +443,14 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item) err = status; // keep going, with error raised [?] } } else { pendingRelease->currentTexture = mCurrentTexture; pendingRelease->graphicBuffer = mCurrentTextureImage->graphicBuffer(); pendingRelease->display = mEglDisplay; pendingRelease->fence = mEglSlots[mCurrentTexture].mEglFence; pendingRelease->isPending = true; } } // Update the GLConsumer state. Loading services/surfaceflinger/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ LOCAL_SRC_FILES := \ SurfaceFlingerConsumer.cpp \ Transform.cpp \ DisplayHardware/FramebufferSurface.cpp \ DisplayHardware/HWC2.cpp \ DisplayHardware/HWC2On1Adapter.cpp \ DisplayHardware/HWComposer.cpp \ DisplayHardware/PowerHAL.cpp \ DisplayHardware/VirtualDisplaySurface.cpp \ Loading services/surfaceflinger/DisplayHardware/FloatRect.h +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #ifndef ANDROID_SF_FLOAT_RECT #define ANDROID_SF_FLOAT_RECT #include <ui/Rect.h> #include <utils/TypeHelpers.h> namespace android { Loading Loading
include/gui/GLConsumer.h +17 −2 Original line number Diff line number Diff line Loading @@ -253,10 +253,25 @@ protected: static bool isExternalFormat(PixelFormat format); struct PendingRelease { PendingRelease() : isPending(false), currentTexture(-1), graphicBuffer(), display(nullptr), fence(nullptr) {} bool isPending; int currentTexture; sp<GraphicBuffer> graphicBuffer; EGLDisplay display; EGLSyncKHR fence; }; // This releases the buffer in the slot referenced by mCurrentTexture, // then updates state to refer to the BufferItem, which must be a // newly-acquired buffer. status_t updateAndReleaseLocked(const BufferItem& item); // newly-acquired buffer. If pendingRelease is not null, the parameters // which would have been passed to releaseBufferLocked upon the successful // completion of the method will instead be returned to the caller, so that // it may call releaseBufferLocked itself later. status_t updateAndReleaseLocked(const BufferItem& item, PendingRelease* pendingRelease = nullptr); // Binds mTexName and the current buffer to mTexTarget. Uses // mCurrentTexture if it's set, mCurrentTextureImage if not. If the Loading
libs/gui/GLConsumer.cpp +19 −9 Original line number Diff line number Diff line Loading @@ -370,7 +370,8 @@ status_t GLConsumer::releaseBufferLocked(int buf, return err; } status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item) status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item, PendingRelease* pendingRelease) { status_t err = NO_ERROR; Loading Loading @@ -432,6 +433,7 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item) // release old buffer if (mCurrentTexture != BufferQueue::INVALID_BUFFER_SLOT) { if (pendingRelease == nullptr) { status_t status = releaseBufferLocked( mCurrentTexture, mCurrentTextureImage->graphicBuffer(), mEglDisplay, mEglSlots[mCurrentTexture].mEglFence); Loading @@ -441,6 +443,14 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item) err = status; // keep going, with error raised [?] } } else { pendingRelease->currentTexture = mCurrentTexture; pendingRelease->graphicBuffer = mCurrentTextureImage->graphicBuffer(); pendingRelease->display = mEglDisplay; pendingRelease->fence = mEglSlots[mCurrentTexture].mEglFence; pendingRelease->isPending = true; } } // Update the GLConsumer state. Loading
services/surfaceflinger/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ LOCAL_SRC_FILES := \ SurfaceFlingerConsumer.cpp \ Transform.cpp \ DisplayHardware/FramebufferSurface.cpp \ DisplayHardware/HWC2.cpp \ DisplayHardware/HWC2On1Adapter.cpp \ DisplayHardware/HWComposer.cpp \ DisplayHardware/PowerHAL.cpp \ DisplayHardware/VirtualDisplaySurface.cpp \ Loading
services/surfaceflinger/DisplayHardware/FloatRect.h +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #ifndef ANDROID_SF_FLOAT_RECT #define ANDROID_SF_FLOAT_RECT #include <ui/Rect.h> #include <utils/TypeHelpers.h> namespace android { Loading