Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 525705c8 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "Eradicate DisplayID." into jb-mr1-dev

parents 25e234f1 3ee454a7
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -30,12 +30,6 @@
#include <gui/ISurface.h>

namespace android {

// ----------------------------------------------------------------------------

// TODO: Remove this declaration, it is only used internally by SurfaceFlinger.
typedef int32_t    DisplayID;

// ----------------------------------------------------------------------------

class ISurfaceComposerClient : public IInterface
+1 −2
Original line number Diff line number Diff line
@@ -140,9 +140,8 @@ sp<ISurface> Client::createSurface(
        }
        sp<ISurface> getResult() const { return result; }
        virtual bool handler() {
            // TODO don't require display id to create a layer
            result = flinger->createLayer(params, name, client,
                    ISurfaceComposer::eDisplayIdMain, w, h, format, flags);
                    w, h, format, flags);
            return true;
        }
    };
+7 −4
Original line number Diff line number Diff line
@@ -68,12 +68,12 @@ void checkGLErrors()

DisplayDevice::DisplayDevice(
        const sp<SurfaceFlinger>& flinger,
        int32_t display, int32_t hwcDisplayId,
        DisplayType type, const wp<IBinder>& displayToken,
        const sp<ANativeWindow>& nativeWindow,
        const sp<FramebufferSurface>& framebufferSurface,
        EGLConfig config)
    : mFlinger(flinger),
      mId(display), mHwcDisplayId(hwcDisplayId),
      mType(type), mHwcDisplayId(-1),
      mNativeWindow(nativeWindow),
      mFramebufferSurface(framebufferSurface),
      mDisplay(EGL_NO_DISPLAY),
@@ -141,7 +141,10 @@ void DisplayDevice::init(EGLConfig config)
    mPageFlipCount = 0;

    // external displays are always considered enabled
    mScreenAcquired = mId >= DisplayDevice::DISPLAY_ID_COUNT;
    mScreenAcquired = (mType >= DisplayDevice::NUM_DISPLAY_TYPES);

    // get an h/w composer ID
    mHwcDisplayId = mFlinger->allocateHwcDisplayId(mType);

    // initialize the display orientation transform.
    DisplayDevice::setOrientation(DisplayState::eOrientationDefault);
@@ -210,7 +213,7 @@ void DisplayDevice::setVisibleLayersSortedByZ(const Vector< sp<LayerBase> >& lay
    }
}

Vector< sp<LayerBase> > DisplayDevice::getVisibleLayersSortedByZ() const {
const Vector< sp<LayerBase> >& DisplayDevice::getVisibleLayersSortedByZ() const {
    return mVisibleLayersSortedByZ;
}

+12 −12
Original line number Diff line number Diff line
@@ -51,10 +51,12 @@ public:
    // region in screen space
    Region undefinedRegion;

    enum {
        DISPLAY_ID_MAIN = HWC_DISPLAY_PRIMARY,
        DISPLAY_ID_HDMI = HWC_DISPLAY_EXTERNAL,
        DISPLAY_ID_COUNT = HWC_NUM_DISPLAY_TYPES
    enum DisplayType {
        DISPLAY_ID_INVALID = -1,
        DISPLAY_PRIMARY     = HWC_DISPLAY_PRIMARY,
        DISPLAY_EXTERNAL    = HWC_DISPLAY_EXTERNAL,
        NUM_DISPLAY_TYPES   = HWC_NUM_DISPLAY_TYPES,
        DISPLAY_VIRTUAL     = HWC_NUM_DISPLAY_TYPES
    };

    enum {
@@ -64,7 +66,7 @@ public:

    DisplayDevice(
            const sp<SurfaceFlinger>& flinger,
            int32_t dpy, int32_t hwcDisplayId,
            DisplayType type, const wp<IBinder>& displayToken,
            const sp<ANativeWindow>& nativeWindow,
            const sp<FramebufferSurface>& framebufferSurface,
            EGLConfig config);
@@ -87,7 +89,7 @@ public:
    EGLSurface  getEGLSurface() const;

    void                    setVisibleLayersSortedByZ(const Vector< sp<LayerBase> >& layers);
    Vector< sp<LayerBase> > getVisibleLayersSortedByZ() const;
    const Vector< sp<LayerBase> >& getVisibleLayersSortedByZ() const;
    bool                    getSecureLayerVisible() const;
    Region                  getDirtyRegion(bool repaintEverything) const;

@@ -97,8 +99,9 @@ public:
    int                     getOrientation() const { return mOrientation; }
    const Transform&        getTransform() const { return mGlobalTransform; }
    uint32_t                getLayerStack() const { return mLayerStack; }
    int32_t                 getDisplayId() const { return mId; }
    int32_t                 getDisplayType() const { return mType; }
    int32_t                 getHwcDisplayId() const { return mHwcDisplayId; }
    const wp<IBinder>&      getDisplayToken() const { return mDisplayToken; }

    status_t compositionComplete() const;
    
@@ -123,10 +126,6 @@ public:
    uint32_t getPageFlipCount() const;
    void dump(String8& res) const;

    inline bool operator < (const DisplayDevice& rhs) const {
        return mId < rhs.mId;
    }

private:
    void init(EGLConfig config);

@@ -134,8 +133,9 @@ private:
     *  Constants, set during initialization
     */
    sp<SurfaceFlinger> mFlinger;
    int32_t mId;
    DisplayType mType;
    int32_t mHwcDisplayId;
    wp<IBinder> mDisplayToken;

    // ANativeWindow this display is rendering into
    sp<ANativeWindow> mNativeWindow;
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ void EventThread::onScreenAcquired() {
}


void EventThread::onVSyncReceived(int, nsecs_t timestamp) {
void EventThread::onVSyncReceived(const wp<IBinder>&, nsecs_t timestamp) {
    Mutex::Autolock _l(mLock);
    mVSyncTimestamp = timestamp;
    mVSyncCount++;
Loading