Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,812,957 Members 54,612 Now Online
XDA Developers Android and Mobile Development Forum

[Fix] Banding problem fix with launcherPro on widgets.

Tip us?
 
hg3atintin
Old
(Last edited by hg3atintin; 29th March 2011 at 07:20 AM.)
#1  
Senior Member - OP
Thanks Meter 58
Posts: 711
Join Date: Jan 2010
Default [Fix] Banding problem fix with launcherPro on widgets.

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)
The Following 7 Users Say Thank You to hg3atintin For This Useful Post: [ Click to Expand ]
 
mydoooom
Old
#2  
mydoooom's Avatar
Member
Thanks Meter 1
Posts: 31
Join Date: Dec 2010
Location: Prague
Thank God, at last! Great stuff
Current device: HTC HD2 “Leo” (T8585) | ROM: TyphooN CyanogenMod 7 RC4+ v3.0.0 | HSPL: 2.08 | Radio ROM: 2.15.50.14 | MAGLDR version 1.13 | Memory card: ADATA microSDHC 16 GB, Class 10



Rather ask a question and be stupid for a moment than be stupid forever.
 
SH4YD33
Old
#3  
SH4YD33's Avatar
Senior Member
Thanks Meter 44
Posts: 651
Join Date: Jun 2006
Location: The Bay, CA
works on tyween cm7.
 
mikentucson
Old
#4  
mikentucson's Avatar
Senior Member
Thanks Meter 2
Posts: 218
Join Date: Oct 2007
Location: tucson

 
DONATE TO ME
thank you! this is the main reason i switch some roms lol
 
malaeus
Old
#5  
malaeus's Avatar
Senior Member
Thanks Meter 21
Posts: 932
Join Date: Mar 2009
will this work on other HD2 NAND roms using launcherpro? like using hyperdroid CM7?
T-Mobile Galaxy S5 (White with gunmetal spigen tough armor + spigen glas.tr)
Stock Non-Rooted. (my first ever non-root android device) [Thank you Helium!]

8GB Nexus 7 Google Stock 4.4.2

32GB Asus Transformer Infinity [TF700t KitKat 4.4.2][CROMBi-kk]
 
iamgpc
Old
(Last edited by iamgpc; 29th March 2011 at 05:47 AM.)
#6  
Senior Member
Thanks Meter 267
Posts: 137
Join Date: Sep 2008
Location: Taiwan

 
DONATE TO ME
Default 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
The Following 6 Users Say Thank You to iamgpc For This Useful Post: [ Click to Expand ]
 
tytung
Old
(Last edited by tytung; 29th March 2011 at 12:02 PM.)
#7  
tytung's Avatar
Senior Member
Thanks Meter 15,069
Posts: 3,574
Join Date: Jun 2010
Quote:
Originally Posted by iamgpc View Post
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.
The Following 5 Users Say Thank You to tytung For This Useful Post: [ Click to Expand ]
 
cbanbury
Old
#8  
Senior Member
Thanks Meter 8
Posts: 141
Join Date: Dec 2006

 
DONATE TO ME
what stops this being implemented throughout the UI (i.e. notification bar, buttons etc)?
 
Imaginary Enemy
Old
#9  
Junior Member
Thanks Meter 1
Posts: 21
Join Date: 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.
 
Blubster
Old
(Last edited by Blubster; 29th March 2011 at 01:40 PM.)
#10  
Senior Member
Thanks Meter 20
Posts: 261
Join Date: Oct 2007
Location: Paris
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!
HTC HD2 : sold!

HTC Sensation : sold

HTC One X : CM10.1 RC1

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes