Reshuffle FramebufferSurface
FramebufferSurface no longer speaks directly to the FB HAL. Now
everything goes through HWComposer (which may or may not be
connected to a hardware composer).
Added display index arg to some query methods.
Change-Id: Id3e157d2d4e3555d33afbb703e518b6e92e2d6d5
diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.h b/services/surfaceflinger/DisplayHardware/FramebufferSurface.h
index bfa500b..fd7c520 100644
--- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.h
+++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.h
@@ -30,13 +30,13 @@
class Rect;
class String8;
+class HWComposer;
// ---------------------------------------------------------------------------
class FramebufferSurface : public ConsumerBase {
public:
-
- static sp<FramebufferSurface> create();
+ FramebufferSurface(HWComposer& hwc);
bool isUpdateOnDemand() const { return false; }
status_t setUpdateRectangle(const Rect& updateRect);
@@ -49,22 +49,12 @@
// BufferQueue. The new buffer is returned in the 'buffer' argument.
status_t nextBuffer(sp<GraphicBuffer>* buffer);
- // FIXME: currently there are information we can only get from the
- // FB HAL, and FB HAL can only be instantiated once on some devices.
- // Eventually this functionality will have to move in HWC or somewhere else.
- const framebuffer_device_t* getFbHal() const {
- return fbDev;
- }
-
private:
- FramebufferSurface();
- virtual ~FramebufferSurface(); // this class cannot be overloaded
+ virtual ~FramebufferSurface() { }; // this class cannot be overloaded
virtual void onFrameAvailable();
virtual void freeBufferLocked(int slotIndex);
- framebuffer_device_t* fbDev;
-
// mCurrentBufferIndex is the slot index of the current buffer or
// INVALID_BUFFER_SLOT to indicate that either there is no current buffer
// or the buffer is not associated with a slot.
@@ -73,6 +63,9 @@
// mCurrentBuffer is the current buffer or NULL to indicate that there is
// no current buffer.
sp<GraphicBuffer> mCurrentBuffer;
+
+ // Hardware composer, owned by SurfaceFlinger.
+ HWComposer& mHwc;
};
// ---------------------------------------------------------------------------