diff --git a/scene.h b/scene.h index d16ed95bee..a1a1b684c3 100644 --- a/scene.h +++ b/scene.h @@ -362,7 +362,7 @@ public: /** * @return @c true if the pixmap has been created and is valid, @c false otherwise */ - bool isValid() const; + virtual bool isValid() const; /** * @return The native X11 pixmap handle */ diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 0118999bf6..c8ce5db210 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1740,6 +1740,14 @@ WindowPixmap *OpenGLWindowPixmap::createChild(const QPointerisNull()) { + return true; + } + return WindowPixmap::isValid(); +} + //**************************************** // SceneOpenGL::EffectFrame //**************************************** diff --git a/scene_opengl.h b/scene_opengl.h index 716203839d..1fe20912c0 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -275,6 +275,7 @@ public: virtual ~OpenGLWindowPixmap(); SceneOpenGL::Texture *texture() const; bool bind(); + bool isValid() const override; protected: WindowPixmap *createChild(const QPointer &subSurface) override; private: diff --git a/scene_qpainter.cpp b/scene_qpainter.cpp index ae55b62088..feccf6223d 100644 --- a/scene_qpainter.cpp +++ b/scene_qpainter.cpp @@ -490,6 +490,14 @@ void QPainterWindowPixmap::updateBuffer() } } +bool QPainterWindowPixmap::isValid() const +{ + if (!m_image.isNull()) { + return true; + } + return WindowPixmap::isValid(); +} + QPainterEffectFrame::QPainterEffectFrame(EffectFrameImpl *frame, SceneQPainter *scene) : Scene::EffectFrame(frame) , m_scene(scene) diff --git a/scene_qpainter.h b/scene_qpainter.h index 439e790743..0c82bc15d7 100644 --- a/scene_qpainter.h +++ b/scene_qpainter.h @@ -163,6 +163,7 @@ public: explicit QPainterWindowPixmap(Scene::Window *window); virtual ~QPainterWindowPixmap(); virtual void create() override; + bool isValid() const override; void updateBuffer() override; const QImage &image();