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

Commit 2503764a authored by Tanguy Pruvot's avatar Tanguy Pruvot
Browse files

surfaceflinger: persist.sys property for 16bpp transparency

new property: persist.sys.use_16bpp_alpha

Drop the USE_16BPPSURFACE_FOR_OPAQUE define which is now obsolete
with the CMParts performaince option :
    http://review.cyanogenmod.com/8440



Signed-off-by: default avatarTanguy Pruvot <tanguy.pruvot@gmail.com>
Change-Id: Id9fca57fbd9c3f225326cbd77ce4fc053c9da002
parent cc60c9a2
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -24,10 +24,6 @@ ifeq ($(TARGET_BOARD_PLATFORM), omap3)
	LOCAL_CFLAGS += -DNO_RGBX_8888
endif

ifeq ($(TARGET_USES_16BPPSURFACE_FOR_OPAQUE), true)
	LOCAL_CFLAGS += -DUSE_16BPPSURFACE_FOR_OPAQUE
endif

ifeq ($(TARGET_DO_NOT_SETS_CAN_DRAW), true)
    LOCAL_CFLAGS += -DDO_NOT_SET_CAN_DRAW
endif
+18 −7
Original line number Diff line number Diff line
@@ -104,7 +104,8 @@ SurfaceFlinger::SurfaceFlinger()
        mBootFinished(false),
        mConsoleSignals(0),
        mSecureFrameBuffer(0),
        mUseDithering(true)
        mUseDithering(true),
        mUse16bppAlpha(false)
{
    init();
}
@@ -135,6 +136,10 @@ void SurfaceFlinger::init()
    mRenderColorG = atoi(value);
    property_get("debug.sf.render_color_blue", value, "824");
    mRenderColorB = atoi(value);

    // perf setting for the dynamic 16bpp alpha mode
    property_get("persist.sys.use_16bpp_alpha", value, "0");
    mUse16bppAlpha = atoi(value) == 1;
}

SurfaceFlinger::~SurfaceFlinger()
@@ -1269,8 +1274,11 @@ sp<ISurface> SurfaceFlinger::createSurface(const sp<Client>& client, int pid,
            params->format = format;

#ifdef NO_RGBX_8888
            if (params->format == PIXEL_FORMAT_RGBX_8888)
            if (params->format == PIXEL_FORMAT_RGBX_8888) {
                params->format = PIXEL_FORMAT_RGBA_8888;
                //to check, this should no more be usefull here
                LOGW("surface format changed from RGBX to RGBA for pid %d (%d x %d)", pid, w, h);
            }
#endif

            if (normalLayer != 0) {
@@ -1298,13 +1306,16 @@ sp<Layer> SurfaceFlinger::createNormalSurface(
        break;
    case PIXEL_FORMAT_OPAQUE:

#ifdef USE_16BPPSURFACE_FOR_OPAQUE
        if (mUse16bppAlpha) {
            format = PIXEL_FORMAT_RGB_565;
#elif defined(NO_RGBX_8888)
        format = PIXEL_FORMAT_RGBA_8888;
#else
            //LOGD("Using 16bpp alpha PIXEL_FORMAT_RGB_565 (window %d x %d)", w, h);
        } else {
#ifndef NO_RGBX_8888
            format = PIXEL_FORMAT_RGBX_8888;
#else
            format = PIXEL_FORMAT_RGBA_8888;
#endif
        }
        break;
    }

+2 −2
Original line number Diff line number Diff line
@@ -362,7 +362,6 @@ private:
                return (mFreezeDisplay || mFreezeCount>0) && mBootFinished;
            }

            
            void        debugFlashRegions();
            void        debugShowFPS() const;
            void        drawWormhole() const;
@@ -448,6 +447,7 @@ private:
   volatile     int32_t                     mSecureFrameBuffer;

                bool                        mUseDithering;
                bool                        mUse16bppAlpha;
};

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