Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Wed Mar 26, 2008 10:20 am 
Offline

Joined: Sat Jul 07, 2007 5:39 pm
Posts: 11
Location: The Netherlands, Dordrecht
How can I submit code? :oops:


Last edited by vdkamp on Wed Mar 26, 2008 10:44 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 26, 2008 10:38 am 
Offline

Joined: Sat Jul 07, 2007 5:39 pm
Posts: 11
Location: The Netherlands, Dordrecht
This time [x] Disable HTML in this post

Change in file:
src/gui/embedded/qscreenlinuxfb_qws.cpp
Replace in function:
Code:
void QLinuxFbScreen::setPixelFormat(struct fb_var_screeninfo info)...

the code in state 16:
Code:
    case 16: {
        //const fb_bitfield rgb565[4] = {{11, 5, 0}, {5, 6, 0},
        //                               {0, 5, 0}, {0, 0, 0}};
        //if (memcmp(rgba, rgb565, 3 * sizeof(fb_bitfield)) == 0)
        const fb_bitfield bgr555[4] = {{0, 5, 0}, {5, 5, 0},
                                       {10, 5, 0}, {0, 0, 0}};
        if (memcmp(rgba, bgr555, 3 * sizeof(fb_bitfield)) == 0)

            format = QImage::Format_RGB16;
        break;
    }


Change in file:
src/gui/embedded/qscreen_qws.cpp
Directly after
Code:
// #define QT_USE_MEMCPY_DUFF

Add:
Code:
#define QWS_ORDER_BGR   1

Replace template:
Code:
solidFill_template

with:
Code:
template <typename DST, typename SRC> // BGR patch: SRC added
static void solidFill_template(QScreen *screen, const QColor &color,
                               const QRegion &region)
{
    DST *dest = reinterpret_cast<DST*>(screen->base());
    const DST c = qt_colorConvert<DST, SRC>(color.rgba(), 0);
    const int stride = screen->linestep();
    const QVector<QRect> rects = region.rects();

    for (int i = 0; i < rects.size(); ++i) {
        const QRect r = rects.at(i);
        qt_rectfill(dest, c, r.x(), r.y(), r.width(), r.height(), stride);
    }
}

Change in function
Code:
qt_solidFill_setup

in state 16:
Code:
    case 16:
#if QWS_ORDER_BGR == 0
        screen->d_ptr->solidFill = solidFill_template<quint16, quint32>;
#else // BGR
        screen->d_ptr->solidFill = solidFill_template<quint16, quint16>;
#endif
        break;

Change in function:
Code:
blit_16

State:
Code:
    case QImage::Format_RGB16:

#if QWS_ORDER_BGR == 0
        blit_template<quint16, quint16>(screen, image, topLeft, region);
#else  // BGR
        blit_template<quint16, quint16>(screen, image, topLeft, region);
#endif
        return;


Change in file
src/gui/painting/qdrawhelper_p.h
After function
Code:
template <>
inline quint16 qt_colorConvert(quint32 color, quint16 dummy) {...}

add new function:
Code:
// original Qtopia:
// RGB 565
// RRRR RGGG GGGB BBBB
//
// BGR display needs:
// BGR 555
// aBBB BBGG GGGR RRRR
template <>
inline quint16 qt_colorConvert(quint16 color, quint16 dummy) // input is RGB565
{
    Q_UNUSED(dummy);
    const int r = color >> 11; // shift red part (6green + 5blue bits)
    const int g = color >> 1; // shift green part (green will be 5 bits instead of 6)
    const int b = color << 10; // shift blue part (5red + 5green bits)

    return (b & 0x7C00) | (g & 0x03e0)| (r & 0x001f); // mask the colors, output is BGR555
}


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 28, 2008 11:59 am 
Offline

Joined: Sun Jan 27, 2008 7:12 pm
Posts: 6
Location: Singapore
Wow thanks very much, I'm going to try this first, I'll let you know once it is successful :)

Regards,

fyanardi :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 08, 2008 10:32 am 
Offline

Joined: Sat Jul 07, 2007 5:39 pm
Posts: 11
Location: The Netherlands, Dordrecht
I tried to speed-up the display.
I noticed that
export QT_ONSCREEN_PAINT=1 (on the target)
is not working! Because then my patch code is skipped.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: