mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kwin: remove checks for native paint engine
in most cases the paint engine Katie uses is raster paint engine Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
9c6038450c
commit
15655b1c11
6 changed files with 1 additions and 104 deletions
|
@ -42,8 +42,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
namespace KWin
|
||||
{
|
||||
|
||||
bool Extensions::non_native_pixmaps = false;
|
||||
|
||||
void Extensions::init()
|
||||
{
|
||||
static bool initPerformed = false;
|
||||
|
@ -59,11 +57,6 @@ void Extensions::init()
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -169,11 +169,6 @@ class KWIN_EXPORT Extensions
|
|||
{
|
||||
public:
|
||||
static void init();
|
||||
static bool nonNativePixmaps() {
|
||||
return non_native_pixmaps;
|
||||
}
|
||||
private:
|
||||
static bool non_native_pixmaps;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -109,11 +109,7 @@ static xcb_render_picture_t createPicture(xcb_pixmap_t pix, int depth)
|
|||
|
||||
XRenderPicture::XRenderPicture(const QPixmap &pix)
|
||||
{
|
||||
if (Extensions::nonNativePixmaps()) {
|
||||
fromImage(pix.toImage());
|
||||
} else {
|
||||
d = new XRenderPictureData(createPicture(pix.handle(), pix.depth()));
|
||||
}
|
||||
}
|
||||
|
||||
XRenderPicture::XRenderPicture(const QImage &img)
|
||||
|
|
|
@ -40,9 +40,6 @@ namespace KWin
|
|||
|
||||
PaintRedirector *PaintRedirector::create(Client *c, QWidget *widget)
|
||||
{
|
||||
if (!Extensions::nonNativePixmaps()) {
|
||||
return new NativeXRenderPaintRedirector(c, widget);
|
||||
}
|
||||
return new RasterXRenderPaintRedirector(c, widget);
|
||||
}
|
||||
|
||||
|
@ -346,64 +343,6 @@ void RasterXRenderPaintRedirector::discardScratch()
|
|||
m_scratchImage = QImage();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
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 "moc_paintredirector.cpp"
|
||||
|
|
|
@ -118,26 +118,6 @@ private:
|
|||
bool m_requiresRepaint;
|
||||
};
|
||||
|
||||
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 PaintRedirector
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
@ -1309,12 +1309,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()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue