Changeset 58685 in vbox
- Timestamp:
- Nov 13, 2015 11:08:08 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r58683 r58685 1715 1715 /* Create a ARGB image out of the shape data. */ 1716 1716 QImage image (uWidth, uHeight, QImage::Format_ARGB32); 1717 const uint8_t* pbSrcMask = static_cast<const uint8_t*> (srcAndMaskPtr); 1718 unsigned cbSrcMaskLine = RT_ALIGN (uWidth, 8) / 8; 1719 for (unsigned int y = 0; y < uHeight; ++y) 1720 { 1721 for (unsigned int x = 0; x < uWidth; ++x) 1722 { 1723 unsigned int color = ((unsigned int*)srcShapePtr)[y*uWidth+x]; 1724 /* If the alpha channel isn't in the shape data, we have to 1725 * create them from the and-mask. This is a bit field where 1 1726 * represent transparency & 0 opaque respectively. */ 1727 if (!fHasAlpha) 1728 { 1729 if (!(pbSrcMask[x / 8] & (1 << (7 - (x % 8))))) 1730 color |= 0xff000000; 1731 else 1732 { 1733 /* This isn't quite right, but it's the best we can do I think... */ 1734 if (color & 0x00ffffff) 1735 color = 0xff000000; 1736 else 1737 color = 0x00000000; 1738 } 1739 } 1740 image.setPixel (x, y, color); 1741 } 1742 /* Move one scanline forward. */ 1743 pbSrcMask += cbSrcMaskLine; 1717 1718 if (fHasAlpha) 1719 { 1720 memcpy(image.bits(), srcShapePtr, uHeight * uWidth * 4); 1721 } 1722 else 1723 { 1724 renderCursorPixels((uint32_t *)srcShapePtr, srcAndMaskPtr, 1725 uWidth, uHeight, 1726 (uint32_t *)image.bits(), uHeight * uWidth * 4); 1744 1727 } 1745 1728
Note:
See TracChangeset
for help on using the changeset viewer.