13 #include <qpaintengine.h> 20 return QImage::Format_ARGB32;
22 return QImage::Format_ARGB32_Premultiplied;
26 const QImage& image,
const QVector<QRect> &rects )
28 const int w = image.width();
29 const int h = image.height();
34 for (
int i = 0;
i < rects.size();
i++ )
37 rects[
i].getCoords( &x1, &y1, &x2, &y2 );
40 x2 = qMin( x2, w - 1 );
42 y2 = qMin( y2, h - 1 );
44 for (
int y = y1;
y <= y2; ++
y )
50 reinterpret_cast<const uint *
> ( image.scanLine(
y ) ) + x1;
51 for (
int x = x1;
x <= x2;
x++ )
53 const bool on = ( ( *line++ >> 24 ) != 0 );
58 rect.setCoords( rx0,
y,
x - 1,
y );
72 rect.setCoords( rx0,
y, x2,
y );
73 region = region.united( rect );
119 setAttribute( Qt::WA_TransparentForMouseEvents );
120 setAttribute( Qt::WA_NoSystemBackground );
121 setFocusPolicy( Qt::NoFocus );
125 resize( widget->size() );
126 widget->installEventFilter(
this );
205 if ( hint.isEmpty() )
206 hint += QRect( 0, 0, width(), height() );
217 QPainter painter( &image );
235 if ( mask.isEmpty() )
251 const QRegion clipRegion =
event->region();
253 QPainter painter(
this );
255 bool useRgbaBuffer =
false;
258 useRgbaBuffer =
true;
262 if ( painter.paintEngine()->type() == QPaintEngine::Raster )
263 useRgbaBuffer =
true;
271 QVector<QRect> rects;
272 if ( clipRegion.rects().size() > 2000 )
275 painter.setClipRegion( clipRegion );
276 rects += clipRegion.boundingRect();
280 rects = clipRegion.rects();
283 for (
int i = 0;
i < rects.size();
i++ )
285 const QRect r = rects[
i];
286 painter.drawImage( r.topLeft(), image, r );
291 painter.setClipRegion( clipRegion );
309 QWidget *widget =
const_cast< QWidget *
>( parentWidget() );
312 painter->setClipRect( parentWidget()->contentsRect() );
316 const int idx = widget->metaObject()->indexOfMethod(
"borderPath(QRect)" );
319 QPainterPath clipPath;
321 ( void )QMetaObject::invokeMethod(
322 widget,
"borderPath", Qt::DirectConnection,
323 Q_RETURN_ARG( QPainterPath, clipPath ), Q_ARG( QRect, rect() ) );
325 if (!clipPath.isEmpty())
326 painter->setClipPath( clipPath, Qt::IntersectClip );
369 if (
object == parent() && event->type() == QEvent::Resize )
371 QResizeEvent *
resizeEvent =
static_cast<QResizeEvent *
>( event );
372 resize( resizeEvent->size() );
375 return QObject::eventFilter(
object, event );
static bool isX11GraphicsSystem()
TFSIMD_FORCE_INLINE const tfScalar & y() const
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
TFSIMD_FORCE_INLINE const tfScalar & x() const
TFSIMD_FORCE_INLINE const tfScalar & w() const