DO NOT MERGE SurfaceFlinger: Stop using IGBC::BufferItem
Switches all uses of IGraphicBufferConsumer::BufferItem (and BufferQueue::BufferItem) to the BufferItem in libgui. Depends on frameworks/native I699ed0a6837076867ca756b28d1ffb2238f7a0d9. Cherry pick of I187b3a7d05196b6289596afac8fb9a9d4aebff76 Change-Id: I5bc79fb96b6cba6021af64b20890967aa3b7fcbf
This commit is contained in:
parent
cf3834db10
commit
11611f9be5
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user