Summary: | [test case] Konqueror sometimes shows gibberish instead of image if using background-image (for small images) | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | jordan.osete |
Component: | khtml renderer | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | zint3301 |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Disable pretiling. |
Description
jordan.osete
2006-05-12 10:15:41 UTC
*** Bug 127444 has been marked as a duplicate of this bug. *** What X11 driver do you use? We have had problems with tiled painting in nvidia chipset (because we unlike everyone else use the tiled painting call, rather than tiling ourself). I'm using radeon xorg driver (9200 chipset) and I see that gibberish. Created attachment 16171 [details]
Disable pretiling.
Yeah. Turned out to be our pre-tiling that breaks. Disabling fixes the bug
Okay.. replacing copyBlt by bitBlt fixes the bug. The question is if copyBlt is broken in Qt 3.3 bitBlt is wrong for images with alpha, you -need- to use copyBlt for them SVN commit 543129 by carewolf: Make sure copyBlt doesn't fail because of different depth. BUG:127189 M +8 -7 loader.cpp --- branches/KDE/3.5/kdelibs/khtml/misc/loader.cpp #543128:543129 @@ -489,7 +489,6 @@ #define BGMINWIDTH 32 #define BGMINHEIGHT 32 - const QPixmap &CachedImage::tiled_pixmap(const QColor& newc) { static QRgb bgTransparent = qRgba( 0, 0, 0, 0xFF ); @@ -511,11 +510,12 @@ QSize s(pixmap_size()); int w = r.width(); int h = r.height(); + assert(s.width() == r.width() && s.height() == s.height()); const QPixmap* src; //source for pretiling, if any //See whether we can - and should - pre-blend if (isvalid && (r.hasAlphaChannel() || r.mask() )) { - bg = new QPixmap(w, h); + bg = new QPixmap(w, h, r.depth()); bg->fill(newc); bitBlt(bg, 0, 0, &r); bgColor = newc.rgb(); @@ -529,15 +529,16 @@ if ( w*h < 8192 ) { if ( r.width() < BGMINWIDTH ) - w = ((BGMINWIDTH / s.width())+1) * s.width(); + w = ((BGMINWIDTH-1) / s.width() + 1) * s.width(); if ( r.height() < BGMINHEIGHT ) - h = ((BGMINHEIGHT / s.height())+1) * s.height(); + h = ((BGMINHEIGHT-1) / s.height() + 1) * s.height(); } - if ( w != r.width() || h != r.height() ) { - QPixmap* oldbg = bg; - bg = new QPixmap(w, h); +// kdDebug() << "pre-tiling " << s.width() << "," << s.height() << " to " << w << "," << h << endl; + QPixmap* oldbg = bg; + bg = new QPixmap(w, h, r.depth()); + //Tile horizontally on the first stripe for (int x = 0; x < w; x += r.width()) copyBlt(bg, x, 0, src, 0, 0, r.width(), r.height()); |