diff --git a/composite.cpp b/composite.cpp index f5de2fb66d..efdae700ef 100644 --- a/composite.cpp +++ b/composite.cpp @@ -381,15 +381,9 @@ void Compositor::fallbackToXRenderCompositing() finish(); KConfigGroup config(KGlobal::config(), "Compositing"); config.writeEntry("Backend", "XRender"); - config.writeEntry("GraphicsSystem", "native"); config.sync(); - if (Extensions::nonNativePixmaps()) { // must restart to change the graphicssystem - restartKWin("automatic graphicssystem change for XRender backend"); - return; - } else { - options->setCompositingMode(XRenderCompositing); - setup(); - } + options->setCompositingMode(XRenderCompositing); + setup(); } void Compositor::slotConfigChanged() @@ -407,12 +401,6 @@ void Compositor::slotReinitialize() { // Reparse config. Config options will be reloaded by setup() KGlobal::config()->reparseConfiguration(); - const QString graphicsSystem = KConfigGroup(KGlobal::config(), "Compositing").readEntry("GraphicsSystem", ""); - if ((Extensions::nonNativePixmaps() && graphicsSystem == "native") || - (!Extensions::nonNativePixmaps() && (graphicsSystem == "raster" || graphicsSystem == "opengl")) ) { - restartKWin("explicitly reconfigured graphicsSystem change"); - return; - } // Restart compositing finish(); diff --git a/libkwineffects/kwinglobals.cpp b/libkwineffects/kwinglobals.cpp index 6b8cf43dc5..7d09084c5d 100644 --- a/libkwineffects/kwinglobals.cpp +++ b/libkwineffects/kwinglobals.cpp @@ -20,10 +20,6 @@ along with this program. If not, see . #include "kwinglobals.h" -#include -#include -#include - #include #include @@ -42,8 +38,6 @@ along with this program. If not, see . namespace KWin { -bool Extensions::non_native_pixmaps = false; - void Extensions::init() { static bool initPerformed = false; @@ -58,12 +52,6 @@ void Extensions::init() #ifdef HAVE_XSYNC XSyncQueryExtension(display(), &event_base, &error_base); #endif - - QPixmap pix(1,1); - QPainter p(&pix); - non_native_pixmaps = p.paintEngine()->type() != QPaintEngine::X11; - p.end(); - kDebug(1212) << " non_native_pixmaps: " << non_native_pixmaps << endl; initPerformed = true; } diff --git a/libkwineffects/kwinglobals.h b/libkwineffects/kwinglobals.h index 67922804ac..5b2545b779 100644 --- a/libkwineffects/kwinglobals.h +++ b/libkwineffects/kwinglobals.h @@ -189,11 +189,6 @@ class KWIN_EXPORT Extensions { public: static void init(); - static bool nonNativePixmaps() { - return non_native_pixmaps; - } -private: - static bool non_native_pixmaps; }; } // namespace diff --git a/libkwineffects/kwinxrenderutils.cpp b/libkwineffects/kwinxrenderutils.cpp index 85f0d0fd22..dae3d7a191 100644 --- a/libkwineffects/kwinxrenderutils.cpp +++ b/libkwineffects/kwinxrenderutils.cpp @@ -109,10 +109,6 @@ static xcb_render_picture_t createPicture(xcb_pixmap_t pix, int depth) XRenderPicture::XRenderPicture(const QPixmap &pix) { - if (!Extensions::nonNativePixmaps()) { - d = new XRenderPictureData(createPicture(pix.handle(), pix.depth())); - return; - } QImage img(pix.toImage()); const int depth = img.depth(); xcb_pixmap_t xpix = xcb_generate_id(connection()); diff --git a/main.cpp b/main.cpp index 6786145023..f55b6966a3 100644 --- a/main.cpp +++ b/main.cpp @@ -469,22 +469,6 @@ KDE_EXPORT int kdemain(int argc, char * argv[]) mallopt(M_TRIM_THRESHOLD, 5*pagesize); #endif // M_TRIM_THRESHOLD - // the raster graphicssystem has a quite terrible performance on the XRender backend or when not - // compositing at all while some to many decorations suffer from bad performance of the native - // graphicssystem (lack of implementation, QGradient internally uses the raster system and - // XPutImage's the result because some graphics drivers have insufficient or bad performing - // implementations of XRenderCreate*Gradient) - // - // Therefore we allow configurationa and do some automagic selection to discourage - // ""known to be stupid" ideas ;-P - // The invalid system parameter "" will use the systems default graphicssystem - // "!= XRender" is intended since eg. pot. SW backends likely would profit from raster as well - KConfigGroup config(KSharedConfig::openConfig(KWIN_CONFIG), "Compositing"); - QString preferredSystem("native"); - if (config.readEntry("Enabled", true) && config.readEntry("Backend", "OpenGL") != "XRender") - preferredSystem = ""; - QApplication::setGraphicsSystem(config.readEntry("GraphicsSystem", preferredSystem)); - Display* dpy = XOpenDisplay(NULL); if (!dpy) { fprintf(stderr, "%s: FATAL ERROR while trying to open display %s\n", diff --git a/paintredirector.cpp b/paintredirector.cpp index c021549c74..7dfe7a3ed2 100644 --- a/paintredirector.cpp +++ b/paintredirector.cpp @@ -44,9 +44,6 @@ PaintRedirector *PaintRedirector::create(Client *c, QWidget *widget) if (effects->isOpenGLCompositing()) { return new OpenGLPaintRedirector(c, widget); } else { - if (!Extensions::nonNativePixmaps()) { - return new NativeXRenderPaintRedirector(c, widget); - } return new RasterXRenderPaintRedirector(c, widget); } } @@ -483,60 +480,6 @@ void RasterXRenderPaintRedirector::paint(PaintRedirector::DecorationPixmap borde img.width(), img.height(), offset.x(), offset.y(), 0, 32, img.byteCount(), img.constBits()); } -NativeXRenderPaintRedirector::NativeXRenderPaintRedirector(Client *c, QWidget *widget) - : PaintRedirector(c, widget) -{ - resizePixmaps(); -} - -NativeXRenderPaintRedirector::~NativeXRenderPaintRedirector() -{ -} - -xcb_render_picture_t NativeXRenderPaintRedirector::picture(PaintRedirector::DecorationPixmap border) const -{ - return m_pixmaps[border].x11PictureHandle(); -} - -void NativeXRenderPaintRedirector::resize(PaintRedirector::DecorationPixmap border, const QSize &size) -{ - if (m_pixmaps[border].size() != size) { - m_pixmaps[border] = QPixmap(size); - } - m_pixmaps[border].fill(Qt::transparent); -} - -void NativeXRenderPaintRedirector::paint(PaintRedirector::DecorationPixmap border, const QRect &r, const QRect &b, const QRegion ®) -{ - QPainter pt(&m_pixmaps[border]); - pt.translate(-r.topLeft()); - pt.setCompositionMode(QPainter::CompositionMode_Source); - pt.setClipRegion(reg); - pt.drawPixmap(b.topLeft(), m_scratch); - pt.end(); -} - -void NativeXRenderPaintRedirector::fillScratch(Qt::GlobalColor color) -{ - m_scratch.fill(color); -} - -QPaintDevice *NativeXRenderPaintRedirector::recreateScratch(const QSize &size) -{ - m_scratch = QPixmap(size); - return &m_scratch; -} - -QPaintDevice *NativeXRenderPaintRedirector::scratch() -{ - return &m_scratch; -} - -void NativeXRenderPaintRedirector::discardScratch() -{ - m_scratch = QPixmap(); -} - } // namespace #include "paintredirector.moc" diff --git a/paintredirector.h b/paintredirector.h index fbc53042c5..e56c90343c 100644 --- a/paintredirector.h +++ b/paintredirector.h @@ -162,26 +162,6 @@ private: static unsigned int s_count; }; -class NativeXRenderPaintRedirector : public PaintRedirector -{ - Q_OBJECT -public: - NativeXRenderPaintRedirector(Client *c, QWidget *widget); - virtual ~NativeXRenderPaintRedirector(); - -protected: - virtual xcb_render_picture_t picture(DecorationPixmap border) const; - virtual void resize(DecorationPixmap border, const QSize &size); - virtual void paint(DecorationPixmap border, const QRect &r, const QRect &b, const QRegion ®); - virtual void fillScratch(Qt::GlobalColor color); - virtual QPaintDevice *recreateScratch(const QSize &size); - virtual QPaintDevice *scratch(); - virtual void discardScratch(); -private: - QPixmap m_pixmaps[PixmapCount]; - QPixmap m_scratch; -}; - class RasterXRenderPaintRedirector : public ImageBasedPaintRedirector { Q_OBJECT diff --git a/scene_opengl.cpp b/scene_opengl.cpp index b19206133c..e0ff310932 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -926,13 +926,7 @@ bool SceneOpenGL::Texture::load(const QPixmap& pixmap, GLenum target) if (pixmap.isNull()) return false; - // Checking whether QPixmap comes with its own X11 Pixmap - if (Extensions::nonNativePixmaps()) { - return GLTexture::load(pixmap.toImage(), target); - } - - // use the X11 pixmap provided by Qt - return load(pixmap.handle(), pixmap.size(), pixmap.depth()); + return GLTexture::load(pixmap.toImage(), target); } void SceneOpenGL::Texture::findTarget() diff --git a/workspace.cpp b/workspace.cpp index 43b3c5adef..1776d23ec6 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1470,12 +1470,6 @@ QString Workspace::supportInformation() const support.append(decorationPlugin()->supportInformation()); support.append("\nCompositing\n"); support.append( "===========\n"); - support.append("Qt Graphics System: "); - if (Extensions::nonNativePixmaps()) { - support.append("raster\n"); - } else { - support.append("native\n"); - } if (effects) { support.append("Compositing is active\n"); switch (effects->compositingType()) {