src/gui/embedded/qscreen_qws.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
child 7 f7bc934e204c
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   598 {
   598 {
   599     DST *dest = reinterpret_cast<DST*>(screen->base());
   599     DST *dest = reinterpret_cast<DST*>(screen->base());
   600     const int screenStride = screen->linestep();
   600     const int screenStride = screen->linestep();
   601     const int imageStride = image.bytesPerLine();
   601     const int imageStride = image.bytesPerLine();
   602 
   602 
   603     if (region.numRects() == 1) {
   603     if (region.rectCount() == 1) {
   604         const QRect r = region.boundingRect();
   604         const QRect r = region.boundingRect();
   605         const SRC *src = reinterpret_cast<const SRC*>(image.scanLine(r.y()))
   605         const SRC *src = reinterpret_cast<const SRC*>(image.scanLine(r.y()))
   606                          + r.x();
   606                          + r.x();
   607         qt_rectconvert<DST, SRC>(dest, src,
   607         qt_rectconvert<DST, SRC>(dest, src,
   608                                  r.x() + topLeft.x(), r.y() + topLeft.y(),
   608                                  r.x() + topLeft.x(), r.y() + topLeft.y(),
  1383 
  1383 
  1384     \section1 Palette Management
  1384     \section1 Palette Management
  1385 
  1385 
  1386     QScreen provides several functions to retrieve information about
  1386     QScreen provides several functions to retrieve information about
  1387     the color palette: The clut() function returns a pointer to the
  1387     the color palette: The clut() function returns a pointer to the
  1388     color lookup table (i.e. its color palette). Use the numCols()
  1388     color lookup table (i.e. its color palette). Use the colorCount()
  1389     function to determine the number of entries in this table, and the
  1389     function to determine the number of entries in this table, and the
  1390     alloc() function to retrieve the palette index of the color that
  1390     alloc() function to retrieve the palette index of the color that
  1391     is the closest match to a given RGB value.
  1391     is the closest match to a given RGB value.
  1392 
  1392 
  1393     To determine if the screen driver supports a given color depth,
  1393     To determine if the screen driver supports a given color depth,
  1996 
  1996 
  1997     Note that this function only apply in paletted modes like 8-bit,
  1997     Note that this function only apply in paletted modes like 8-bit,
  1998     i.e. in modes where only the palette indexes (and not the actual
  1998     i.e. in modes where only the palette indexes (and not the actual
  1999     color values) are stored in memory.
  1999     color values) are stored in memory.
  2000 
  2000 
  2001     \sa alloc(), depth(), numCols()
  2001     \sa alloc(), depth(), colorCount()
  2002 */
  2002 */
  2003 
  2003 
  2004 /*!
  2004 /*!
       
  2005     \obsolete
  2005     \fn int QScreen::numCols()
  2006     \fn int QScreen::numCols()
       
  2007 
       
  2008     \sa colorCount()
       
  2009 */
       
  2010 
       
  2011 /*!
       
  2012     \since 4.6
       
  2013     \fn int QScreen::colorCount()
  2006 
  2014 
  2007     Returns the number of entries in the screen's color lookup table
  2015     Returns the number of entries in the screen's color lookup table
  2008     (i.e. its color palette). A pointer to the color table can be
  2016     (i.e. its color palette). A pointer to the color table can be
  2009     retrieved using the clut() function.
  2017     retrieved using the clut() function.
  2010 
  2018 
  2101 
  2109 
  2102     Note that this function only apply in paletted modes like 8-bit,
  2110     Note that this function only apply in paletted modes like 8-bit,
  2103     i.e. in modes where only the palette indexes (and not the actual
  2111     i.e. in modes where only the palette indexes (and not the actual
  2104     color values) are stored in memory.
  2112     color values) are stored in memory.
  2105 
  2113 
  2106     \sa clut(), numCols()
  2114     \sa clut(), colorCount()
  2107 */
  2115 */
  2108 
  2116 
  2109 int QScreen::alloc(unsigned int r,unsigned int g,unsigned int b)
  2117 int QScreen::alloc(unsigned int r,unsigned int g,unsigned int b)
  2110 {
  2118 {
  2111     int ret = 0;
  2119     int ret = 0;
  2453 #endif // QT_NO_QWS_CURSOR
  2461 #endif // QT_NO_QWS_CURSOR
  2454         blit(*blendBuffer, offset, blendRegion);
  2462         blit(*blendBuffer, offset, blendRegion);
  2455         delete blendBuffer;
  2463         delete blendBuffer;
  2456     }
  2464     }
  2457 
  2465 
  2458     if (r.numRects() == 1) {
  2466     if (r.rectCount() == 1) {
  2459         setDirty(r.boundingRect());
  2467         setDirty(r.boundingRect());
  2460     } else {
  2468     } else {
  2461         const QVector<QRect> rects = r.rects();
  2469         const QVector<QRect> rects = r.rects();
  2462         for (int i = 0; i < rects.size(); ++i)
  2470         for (int i = 0; i < rects.size(); ++i)
  2463             setDirty(rects.at(i));
  2471             setDirty(rects.at(i));