FORUMS

HTC Delivering Ads Straight to Sense Home

HTC’s 2015 has been a year marked by a desperate search for revenue.The HTC One M9 … more

Galaxy S6 & Edge get €100 Price Cut—New Models Incoming

Samsung has dropped the price of both the Galaxy S6 and S6 Edge by … more

How To Port Fully Featured Sony Xperia Z4 Camera

Xperia Z4’s hardware may not impress, but its software is definitely … more

Experimental TWRP Available For Moto G 2015

XDA Senior Member squid2 has posted experimental builds of TWRP for the Moto G … more

[Fix] Banding problem fix with launcherPro on widgets.

711 posts
Thanks Meter: 58
 
By hg3atintin, Senior Member on 28th March 2011, 08:20 PM
Post Reply Subscribe to Thread Email Thread
On all roms there is a banding problem due to our screens 65 k colors.

But launcherpro fixes the banding problems on widgets But on some gingerbread roms it does not.

I have not made this fix. But I have tested it on some roms. Im am just sharing this. credit goes to Tytung who took his time and fixed this in his latest 2.5 rom and GPC + other developers that may have found this already.

I have tried it on Tyweens cm7 rom, Tytungs rom and some other. But it "maybe" works on others to? Like gpc's one?

= When using launcher pro with this fix. The launcher will have no banding problems on widgets and on the homescreen. But other banding problems will still be there like it was before.

So without fix ,the clock widget will look like crap in launcher pro in tyweens cm7 rom. But with the fix it will look smooth.

The zip changes the libsurfaceflinger.so.

Flash in cwm.
Attached Files
File Type: zip gradient-fix_update.zip - [Click for QR Code] (431.8 KB, 780 views)
Last edited by hg3atintin; 29th March 2011 at 07:20 AM.
The Following 7 Users Say Thank You to hg3atintin For This Useful Post: [ View ]
 
 
28th March 2011, 11:39 PM |#2  
mydoooom's Avatar
Member
Flag Prague
Thanks Meter: 1
 
More
Thank God, at last! Great stuff
29th March 2011, 12:30 AM |#3  
SH4YD33's Avatar
Senior Member
Flag The Bay, CA
Thanks Meter: 45
 
More
works on tyween cm7.
29th March 2011, 02:52 AM |#4  
mikentucson's Avatar
Senior Member
Flag tucson
Thanks Meter: 3
 
Donate to Me
More
thank you! this is the main reason i switch some roms lol
29th March 2011, 03:36 AM |#5  
malaeus's Avatar
Senior Member
Thanks Meter: 21
 
More
will this work on other HD2 NAND roms using launcherpro? like using hyperdroid CM7?
29th March 2011, 03:39 AM |#6  
Senior Member
Flag Taiwan
Thanks Meter: 267
 
