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

Commit 94e6a688 authored by Chia-I Wu's avatar Chia-I Wu
Browse files

surfaceflinger: remove DisplayDevice::mFlags

It is always 0.

Test: SurfaceFlinger_test
Change-Id: I0a7a53412dbddc9b9a1f0a0c4b521737c59f7d59
parent b523df0c
Loading
Loading
Loading
Loading
+1 −29
Original line number Diff line number Diff line
@@ -53,12 +53,6 @@
using namespace android;
// ----------------------------------------------------------------------------

#ifdef EGL_ANDROID_swap_rectangle
static constexpr bool kEGLAndroidSwapRectangle = true;
#else
static constexpr bool kEGLAndroidSwapRectangle = false;
#endif

// retrieve triple buffer setting from configstore
using namespace android::hardware::configstore;
using namespace android::hardware::configstore::V1_0;
@@ -66,12 +60,6 @@ using namespace android::hardware::configstore::V1_0;
static bool useTripleFramebuffer = getInt64< ISurfaceFlingerConfigs,
        &ISurfaceFlingerConfigs::maxFrameBufferAcquiredBuffers>(2) >= 3;

#if !defined(EGL_EGLEXT_PROTOTYPES) || !defined(EGL_ANDROID_swap_rectangle)
// Dummy implementation in case it is missing.
inline void eglSetSwapRectangleANDROID (EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint) {
}
#endif

/*
 * Initialize the display to the specified values.
 *
@@ -99,7 +87,6 @@ DisplayDevice::DisplayDevice(
      mSurface(EGL_NO_SURFACE),
      mDisplayWidth(),
      mDisplayHeight(),
      mFlags(),
      mPageFlipCount(),
      mIsSecure(isSecure),
      mLayerStack(NO_LAYER_STACK),
@@ -214,19 +201,9 @@ uint32_t DisplayDevice::getPageFlipCount() const {
    return mPageFlipCount;
}

void DisplayDevice::flip(const Region& dirty) const
void DisplayDevice::flip(const Region& /*dirty*/) const
{
    mFlinger->getRenderEngine().checkErrors();

    if (kEGLAndroidSwapRectangle) {
        if (mFlags & SWAP_RECTANGLE) {
            const Region newDirty(dirty.intersect(bounds()));
            const Rect b(newDirty.getBounds());
            eglSetSwapRectangleANDROID(mDisplay, mSurface,
                    b.left, b.top, b.width(), b.height());
        }
    }

    mPageFlipCount++;
}

@@ -285,11 +262,6 @@ void DisplayDevice::onSwapBuffersCompleted() const {
    mDisplaySurface->onFrameCommitted();
}

uint32_t DisplayDevice::getFlags() const
{
    return mFlags;
}

EGLBoolean DisplayDevice::makeCurrent() const {
    EGLBoolean result = EGL_TRUE;
    EGLSurface sur = eglGetCurrentSurface(EGL_DRAW);
+0 −7
Original line number Diff line number Diff line
@@ -69,11 +69,6 @@ public:
        NUM_BUILTIN_DISPLAY_TYPES = HWC_NUM_PHYSICAL_DISPLAY_TYPES,
    };

    enum {
        PARTIAL_UPDATES = 0x00020000, // video driver feature
        SWAP_RECTANGLE  = 0x00080000,
    };

    enum {
        NO_LAYER_STACK = 0xFFFFFFFF,
    };
@@ -106,7 +101,6 @@ public:

    int         getWidth() const;
    int         getHeight() const;
    uint32_t    getFlags() const;

    EGLSurface  getEGLSurface() const;

@@ -203,7 +197,6 @@ private:
    EGLSurface      mSurface;
    int             mDisplayWidth;
    int             mDisplayHeight;
    uint32_t        mFlags;
    mutable uint32_t mPageFlipCount;
    String8         mDisplayName;
    bool            mIsSecure;
+3 −19
Original line number Diff line number Diff line
@@ -2649,25 +2649,9 @@ void SurfaceFlinger::doDisplayComposition(
    // compute the invalid region
    displayDevice->swapRegion.orSelf(dirtyRegion);

    uint32_t flags = displayDevice->getFlags();
    if (flags & DisplayDevice::SWAP_RECTANGLE) {
        // we can redraw only what's dirty, but since SWAP_RECTANGLE only
        // takes a rectangle, we must make sure to update that whole
        // rectangle in that case
        dirtyRegion.set(displayDevice->swapRegion.bounds());
    } else {
        if (flags & DisplayDevice::PARTIAL_UPDATES) {
            // We need to redraw the rectangle that will be updated
            // (pushed to the framebuffer).
            // This is needed because PARTIAL_UPDATES only takes one
            // rectangle instead of a region (see DisplayDevice::flip())
            dirtyRegion.set(displayDevice->swapRegion.bounds());
        } else {
    // we need to redraw everything (the whole screen)
    dirtyRegion.set(displayDevice->bounds());
    displayDevice->swapRegion = dirtyRegion;
        }
    }

    if (!doComposeSurfaces(displayDevice, dirtyRegion)) return;