OSDN Git Service

remove unused QWindowSurface::buffer() method
authorIvailo Monev <xakepa10@gmail.com>
Sun, 30 Jan 2022 05:09:51 +0000 (07:09 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 30 Jan 2022 05:09:51 +0000 (07:09 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/painting/qwindowsurface.cpp
src/gui/painting/qwindowsurface_p.h

index eb301c1..956bb4a 100644 (file)
@@ -38,7 +38,6 @@ public:
     QWidget *window;
     QRect geometry;
     QRegion staticContents;
-    QList<QImage*> bufferImages;
 };
 
 /*!
@@ -119,8 +118,6 @@ QWidget* QWindowSurface::window() const
 void QWindowSurface::endPaint(const QRegion &)
 {
 //     QApplication::syncX();
-    qDeleteAll(d_ptr->bufferImages);
-    d_ptr->bufferImages.clear();
 }
 
 /*!
@@ -154,37 +151,6 @@ QRect QWindowSurface::geometry() const
 */
 
 /*!
-    Returns a QImage pointer which represents the actual buffer the \a widget
-    is drawn into or null if this is unavailable.
-
-    You must call beginPaint() before you call this function and the returned
-    pointer is only valid until endPaint() is called.
-*/
-QImage* QWindowSurface::buffer(const QWidget *widget)
-{
-    if (widget->window() != window())
-        return nullptr;
-
-    QPaintDevice *pdev = paintDevice();
-    if (!pdev || pdev->devType() != QInternal::Image)
-        return nullptr;
-
-    const QPoint off = offset(widget);
-    QImage *img = static_cast<QImage*>(pdev);
-
-    QRect rect(off, widget->size());
-    rect &= QRect(QPoint(), img->size());
-
-    if (rect.isEmpty())
-        return nullptr;
-
-    img = new QImage(img->copy(rect));
-    d_ptr->bufferImages.append(img);
-
-    return img;
-}
-
-/*!
   Returns the offset of \a widget in the coordinates of this
   window surface.
  */
index 0d4b5d5..a0c9761 100644 (file)
@@ -67,8 +67,6 @@ public:
     virtual void beginPaint(const QRegion &) = 0;
     void endPaint(const QRegion &);
 
-    QImage* buffer(const QWidget *widget);
-
     QPoint offset(const QWidget *widget) const;
     inline QRect rect(const QWidget *widget) const;