Donate to Me
More
The source code
If you are a developer of source code maker, the following is my fix for banding issue. (NOT Tytung, i don't know how he fix it )


The source code path :
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp

Function position:
Code:
sp<Layer> SurfaceFlinger::createNormalSurface(
        const sp<Client>& client, DisplayID display,
        uint32_t w, uint32_t h, uint32_t flags,
        PixelFormat& format)
{
    // initialize the surfaces
    switch (format) { // TODO: take h/w into account
    case PIXEL_FORMAT_TRANSPARENT:
    case PIXEL_FORMAT_TRANSLUCENT:
        format = PIXEL_FORMAT_RGBA_8888;
        break;
    case PIXEL_FORMAT_OPAQUE:
        //format = PIXEL_FORMAT_RGBX_8888;
 	format = PIXEL_FORMAT_RGB_565;
        break;
    }

    sp<Layer> layer = new Layer(this, display, client);
    status_t err = layer->setBuffers(w, h, format, flags);
    if (LIKELY(err != NO_ERROR)) {
        LOGE("createNormalSurfaceLocked() failed (%s)", strerror(-err));
        layer.clear();
    }
    return layer;
}
Modified code:
Code:
case PIXEL_FORMAT_OPAQUE:
        //format = PIXEL_FORMAT_RGBX_8888;
 	format = PIXEL_FORMAT_RGB_565;
        break;
Reason:
It is caused by the display driver is not match with HD2. The gingerbread has fix it on driver level with new pixel format RGBX_8888, however it is still not working for HD2. So we have to force the default pixel format into RGB565
Last edited by iamgpc; 29th March 2011 at 05:47 AM.
The Following 6 Users Say Thank You to iamgpc For This Useful Post: [ View ]
29th March 2011, 11:57 AM |#7  
tytung's Avatar
Senior Member
Thanks Meter: 15,079
 
More
Quote:
Originally Posted by iamgpc

If you are a developer of source code maker, the following is my fix for banding issue. (NOT Tytung, i don't know how he fix it )

skip...

I think I need to clarify something.

Gpc sent a private message and asked me how I fixed the color banding issue on 27th March 2011, 09:50 PM.
P.S.: Admin can confirm this.

Because I was busy at that time, I replied his question by only giving him this link including libsurfaceflinger.so.

Then maybe he fixed this issue from the source code by himself, but he really got hints from me.



Let us go back about 20 days ago.

In fact, I tried to solve this color banding issue since 13th March 2011, and I shared my possible method in my thread.
http://forum.xda-developers.com/show...postcount=2487

When I had time, I released a modified/recompiled libsurfaceflinger.so on 21st March 2011, and requested other users to test it.
http://forum.xda-developers.com/show...postcount=2846

Then I included this .so file in my v2.5 ROM.
Gpc saw my change log and sent me a private message, and ...

That's the whole story.
Last edited by tytung; 29th March 2011 at 12:02 PM.
The Following 5 Users Say Thank You to tytung For This Useful Post: [ View ]
29th March 2011, 12:04 PM |#8  
cbanbury's Avatar
Senior Member
Thanks Meter: 8
 
Donate to Me
More
what stops this being implemented throughout the UI (i.e. notification bar, buttons etc)?
29th March 2011, 12:53 PM |#9  
Junior Member
Thanks Meter: 1
 
More
I'm not getting 3g, only EDGE on this ROM. My APN settings are right and data is definitely on so I don't know what the problem is. I have a T-Mobile HD2 and T-Mobile. Please help.
29th March 2011, 01:28 PM |#10  
Senior Member
Flag Paris
Thanks Meter: 22
 
More
Tried this fix, and i am truly impressed! No longer banding using ADW Ex and even XDA App! It does not seem to "fix" only launcher pro to me!

EDIT : copilot still has banding though, but not a big deal given the improvements elsewhere!
Last edited by Blubster; 29th March 2011 at 01:40 PM.
29th March 2011, 03:43 PM |#11  
Senior Member
Flag Taiwan
Thanks Meter: 267
 
Donate to Me
More
Quote:
Originally Posted by tytung

When I had time, I released a modified/recompiled libsurfaceflinger.so on 21st March 2011, and requested other users to test it.
http://forum.xda-developers.com/show...postcount=2846.

humm,

Do you modify the libsurfaceflinger like mine? Do you compile with BOARD_NO_RGBX_8888 := true to fix this isse?

Because my libsurfaceflinger is changed for my personal using. I also modify somewhere else for my testing, so that I cannot use your libsurfaceflinger.

I don't know what you modify in your source code, so I have to find out the root cause.

According to Google search on "android color banding", you can find a JAVA solution on color banding.

http://stuffthathappens.com/blog/201...color-banding/

It says the PixelFormat will take effect on banding issue. Take a look on surfaceflinger source code, you can find out the PixelFormat.OPAQUE and PixelFormat.RGBA_8888 will cause the different result.

Finally, you just have to modify the PixelFormat.OPAQUE from RGBX_8888 to RGB_565
Last edited by iamgpc; 29th March 2011 at 03:49 PM.

Read More
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes