• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KWin

scene_xrender.h

Go to the documentation of this file.
00001 /********************************************************************
00002  KWin - the KDE window manager
00003  This file is part of the KDE project.
00004 
00005 Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
00006 
00007 This program is free software; you can redistribute it and/or modify
00008 it under the terms of the GNU General Public License as published by
00009 the Free Software Foundation; either version 2 of the License, or
00010 (at your option) any later version.
00011 
00012 This program is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 *********************************************************************/
00020 
00021 #ifndef KWIN_SCENE_XRENDER_H
00022 #define KWIN_SCENE_XRENDER_H
00023 
00024 #include <config-workspace.h>
00025 
00026 #include "scene.h"
00027 
00028 #ifdef KWIN_HAVE_XRENDER_COMPOSITING
00029 #include <X11/extensions/Xrender.h>
00030 #include <X11/extensions/Xfixes.h>
00031 
00032 namespace KWin
00033 {
00034 
00035 
00036 class SceneXrender
00037     : public Scene
00038     {
00039     public:
00040         SceneXrender( Workspace* ws );
00041         virtual ~SceneXrender();
00042         virtual bool initFailed() const;
00043         virtual CompositingType compositingType() const { return XRenderCompositing; }
00044         virtual void paint( QRegion damage, ToplevelList windows );
00045         virtual void windowGeometryShapeChanged( Toplevel* );
00046         virtual void windowOpacityChanged( Toplevel* );
00047         virtual void windowAdded( Toplevel* );
00048         virtual void windowClosed( Toplevel*, Deleted* );
00049         virtual void windowDeleted( Deleted* );
00050         Picture bufferPicture();
00051     protected:
00052         virtual void paintBackground( QRegion region );
00053         virtual void paintGenericScreen( int mask, ScreenPaintData data );
00054     private:
00055         void paintTransformedScreen( int mask );
00056         void createBuffer();
00057         void flushBuffer( int mask, QRegion damage );
00058         bool selfCheck();
00059         XRenderPictFormat* format;
00060         Picture front;
00061         static Picture buffer;
00062         static ScreenPaintData screen_paint;
00063         class Window;
00064         QHash< Toplevel*, Window* > windows;
00065         bool init_ok;
00066     };
00067 
00068 class SceneXrender::Window
00069     : public Scene::Window
00070     {
00071     public:
00072         Window( Toplevel* c );
00073         virtual ~Window();
00074         virtual void performPaint( int mask, QRegion region, WindowPaintData data );
00075         void discardPicture();
00076         void discardAlpha();
00077         QRegion transformedShape() const;
00078         void setTransformedShape( const QRegion& shape );
00079     private:
00080         Picture picture();
00081         Picture alphaMask( double opacity );
00082         Picture _picture;
00083         XRenderPictFormat* format;
00084         Picture alpha;
00085         double alpha_cached_opacity;
00086         QRegion transformed_shape;
00087     };
00088 
00089 inline
00090 Picture SceneXrender::bufferPicture()
00091     {
00092     return buffer;
00093     }
00094 
00095 inline
00096 QRegion SceneXrender::Window::transformedShape() const
00097     {
00098     return transformed_shape;
00099     }
00100 
00101 inline
00102 void SceneXrender::Window::setTransformedShape( const QRegion& shape )
00103     {
00104     transformed_shape = shape;
00105     }
00106 
00107 } // namespace
00108 
00109 #endif
00110 
00111 #endif

KWin

Skip menu "KWin"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal