Changeset 742
- Timestamp:
- May 31, 2010, 2:32:51 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/painting/qwindowsurface_pm.cpp
r735 r742 255 255 static char *diveFrameBuf = NULL; 256 256 static bool diveHideMouse = false; 257 static FOURCC diveBestBufFormat = 0; 257 258 258 259 static LONG mousePtrSize = 0; … … 294 295 // fourccToFormat(). If isFB is true, the selection is made for the direct 295 296 // framebuffer access mode. 296 static FOURCC fourccScreenToBuffer(FOURCC fourcc, bool isFB = false) 297 { 298 Q_UNUSED(isFB); 299 297 static FOURCC fourccScreenToBuffer(FOURCC fourcc, bool isFB) 298 { 300 299 // return it as is if supported by fourccToFormat() 301 300 if (fourccToFormat(fourcc) != QImage::Format_Invalid) … … 313 312 314 313 // in direct framebuffer access mode, we use BGR4 which should be faster 314 // (note that our color conversion table built in QPMDiveWindowSurface::create() 315 // only works with BGR4 for now so we must return it here otherwise the FB 316 // mode will be disabled) 315 317 return FOURCC_BGR4; 316 318 } … … 361 363 // note that fccSrcColorFormat overrides the value specified during the 362 364 // source buffer creation, so they must match 363 d->setup.fccSrcColorFormat = fourccScreenToBuffer(diveCaps.fccColorEncoding); 365 Q_ASSERT(diveBestBufFormat != 0); 366 d->setup.fccSrcColorFormat = diveBestBufFormat; 364 367 d->setup.fccDstColorFormat = FOURCC_SCRN; 365 368 … … 768 771 << ((char*)&diveCaps.fccColorEncoding)[3]); 769 772 770 FOURCC bestBufFormat = fourccScreenToBuffer(diveCaps.fccColorEncoding); 771 DEBUG(() << "bestBufFormat" 772 << ((char*)&bestBufFormat)[0] 773 << ((char*)&bestBufFormat)[1] 774 << ((char*)&bestBufFormat)[2] 775 << ((char*)&bestBufFormat)[3]); 773 diveBestBufFormat = fourccScreenToBuffer(diveCaps.fccColorEncoding, 774 diveUseFB); 775 DEBUG(() << "diveBestBufFormat" 776 << ((char*)&diveBestBufFormat)[0] 777 << ((char*)&diveBestBufFormat)[1] 778 << ((char*)&diveBestBufFormat)[2] 779 << ((char*)&diveBestBufFormat)[3]); 776 780 777 781 if (diveUseFB) { … … 781 785 diveUseFB = false; 782 786 } else { 783 if ( bestBufFormat == diveCaps.fccColorEncoding) {787 if (diveBestBufFormat == diveCaps.fccColorEncoding) { 784 788 // no color conversion is required 785 } else if ( bestBufFormat == FOURCC_BGR4) {789 } else if (diveBestBufFormat == FOURCC_BGR4) { 786 790 // build the color conversion table 787 791 switch (diveCaps.fccColorEncoding) { … … 831 835 } 832 836 } 837 838 if (!diveUseFB) { 839 // we disabled FB, recalculate the best format 840 diveBestBufFormat = fourccScreenToBuffer(diveCaps.fccColorEncoding, 841 diveUseFB); 842 DEBUG(() << "diveBestBufFormat (final)" 843 << ((char*)&diveBestBufFormat)[0] 844 << ((char*)&diveBestBufFormat)[1] 845 << ((char*)&diveBestBufFormat)[2] 846 << ((char*)&diveBestBufFormat)[3]); 847 } 833 848 } 834 849 835 850 if (!diveUseFB) { 836 FOURCC bestBufFormat = 837 fourccScreenToBuffer(diveCaps.fccColorEncoding); 838 DEBUG(() << "bestBufFormat" 839 << ((char*)&bestBufFormat)[0] 840 << ((char*)&bestBufFormat)[1] 841 << ((char*)&bestBufFormat)[2] 842 << ((char*)&bestBufFormat)[3]); 843 844 if (bestBufFormat == 0) { 851 if (diveBestBufFormat == 0) { 845 852 // there is no working pixel format for the buffer for 846 853 // DiveBlitImage() to work correctly with the current screen
Note:
See TracChangeset
for help on using the changeset viewer.