diff options
author | Dan Stoza <stoza@google.com> | 2015-03-12 15:12:44 -0700 |
---|---|---|
committer | Dan Stoza <stoza@google.com> | 2015-03-12 15:12:44 -0700 |
commit | 84493cd420d3d53a16ae7c745ed38afffb4e67f5 (patch) | |
tree | 8f12aa6db2e7df94aafde82bbd6d47d7564c0bf1 | |
parent | dd26416fe135f93ef2c8570738f8e1ca5e2ca3a3 (diff) | |
download | frameworks_native-84493cd420d3d53a16ae7c745ed38afffb4e67f5.zip frameworks_native-84493cd420d3d53a16ae7c745ed38afffb4e67f5.tar.gz frameworks_native-84493cd420d3d53a16ae7c745ed38afffb4e67f5.tar.bz2 |
SurfaceFlinger: Stop using IGBC::BufferItem
Switches all uses of IGraphicBufferConsumer::BufferItem (and
BufferQueue::BufferItem) to the BufferItem in libgui. Depends on
frameworks/native I699ed0a6837076867ca756b28d1ffb2238f7a0d9.
Change-Id: I187b3a7d05196b6289596afac8fb9a9d4aebff76
5 files changed, 14 insertions, 9 deletions
diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp index 4885c5f..6ef3295 100644 --- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp +++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp @@ -29,8 +29,9 @@ #include <EGL/egl.h> #include <hardware/hardware.h> -#include <gui/Surface.h> +#include <gui/BufferItem.h> #include <gui/GraphicBufferAlloc.h> +#include <gui/Surface.h> #include <ui/GraphicBuffer.h> #include "FramebufferSurface.h" @@ -86,7 +87,7 @@ status_t FramebufferSurface::advanceFrame() { status_t FramebufferSurface::nextBuffer(sp<GraphicBuffer>& outBuffer, sp<Fence>& outFence) { Mutex::Autolock lock(mMutex); - BufferQueue::BufferItem item; + BufferItem item; status_t err = acquireBufferLocked(&item, 0); if (err == BufferQueue::NO_BUFFER_AVAILABLE) { outBuffer = mCurrentBuffer; diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp index aefa8fd..0e94f0d 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp @@ -18,6 +18,8 @@ #include "VirtualDisplaySurface.h" #include "HWComposer.h" +#include <gui/BufferItem.h> + // --------------------------------------------------------------------------- namespace android { // --------------------------------------------------------------------------- @@ -436,7 +438,7 @@ status_t VirtualDisplaySurface::queueBuffer(int pslot, // Now acquire the buffer from the scratch pool -- should be the same // slot and fence as we just queued. Mutex::Autolock lock(mMutex); - BufferQueue::BufferItem item; + BufferItem item; result = acquireBufferLocked(&item, 0); if (result != NO_ERROR) return result; diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index cf27945..2ac4765 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1130,7 +1130,7 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions) } virtual bool reject(const sp<GraphicBuffer>& buf, - const IGraphicBufferConsumer::BufferItem& item) { + const BufferItem& item) { if (buf == NULL) { return false; } diff --git a/services/surfaceflinger/SurfaceFlingerConsumer.cpp b/services/surfaceflinger/SurfaceFlingerConsumer.cpp index 7de6ac4..abf3993 100644 --- a/services/surfaceflinger/SurfaceFlingerConsumer.cpp +++ b/services/surfaceflinger/SurfaceFlingerConsumer.cpp @@ -21,6 +21,8 @@ #include <private/gui/SyncFeatures.h> +#include <gui/BufferItem.h> + #include <utils/Errors.h> #include <utils/NativeHandle.h> #include <utils/Trace.h> @@ -47,7 +49,7 @@ status_t SurfaceFlingerConsumer::updateTexImage(BufferRejecter* rejecter, return err; } - BufferQueue::BufferItem item; + BufferItem item; // Acquire the next buffer. // In asynchronous mode the list is guaranteed to be one buffer @@ -101,8 +103,8 @@ status_t SurfaceFlingerConsumer::bindTextureImage() return bindTextureImageLocked(); } -status_t SurfaceFlingerConsumer::acquireBufferLocked( - BufferQueue::BufferItem *item, nsecs_t presentWhen) { +status_t SurfaceFlingerConsumer::acquireBufferLocked(BufferItem* item, + nsecs_t presentWhen) { status_t result = GLConsumer::acquireBufferLocked(item, presentWhen); if (result == NO_ERROR) { mTransformToDisplayInverse = item->mTransformToDisplayInverse; diff --git a/services/surfaceflinger/SurfaceFlingerConsumer.h b/services/surfaceflinger/SurfaceFlingerConsumer.h index 28f2f6a..d1cf9b9 100644 --- a/services/surfaceflinger/SurfaceFlingerConsumer.h +++ b/services/surfaceflinger/SurfaceFlingerConsumer.h @@ -41,13 +41,13 @@ public: class BufferRejecter { friend class SurfaceFlingerConsumer; virtual bool reject(const sp<GraphicBuffer>& buf, - const IGraphicBufferConsumer::BufferItem& item) = 0; + const BufferItem& item) = 0; protected: virtual ~BufferRejecter() { } }; - virtual status_t acquireBufferLocked(BufferQueue::BufferItem *item, nsecs_t presentWhen); + virtual status_t acquireBufferLocked(BufferItem *item, nsecs_t presentWhen); // This version of updateTexImage() takes a functor that may be used to // reject the newly acquired buffer. Unlike the GLConsumer version, |