Changeset View
Changeset View
Standalone View
Standalone View
effects/blur/blur.h
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 76 | private: | |||
---|---|---|---|---|---|
78 | QRegion expand(const QRegion ®ion) const; | 78 | QRegion expand(const QRegion ®ion) const; | ||
79 | bool renderTargetsValid() const; | 79 | bool renderTargetsValid() const; | ||
80 | void deleteFBOs(); | 80 | void deleteFBOs(); | ||
81 | void initBlurStrengthValues(); | 81 | void initBlurStrengthValues(); | ||
82 | void updateTexture(); | 82 | void updateTexture(); | ||
83 | QRegion blurRegion(const EffectWindow *w) const; | 83 | QRegion blurRegion(const EffectWindow *w) const; | ||
84 | bool shouldBlur(const EffectWindow *w, int mask, const WindowPaintData &data) const; | 84 | bool shouldBlur(const EffectWindow *w, int mask, const WindowPaintData &data) const; | ||
85 | void updateBlurRegion(EffectWindow *w) const; | 85 | void updateBlurRegion(EffectWindow *w) const; | ||
86 | void doBlur(const QRegion &shape, const QRect &screen, const float opacity, const QMatrix4x4 &screenProjection, bool isDock); | 86 | void doBlur(const QRegion &shape, const QRect &screen, const float opacity, const QMatrix4x4 &screenProjection, bool isDock, QRect windowRect); | ||
87 | void uploadRegion(QVector2D *&map, const QRegion ®ion, const int downSampleIterations); | 87 | void uploadRegion(QVector2D *&map, const QRegion ®ion, const int downSampleIterations); | ||
88 | void uploadGeometry(GLVertexBuffer *vbo, const QRegion &blurRegion, const QRegion &windowRegion); | 88 | void uploadGeometry(GLVertexBuffer *vbo, const QRegion &blurRegion, const QRegion &windowRegion); | ||
89 | void generateNoiseTexture(); | ||||
89 | 90 | | |||
91 | void upscaleRenderToScreen(GLVertexBuffer *vbo, int vboStart, int blurRectCount, QMatrix4x4 screenProjection, QRect windowShape, QPoint windowPosition); | ||||
90 | void downSampleTexture(GLVertexBuffer *vbo, int blurRectCount); | 92 | void downSampleTexture(GLVertexBuffer *vbo, int blurRectCount); | ||
91 | void upSampleTexture(GLVertexBuffer *vbo, int blurRectCount); | 93 | void upSampleTexture(GLVertexBuffer *vbo, int blurRectCount); | ||
92 | void copyScreenSampleTexture(GLVertexBuffer *vbo, int blurRectCount, QRegion blurShape, QSize screenSize, QMatrix4x4 screenProjection); | 94 | void copyScreenSampleTexture(GLVertexBuffer *vbo, int blurRectCount, QRegion blurShape, QSize screenSize, QMatrix4x4 screenProjection); | ||
93 | 95 | | |||
94 | private: | 96 | private: | ||
95 | BlurShader *m_shader; | 97 | BlurShader *m_shader; | ||
96 | QVector <GLRenderTarget*> m_renderTargets; | 98 | QVector <GLRenderTarget*> m_renderTargets; | ||
97 | QVector <GLTexture> m_renderTextures; | 99 | QVector <GLTexture> m_renderTextures; | ||
98 | QStack <GLRenderTarget*> m_renderTargetStack; | 100 | QStack <GLRenderTarget*> m_renderTargetStack; | ||
101 | | ||||
102 | GLTexture m_noiseTexture; | ||||
103 | | ||||
99 | bool m_renderTargetsValid; | 104 | bool m_renderTargetsValid; | ||
100 | long net_wm_blur_region; | 105 | long net_wm_blur_region; | ||
101 | QRegion m_damagedArea; // keeps track of the area which has been damaged (from bottom to top) | 106 | QRegion m_damagedArea; // keeps track of the area which has been damaged (from bottom to top) | ||
102 | QRegion m_paintedArea; // actually painted area which is greater than m_damagedArea | 107 | QRegion m_paintedArea; // actually painted area which is greater than m_damagedArea | ||
103 | QRegion m_currentBlur; // keeps track of the currently blured area of the windows(from bottom to top) | 108 | QRegion m_currentBlur; // keeps track of the currently blured area of the windows(from bottom to top) | ||
104 | 109 | | |||
105 | int m_downSampleIterations; // number of times the texture will be downsized to half size | 110 | int m_downSampleIterations; // number of times the texture will be downsized to half size | ||
106 | int m_offset; | 111 | int m_offset; | ||
107 | int m_expandSize; | 112 | int m_expandSize; | ||
113 | int m_noiseStrength; | ||||
114 | float m_noiseTextureToScreenRatio; | ||||
115 | | ||||
zzag: Scaling factor should be a floating point number. | |||||
anemeth: Nice catch, it will be fixed with the next revision. | |||||
116 | int m_scalingFactor; | ||||
108 | 117 | | |||
109 | struct OffsetStruct { | 118 | struct OffsetStruct { | ||
110 | float minOffset; | 119 | float minOffset; | ||
111 | float maxOffset; | 120 | float maxOffset; | ||
112 | int expandSize; | 121 | int expandSize; | ||
113 | }; | 122 | }; | ||
114 | 123 | | |||
115 | QVector <OffsetStruct> blurOffsets; | 124 | QVector <OffsetStruct> blurOffsets; | ||
Show All 26 Lines |
Scaling factor should be a floating point number.