src/gui/painting/qmemrotate.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   570 #ifdef QT_QWS_DEPTH_GENERIC
   570 #ifdef QT_QWS_DEPTH_GENERIC
   571 QT_IMPL_MEMROTATE(quint32, qrgb_generic16)
   571 QT_IMPL_MEMROTATE(quint32, qrgb_generic16)
   572 QT_IMPL_MEMROTATE(quint16, qrgb_generic16)
   572 QT_IMPL_MEMROTATE(quint16, qrgb_generic16)
   573 #endif
   573 #endif
   574 
   574 
       
   575 struct qrgb_gl_rgba
       
   576 {
       
   577 public:
       
   578     inline qrgb_gl_rgba(quint32 v) {
       
   579         if (QSysInfo::ByteOrder == QSysInfo::LittleEndian)
       
   580             data = ((v << 16) & 0xff0000) | ((v >> 16) & 0xff) | (v & 0xff00ff00);
       
   581         else
       
   582             data = (v << 8) | ((v >> 24) & 0xff);
       
   583     }
       
   584 
       
   585     inline operator quint32() const { return data; }
       
   586 
       
   587 private:
       
   588     quint32 data;
       
   589 } Q_PACKED;
       
   590 
       
   591 void Q_GUI_EXPORT qt_memrotate90_gl(const quint32 *src, int srcWidth, int srcHeight, int srcStride,
       
   592                                     quint32 *dest, int dstStride)
       
   593 {
       
   594     qt_memrotate90_template(src, srcWidth, srcHeight, srcStride, reinterpret_cast<qrgb_gl_rgba *>(dest), dstStride);
       
   595 }
   575 
   596 
   576 QT_END_NAMESPACE
   597 QT_END_NAMESPACE