summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'origin/4.5'Oswald Buddenhagen2009-07-201-1/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp src/3rdparty/webkit/WebCore/page/DOMWindow.idl src/corelib/io/qdiriterator.cpp src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h tests/auto/qxmlquery/tst_qxmlquery.cpp tools/linguist/lconvert/main.cpp
| * Clean up directfb bit flippingAnders Bakken2009-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | DirectFB declares variables that are bit fields as enums. E.g. DFBSurfaceCapabilities caps; caps |= DSCAPS_LOCK; // doesn't compile in C++ Work around this problem by declaring operators for these operations. This greatly improves the readability of the code. Reviewed-by: TrustMe
| * Fix QDirectFBPixmap::toImageAnders Bakken2009-07-131-0/+5
| | | | | | | | | | | | | | | | | | | | Preallocated surfaces can currently be copied to video memory behind our back. This means that we can not use this mechanism for toImage() In later versions of DirectFB this might be possible to toggle with a flag so I'll leave the code in there #if 0'ed Reviewed-by: Donald <qt-info@nokia.com>
* | Merge branch '4.5'Thiago Macieira2009-06-251-2/+3
|\ \ | |/ | | | | | | | | Conflicts: src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
| * Fix a rendering issueAnders Bakken2009-06-241-3/+3
| | | | | | | | | | | | Make sure surfaces always are locked when used as source for something. Reviewed-by: TrustMe
* | Make sure to update is_null in copy/transformedAnders Bakken2009-06-221-0/+3
| | | | | | | | Reviewed-by: TrustMe
* | Fix a couple of issues after QPixmapData optimsAnders Bakken2009-06-181-10/+15
| | | | | | | | | | | | | | | | Make sure we always set w, h and d. See fa8030a935acaacee570eee320e7510a4cfdc853 Reviewed-by: TrustMe
* | Speed up QPixmap::width(), height(), isNull() and depth().Andreas Aardal Hanssen2009-06-171-0/+8
|/ | | | | | | | | | | | | | | | This change moves the w, h, d variables to QPixmapData and introduces is_null to keep track of nullness. This is possible only because QPixmapData is internal API; otherwise we'd have to be smarter. The optimization makes the QPixmap::width() function take 7 instructions, down from 34 before. For the calculator demo in the declarative ui branch this reduces a block of 750000 instructions (out of 30000000) to around 100000-150000 instructions. Tested on Windows, Linux, Mac. Raster, X11 and OpenGL paint engines. Have not tested the DirectFB engine. Reviewed-by: Trond
* Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
| | | | Reviewed-by: Trust Me
* Make the directfb plugin compile against 0.9Anders Bakken2009-06-081-1/+6
| | | | | | | | | | Not sure to what extent it actually works but atleast it compiles now. - A couple of image formats doesn't exist in 0.9 - IDirectFBSurface::ReleaseSource doesn't exist in 0.9 - IDirectFBWindow::SetBounds doesn't exist in 0.9 Reviewed-by: Donald <qt-info@nokia.com>
* Make sure to retain alpha information in copyAnders Bakken2009-06-041-3/+4
| | | | | | We need to set alpha to the right value when copying pixmaps. Reviewed-by: Donald <qt-info@nokia.com>
* Remove all force raster on RGB32 stuffAnders Bakken2009-05-281-22/+1
| | | | | | | | | Previously we allowed RGB32 but forced fallbacks for all drawing operations. It turns out blitting operations doesn't work right either so we'll rather just disallow this format altogether. See also 36ae58e7a6a888d3ae7bd162d59daada550bbfb1 Reviewed-by: Donald <qt-info@nokia.com>
* Fix a type in warningAnders Bakken2009-05-111-1/+1
| | | | | | QDirecttFBPixmapData => QDirectFBPixmapData Reviewed-by: TrustMe
* Refactored image cachingAnders Bakken2009-05-051-1/+11
| | | | | | | | | | | Make image caching a lot cleaner and more sensible. By default we do not cache images since creating a preallocated surface is quick and we don't really want to waste memory. In the case where the driver does not support preallocated surfaces you can enable image caching to speed up drawImage. Reviewed-by: TrustMe
* Lock for read only when possibleAnders Bakken2009-05-041-3/+9
| | | | | | | | | | From benchmarking I've established that surface->Lock(DSLF_READ) is faster than surface->Lock(DSLF_WRITE) which is faster than surface->Lock(DSLF_READ|DSLF_WRITE). This patch will make us Lock for read only, when possible. Reviewed-by: Donald <qt-info@nokia.com>
* Convert bitmaps to alpha pixmap formatAnders Bakken2009-04-221-2/+2
| | | | | | | | Ideally we'd let raster pixmap data handle this but QPixmap::fromImage creates a QPixmapData::PixmapType regardless of the bit depth of the image so we have to handle this case. Reviewed-by: Donald <qt-info@nokia.com>
* Kill some warningsAnders Bakken2009-04-221-0/+3
| | | | | | | Refactor two small things so that we don't get warnings when QT_DIRECTFB_NO_(OPAQUEDETECTION|MOUSE|KEYBOARD) is defined Reviewed-by: Shane McLaughlin <Shane.McLaughlin@trolltech.com>
* Unify IDirectFBSurface->Lock() callsAnders Bakken2009-04-221-9/+10
| | | | | | | | | | | | | | | | Certain compilers warns on this kind of code: uchar *mem = ...; (void**)(&mem) dereferencing type punned pointer etc. Since we had this for every call to Lock I put it all into a convenience function. Also fix some issues where we memcpy'ed more bytes than necessary (when stride != w * depth() / 8) and fix issue with QDirectFBScreen::solidFill with pixelFormat == RGB32 Reviewed-by: Donald <qt-info@nokia.com>
* Inline hasAlphaChannel and add pixelFormat getterAnders Bakken2009-04-091-5/+0
| | | | Reviewed-by: TrustMe
* Be smarter about alpha formatsAnders Bakken2009-04-091-32/+129
| | | | | | | | | Try harder to prevent blends by explicitly checking for alpha pixels in the source image (unless asked not to). Can be defined out by #defining QT_NO_DIRECTFB_OPAQUE_DETECTION Reviewed-by: Donald <qt-info@nokia.com>
* Make sure to clear surface in toImageAnders Bakken2009-04-071-1/+6
| | | | | | | It seems DirectFB doesn't preserve alpha value of a blit unless BLEND is specified and if it is we need to Clear to transparent first. Reviewed-by: TrustMe
* Code cleanup.Anders Bakken2009-04-071-5/+5
| | | | | | QDirectFBPaintDevice's know their screen. No need to use instance() in these cases. Reviewed-by: TrustMe
* Call ReleaseSource where appropriateAnders Bakken2009-04-071-0/+2
| | | | | | | | DirectFB caches the last source surface in the target surface after a Blit. This can cause a surface to be kept around longer than desired since the caching increases the ref-count. Unless it's likely that the blit will happen again soon we Release the source. Reviewed-by: TrustMe
* Better QDirectFBPixmapData::toImage()Anders Bakken2009-04-071-0/+11
| | | | | | | | | This is essentially a return to the earlier version of toImage(). Use a preallocated surface that operates on the returned image to do the conversion. If this causes drawing bugs it is likely a bug in the directfb driver and can be worked around by compiling with QT_NO_DIRECTFB_PREALLOCATED. Reviewed-by: TrustMe
* Make sure to set blitting flagsAnders Bakken2009-04-071-20/+3
| | | | | | | | | Need to set blitting flags before blitting from a surface with alpha channel. Otherwise alpha areas become white. For some reason setting the porterduff to DSPD_SRC does not fix this. Reviewed-by: TrustMe
* Improve QDirectFBPixmapData::copyAnders Bakken2009-04-071-2/+8
| | | | | | Make sure we retain the alpha channel of the original surface. Reviewed-by: TrustMe
* Improve QDirectFBPixmapData::transformedAnders Bakken2009-04-071-5/+14
| | | | | | Make sure we keep retain alpha if there is one in the source. Reviewed-by: TrustMe
* Clean up surface creation codeAnders Bakken2009-04-071-9/+5
| | | | | | Use the intended functions for surface creation. Reviewed-by: TrustMe
* Rename functionAnders Bakken2009-03-301-1/+1
| | | | | Everything else capitalizes both the F and the B. s/Fb/FB/g Reviewed-by: TrustMe
* Work around raster engine not ignoring the pad byte in RGB32Anders Bakken2009-03-301-25/+34
| | | | | | | | | | | | | DirectFB sets the alpha byte to 0 in RGB32 for all drawing operations. The raster paint engine needs this padding byte to be 0xFF as it shares some code paths with RGBA8888_Premultiplied. So, always fall back to raster engine for draw operations. This is really due to a bug in the raster paint engine (Tracked by task 184073), which should ignore the extra byte. Once this task is fixed, this patch can probably be reverted. Reviewed-by: Tom Cooksey
* Major surface related fixAnders Bakken2009-03-271-134/+37
| | | | | | | | | | | | | Make sure all QDirectFBPaintDevice surfaces always are created with a format that is either QScreen::pixelFormat() or QDirectFBScreen::alphaPixmapFormat(). Also, clean up surface creation by providing more high level functions. Fix a bug where we would assume that ARGB means Format_ARGB32_Premultiplied and not Format_ARGB32. Reviewed-by: Tom Cooksey
* Long live Qt 4.5!Lars Knoll2009-03-231-0/+363