Post Reply

[Fix] Banding problem fix with launcherPro on widgets.

28th March 2011, 08:20 PM   |  #1  
OP Senior Member
Thanks Meter: 58
 
711 posts
Join Date:Joined: Jan 2010
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, 778 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
 
31 posts
Join Date:Joined: Dec 2010
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: 44
 
651 posts
Join Date:Joined: Jun 2006
More
works on tyween cm7.
29th March 2011, 02:52 AM   |  #4  
mikentucson's Avatar
Senior Member
Flag tucson
Thanks Meter: 2
 
218 posts
Join Date:Joined: Oct 2007
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
 
932 posts
Join Date:Joined: Mar 2009
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
 
137 posts
Join Date:Joined: Sep 2008
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,069
 
3,574 posts
Join Date:Joined: Jun 2010
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  
Senior Member
Thanks Meter: 8
 
141 posts
Join Date:Joined: Dec 2006
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
 
21 posts
Join Date:Joined: Jul 2010
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: 20
 
261 posts
Join Date:Joined: Oct 2007
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.

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

Advanced Search
Display Modes


Top Threads in HD2 Android NAND Development by ThreadRank