Update the RGB color and gray color when setting ARGB.

Fixes colors on the first two screens of a sample app.

On Sep 19, 2014, at 11:44 AM, Brendan Dahl <notifications@github.com> wrote:

> In midp/gfx.js:
> 
> >          g.class.getField("pixel", "I").set(g, swapRB(rgba));
> > +        g.class.getField("rgbColor", "I").set(g, rgba & 0x00ffffff);
> > +        g.class.getField("gray", "I").set(g, (red * 76 + green * 150 + blue * 29) >> 8);
> Yes, I'm actually trying to figure out how to call back in to java code from native so I can call grayVal() in Graphics.java. Or I suppose I could move grayVal() to native. Do you know of any examples of calling back into the java code?
> 
> 

I don’t recommend calling the interpreter that. It really fucks up de-scheduling of a thread. The right way to do it would be to inject a synthesized java stack that does this. Search or “synthethic”. You can basically synthesize a call to grayVal() and the sets.

Andreas
> —
> Reply to this email directly or view it on GitHub.
>