summaryrefslogtreecommitdiff
path: root/src/vignetting.h
blob: 15d46c364c421163ce14cb32cbef5d7eb383c6ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include <core/core.h>
#include <composite/composite.h>
#include <opengl/opengl.h>

#include <cairo-xlib-xrender.h>

#include "vignetting_options.h"

class VigScreen :
    public PluginClassHandler <VigScreen, CompScreen>,
    public VignettingOptions
{
    public:

	VigScreen (CompScreen *);
	~VigScreen ();

	void
	cairoClear (cairo_t    *cr);

	cairo_t *
	cairoContext ();
	
	void
	renderVignette ();
	
	void
	optionChanged (CompOption *opt,
		       Options     num);

    public:
    
	CompositeScreen *cScreen;
	GLScreen	*gScreen;

    public:

	Pixmap pixmap;
	GLTexture::List texture;
	cairo_surface_t *surface;
	cairo_t		*cairo;
	Damage		damage;
};

#define VIG_SCREEN(s)						       \
    VigScreen *vs = VigScreen::get (s);

class VigWindow :
    public PluginClassHandler <VigWindow, CompWindow>,
    public GLWindowInterface
{
    public:
    
	VigWindow (CompWindow *w);
	~VigWindow ();

    public:
    
	CompWindow *window;
	CompositeWindow *cWindow;
	GLWindow   *gWindow;

    public:
    
	bool
	glDraw (const GLMatrix &, GLFragment::Attrib &,
		const CompRegion &, unsigned int);

	
};

#define VIG_WINDOW(w)						       \
    VigWindow *vw = VigWindow::get (w);

class VigPluginVTable :
    public CompPlugin::VTableForScreenAndWindow <VigScreen, VigWindow>
{
    public:

	bool init ();
};