Merge lp:~unity-team/unity/unity.fix-noblur into lp:unity
- unity.fix-noblur
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Gord Allott |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2226 |
Proposed branch: | lp:~unity-team/unity/unity.fix-noblur |
Merge into: | lp:unity |
Diff against target: |
514 lines (+237/-74) 10 files modified
plugins/unityshell/src/BackgroundEffectHelper.cpp (+86/-0) plugins/unityshell/src/BackgroundEffectHelper.h (+2/-0) plugins/unityshell/src/Launcher.cpp (+41/-35) plugins/unityshell/src/OverlayRenderer.cpp (+28/-26) plugins/unityshell/src/PanelView.cpp (+12/-4) plugins/unityshell/src/PlacesGroup.cpp (+0/-2) plugins/unityshell/src/ResultViewGrid.cpp (+0/-2) plugins/unityshell/src/ScreenEffectFramebufferObject.cpp (+0/-3) plugins/unityshell/src/unityshell.cpp (+62/-2) plugins/unityshell/src/unityshell.h (+6/-0) |
To merge this branch: | bzr merge lp:~unity-team/unity/unity.fix-noblur |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gord Allott (community) | Approve | ||
Brandon Schaefer (community) | Approve | ||
Jason Smith (community) | Approve | ||
Review via email: mp+99403@code.launchpad.net |
Commit message
* Fix for bug #839480
* Fix rendering of the Dash, Launcher and Panel when "NO_BLUR" is selected in CCSM
* Added support to get a none blurred region of the display from BackgroundEffec
Description of the change
* Fix for bug #839480
* Fix rendering of the Dash, Launcher and Panel when "NO_BLUR" is selected in CCSM
* Added support to get a none blurred region of the display from BackgroundEffec
Brandon Schaefer (brandontschaefer) wrote : | # |
One thing, the 'dash_is_open_' in unityshell.cpp isn't correctly handled anymore (There are cases when the dash is open and dash_is_open is false). So there is the launcher_
Gord Allott (gordallott) wrote : | # |
330 + // nux::LayerBlendMode layer_blend_mode = nux::LAYER_
331 + // if (_menu_
332 + // {
333 + // layer_blend_mode = nux::LAYER_
334 + // }
335 +
just a few comments that were added but shouldn't be, lets remove those
Brandon Schaefer (brandontschaefer) wrote : | # |
Fixed those 2 issues, Thanks Jay awesome work! The panel looks soo much better!
Brandon Schaefer (brandontschaefer) : | # |
Gord Allott (gordallott) : | # |
Omer Akram (om26er) wrote : | # |
this branch seems to cause bug 974408
Preview Diff
1 | === modified file 'plugins/unityshell/src/BackgroundEffectHelper.cpp' | |||
2 | --- plugins/unityshell/src/BackgroundEffectHelper.cpp 2012-03-14 06:24:18 +0000 | |||
3 | +++ plugins/unityshell/src/BackgroundEffectHelper.cpp 2012-04-05 06:31:21 +0000 | |||
4 | @@ -321,3 +321,89 @@ | |||
5 | 321 | cache_dirty = false; | 321 | cache_dirty = false; |
6 | 322 | return blur_texture_; | 322 | return blur_texture_; |
7 | 323 | } | 323 | } |
8 | 324 | |||
9 | 325 | nux::ObjectPtr<nux::IOpenGLBaseTexture> BackgroundEffectHelper::GetRegion(nux::Geometry geo, bool force_update) | ||
10 | 326 | { | ||
11 | 327 | bool should_update = force_update || cache_dirty; | ||
12 | 328 | |||
13 | 329 | /* Static blur: only update when the size changed */ | ||
14 | 330 | if ((!should_update) | ||
15 | 331 | && blur_texture_.IsValid() | ||
16 | 332 | && (geo == blur_geometry_)) | ||
17 | 333 | { | ||
18 | 334 | return blur_texture_; | ||
19 | 335 | } | ||
20 | 336 | |||
21 | 337 | nux::GraphicsEngine* graphics_engine = nux::GetGraphicsDisplay()->GetGraphicsEngine(); | ||
22 | 338 | |||
23 | 339 | int monitor_width = BackgroundEffectHelper::monitor_rect_.width; | ||
24 | 340 | int monitor_height = BackgroundEffectHelper::monitor_rect_.height; | ||
25 | 341 | |||
26 | 342 | nux::Geometry temp = geo; | ||
27 | 343 | temp.OffsetPosition(-monitor_rect_.x, -monitor_rect_.y); | ||
28 | 344 | blur_geometry_ = nux::Geometry(0, 0, monitor_width, monitor_height).Intersect(temp); | ||
29 | 345 | |||
30 | 346 | nux::GpuDevice* gpu_device = nux::GetGraphicsDisplay()->GetGpuDevice(); | ||
31 | 347 | if (blur_geometry_.IsNull() || !gpu_device->backup_texture0_.IsValid()) | ||
32 | 348 | { | ||
33 | 349 | return nux::ObjectPtr<nux::IOpenGLBaseTexture>(); | ||
34 | 350 | } | ||
35 | 351 | |||
36 | 352 | // save the current fbo | ||
37 | 353 | nux::ObjectPtr<nux::IOpenGLFrameBufferObject> current_fbo = gpu_device->GetCurrentFrameBufferObject(); | ||
38 | 354 | gpu_device->DeactivateFrameBuffer(); | ||
39 | 355 | |||
40 | 356 | // Set a viewport to the requested size | ||
41 | 357 | // FIXME: We need to do multiple passes for the dirty region | ||
42 | 358 | // on the underlying backup texture so that we're only updating | ||
43 | 359 | // the bits that we need | ||
44 | 360 | graphics_engine->SetViewport(0, 0, blur_geometry_.width, blur_geometry_.height); | ||
45 | 361 | graphics_engine->SetScissor(0, 0, blur_geometry_.width, blur_geometry_.height); | ||
46 | 362 | // Disable nux scissoring | ||
47 | 363 | graphics_engine->GetRenderStates ().EnableScissor (false); | ||
48 | 364 | |||
49 | 365 | // The background texture is the same size as the monitor where we are rendering. | ||
50 | 366 | nux::TexCoordXForm texxform__bg; | ||
51 | 367 | texxform__bg.flip_v_coord = false; | ||
52 | 368 | texxform__bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); | ||
53 | 369 | texxform__bg.uoffset = ((float) blur_geometry_.x) / monitor_width; | ||
54 | 370 | texxform__bg.voffset = ((float) monitor_height - blur_geometry_.y - blur_geometry_.height) / monitor_height; | ||
55 | 371 | |||
56 | 372 | { | ||
57 | 373 | nux::ObjectPtr<nux::IOpenGLBaseTexture> device_texture = gpu_device->backup_texture0_; | ||
58 | 374 | nux::ObjectPtr<nux::CachedBaseTexture> noise_device_texture = graphics_engine->CacheResource(noise_texture_); | ||
59 | 375 | |||
60 | 376 | unsigned int offset = 0; | ||
61 | 377 | int quad_width = blur_geometry_.width; | ||
62 | 378 | int quad_height = blur_geometry_.height; | ||
63 | 379 | |||
64 | 380 | unsigned int buffer_width = quad_width + 2 * offset; | ||
65 | 381 | unsigned int buffer_height = quad_height + 2 * offset; | ||
66 | 382 | |||
67 | 383 | texxform__bg.SetFilter(nux::TEXFILTER_NEAREST, nux::TEXFILTER_NEAREST); | ||
68 | 384 | texxform__bg.flip_v_coord = true; | ||
69 | 385 | |||
70 | 386 | // Copy source texture | ||
71 | 387 | graphics_engine->QRP_GetCopyTexture(buffer_width, buffer_height, | ||
72 | 388 | blur_texture_, device_texture, | ||
73 | 389 | texxform__bg, nux::color::White); | ||
74 | 390 | } | ||
75 | 391 | |||
76 | 392 | if (current_fbo.IsValid()) | ||
77 | 393 | { | ||
78 | 394 | current_fbo->Activate(true); | ||
79 | 395 | graphics_engine->Push2DWindow(current_fbo->GetWidth(), current_fbo->GetHeight()); | ||
80 | 396 | graphics_engine->GetRenderStates ().EnableScissor (true); | ||
81 | 397 | } | ||
82 | 398 | else | ||
83 | 399 | { | ||
84 | 400 | graphics_engine->SetViewport(0, 0, monitor_width, monitor_height); | ||
85 | 401 | graphics_engine->Push2DWindow(monitor_width, monitor_height); | ||
86 | 402 | |||
87 | 403 | graphics_engine->ApplyClippingRectangle(); | ||
88 | 404 | } | ||
89 | 405 | |||
90 | 406 | cache_dirty = false; | ||
91 | 407 | return blur_texture_; | ||
92 | 408 | } | ||
93 | 409 | |||
94 | 324 | 410 | ||
95 | === modified file 'plugins/unityshell/src/BackgroundEffectHelper.h' | |||
96 | --- plugins/unityshell/src/BackgroundEffectHelper.h 2012-03-14 06:24:18 +0000 | |||
97 | +++ plugins/unityshell/src/BackgroundEffectHelper.h 2012-04-05 06:31:21 +0000 | |||
98 | @@ -50,6 +50,8 @@ | |||
99 | 50 | // We could add more functions here to get different types of effects based on the background texture | 50 | // We could add more functions here to get different types of effects based on the background texture |
100 | 51 | nux::ObjectPtr<nux::IOpenGLBaseTexture> GetPixelatedRegion(nux::Rect rect, int pixel_size, bool update); | 51 | nux::ObjectPtr<nux::IOpenGLBaseTexture> GetPixelatedRegion(nux::Rect rect, int pixel_size, bool update); |
101 | 52 | 52 | ||
102 | 53 | nux::ObjectPtr<nux::IOpenGLBaseTexture> GetRegion(nux::Geometry geo, bool force_update = false); | ||
103 | 54 | |||
104 | 53 | void DirtyCache(); | 55 | void DirtyCache(); |
105 | 54 | 56 | ||
106 | 55 | static void ProcessDamage(nux::Geometry geo); | 57 | static void ProcessDamage(nux::Geometry geo); |
107 | 56 | 58 | ||
108 | === modified file 'plugins/unityshell/src/Launcher.cpp' | |||
109 | --- plugins/unityshell/src/Launcher.cpp 2012-04-05 00:32:14 +0000 | |||
110 | +++ plugins/unityshell/src/Launcher.cpp 2012-04-05 06:31:21 +0000 | |||
111 | @@ -1944,48 +1944,54 @@ | |||
112 | 1944 | 1944 | ||
113 | 1945 | if (IsOverlayOpen()) | 1945 | if (IsOverlayOpen()) |
114 | 1946 | { | 1946 | { |
115 | 1947 | nux::Geometry blur_geo(geo_absolute.x, geo_absolute.y, base.width, base.height); | ||
116 | 1948 | nux::ObjectPtr<nux::IOpenGLBaseTexture> blur_texture; | ||
117 | 1949 | |||
118 | 1947 | if (BackgroundEffectHelper::blur_type != unity::BLUR_NONE && (bkg_box.x + bkg_box.width > 0)) | 1950 | if (BackgroundEffectHelper::blur_type != unity::BLUR_NONE && (bkg_box.x + bkg_box.width > 0)) |
119 | 1948 | { | 1951 | { |
132 | 1949 | nux::Geometry blur_geo(geo_absolute.x, geo_absolute.y, base.width, base.height); | 1952 | blur_texture = bg_effect_helper_.GetBlurRegion(blur_geo); |
133 | 1950 | auto blur_texture = bg_effect_helper_.GetBlurRegion(blur_geo); | 1953 | } |
134 | 1951 | 1954 | else | |
135 | 1952 | if (blur_texture.IsValid()) | 1955 | { |
136 | 1953 | { | 1956 | blur_texture = bg_effect_helper_.GetRegion(blur_geo); |
137 | 1954 | nux::TexCoordXForm texxform_blur_bg; | 1957 | } |
138 | 1955 | texxform_blur_bg.flip_v_coord = true; | 1958 | |
139 | 1956 | texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); | 1959 | if (blur_texture.IsValid()) |
140 | 1957 | texxform_blur_bg.uoffset = ((float) base.x) / geo_absolute.width; | 1960 | { |
141 | 1958 | texxform_blur_bg.voffset = ((float) base.y) / geo_absolute.height; | 1961 | nux::TexCoordXForm texxform_blur_bg; |
142 | 1959 | 1962 | texxform_blur_bg.flip_v_coord = true; | |
143 | 1960 | GfxContext.PushClippingRectangle(bkg_box); | 1963 | texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
144 | 1964 | texxform_blur_bg.uoffset = ((float) base.x) / geo_absolute.width; | ||
145 | 1965 | texxform_blur_bg.voffset = ((float) base.y) / geo_absolute.height; | ||
146 | 1966 | |||
147 | 1967 | GfxContext.PushClippingRectangle(bkg_box); | ||
148 | 1961 | 1968 | ||
149 | 1962 | #ifndef NUX_OPENGLES_20 | 1969 | #ifndef NUX_OPENGLES_20 |
164 | 1963 | if (GfxContext.UsingGLSLCodePath()) | 1970 | if (GfxContext.UsingGLSLCodePath()) |
165 | 1964 | gPainter.PushDrawCompositionLayer(GfxContext, base, | 1971 | gPainter.PushDrawCompositionLayer(GfxContext, base, |
166 | 1965 | blur_texture, | 1972 | blur_texture, |
167 | 1966 | texxform_blur_bg, | 1973 | texxform_blur_bg, |
168 | 1967 | nux::color::White, | 1974 | nux::color::White, |
169 | 1968 | _background_color, nux::LAYER_BLEND_MODE_OVERLAY, | 1975 | _background_color, nux::LAYER_BLEND_MODE_OVERLAY, |
170 | 1969 | true, ROP); | 1976 | true, ROP); |
171 | 1970 | else | 1977 | else |
172 | 1971 | gPainter.PushDrawTextureLayer(GfxContext, base, | 1978 | gPainter.PushDrawTextureLayer(GfxContext, base, |
173 | 1972 | blur_texture, | 1979 | blur_texture, |
174 | 1973 | texxform_blur_bg, | 1980 | texxform_blur_bg, |
175 | 1974 | nux::color::White, | 1981 | nux::color::White, |
176 | 1975 | true, | 1982 | true, |
177 | 1976 | ROP); | 1983 | ROP); |
178 | 1977 | #else | 1984 | #else |
185 | 1978 | gPainter.PushDrawCompositionLayer(GfxContext, base, | 1985 | gPainter.PushDrawCompositionLayer(GfxContext, base, |
186 | 1979 | blur_texture, | 1986 | blur_texture, |
187 | 1980 | texxform_blur_bg, | 1987 | texxform_blur_bg, |
188 | 1981 | nux::color::White, | 1988 | nux::color::White, |
189 | 1982 | _background_color, nux::LAYER_BLEND_MODE_OVERLAY, | 1989 | _background_color, nux::LAYER_BLEND_MODE_OVERLAY, |
190 | 1983 | true, ROP); | 1990 | true, ROP); |
191 | 1984 | #endif | 1991 | #endif |
193 | 1985 | GfxContext.PopClippingRectangle(); | 1992 | GfxContext.PopClippingRectangle(); |
194 | 1986 | 1993 | ||
197 | 1987 | push_count++; | 1994 | push_count++; |
196 | 1988 | } | ||
198 | 1989 | } | 1995 | } |
199 | 1990 | 1996 | ||
200 | 1991 | unsigned int alpha = 0, src = 0, dest = 0; | 1997 | unsigned int alpha = 0, src = 0, dest = 0; |
201 | 1992 | 1998 | ||
202 | === modified file 'plugins/unityshell/src/OverlayRenderer.cpp' | |||
203 | --- plugins/unityshell/src/OverlayRenderer.cpp 2012-03-21 14:18:06 +0000 | |||
204 | +++ plugins/unityshell/src/OverlayRenderer.cpp 2012-04-05 06:31:21 +0000 | |||
205 | @@ -251,39 +251,42 @@ | |||
206 | 251 | texxform_absolute_bg.voffset = ((float) content_geo.y) / absolute_geo.height; | 251 | texxform_absolute_bg.voffset = ((float) content_geo.y) / absolute_geo.height; |
207 | 252 | texxform_absolute_bg.SetWrap(nux::TEXWRAP_CLAMP, nux::TEXWRAP_CLAMP); | 252 | texxform_absolute_bg.SetWrap(nux::TEXWRAP_CLAMP, nux::TEXWRAP_CLAMP); |
208 | 253 | 253 | ||
209 | 254 | nux::Geometry blur_geo(absolute_geo.x, absolute_geo.y, content_geo.width, content_geo.height); | ||
210 | 254 | if (paint_blur) | 255 | if (paint_blur) |
211 | 255 | { | 256 | { |
212 | 256 | nux::Geometry blur_geo(absolute_geo.x, absolute_geo.y, content_geo.width, content_geo.height); | ||
213 | 257 | bg_blur_texture_ = bg_effect_helper_.GetBlurRegion(blur_geo); | 257 | bg_blur_texture_ = bg_effect_helper_.GetBlurRegion(blur_geo); |
221 | 258 | 258 | } | |
222 | 259 | if (bg_blur_texture_.IsValid()) | 259 | else |
223 | 260 | { | 260 | { |
224 | 261 | nux::Geometry bg_clip = geo; | 261 | bg_blur_texture_ = bg_effect_helper_.GetRegion(blur_geo); |
225 | 262 | gfx_context.PushClippingRectangle(bg_clip); | 262 | } |
226 | 263 | 263 | ||
227 | 264 | gfx_context.GetRenderStates().SetBlend(false); | 264 | if (bg_blur_texture_.IsValid()) |
228 | 265 | { | ||
229 | 266 | nux::Geometry bg_clip = geo; | ||
230 | 267 | gfx_context.PushClippingRectangle(bg_clip); | ||
231 | 268 | |||
232 | 269 | gfx_context.GetRenderStates().SetBlend(false); | ||
233 | 265 | #ifndef NUX_OPENGLES_20 | 270 | #ifndef NUX_OPENGLES_20 |
239 | 266 | if (gfx_context.UsingGLSLCodePath()) | 271 | if (gfx_context.UsingGLSLCodePath()) |
240 | 267 | gfx_context.QRP_GLSL_ColorBlendOverTex (content_geo.x, content_geo.y, | 272 | gfx_context.QRP_GLSL_ColorBlendOverTex (content_geo.x, content_geo.y, |
241 | 268 | content_geo.width, content_geo.height, | 273 | content_geo.width, content_geo.height, |
242 | 269 | bg_blur_texture_, texxform_absolute_bg, nux::color::White, | 274 | bg_blur_texture_, texxform_absolute_bg, nux::color::White, |
243 | 270 | bg_color_, nux::LAYER_BLEND_MODE_OVERLAY); | 275 | bg_color_, nux::LAYER_BLEND_MODE_OVERLAY); |
244 | 271 | 276 | ||
249 | 272 | else | 277 | else |
250 | 273 | gfx_context.QRP_1Tex (content_geo.x, content_geo.y, | 278 | gfx_context.QRP_1Tex (content_geo.x, content_geo.y, |
251 | 274 | content_geo.width, content_geo.height, | 279 | content_geo.width, content_geo.height, |
252 | 275 | bg_blur_texture_, texxform_absolute_bg, nux::color::White); | 280 | bg_blur_texture_, texxform_absolute_bg, nux::color::White); |
253 | 276 | #else | 281 | #else |
258 | 277 | gfx_context.QRP_GLSL_ColorBlendOverTex (content_geo.x, content_geo.y, | 282 | gfx_context.QRP_GLSL_ColorBlendOverTex (content_geo.x, content_geo.y, |
259 | 278 | content_geo.width, content_geo.height, | 283 | content_geo.width, content_geo.height, |
260 | 279 | bg_blur_texture_, texxform_absolute_bg, nux::color::White, | 284 | bg_blur_texture_, texxform_absolute_bg, nux::color::White, |
261 | 280 | bg_color_, nux::LAYER_BLEND_MODE_OVERLAY); | 285 | bg_color_, nux::LAYER_BLEND_MODE_OVERLAY); |
262 | 281 | 286 | ||
263 | 282 | #endif | 287 | #endif |
264 | 283 | gPainter.PopBackground(); | ||
265 | 284 | 288 | ||
268 | 285 | gfx_context.PopClippingRectangle(); | 289 | gfx_context.PopClippingRectangle(); |
267 | 286 | } | ||
269 | 287 | } | 290 | } |
270 | 288 | 291 | ||
271 | 289 | // Draw the left and top lines | 292 | // Draw the left and top lines |
272 | @@ -376,7 +379,6 @@ | |||
273 | 376 | 379 | ||
274 | 377 | void OverlayRendererImpl::DrawContent(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry) | 380 | void OverlayRendererImpl::DrawContent(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry) |
275 | 378 | { | 381 | { |
276 | 379 | bool paint_blur = BackgroundEffectHelper::blur_type != BLUR_NONE; | ||
277 | 380 | nux::Geometry geo = geometry; | 382 | nux::Geometry geo = geometry; |
278 | 381 | bgs = 0; | 383 | bgs = 0; |
279 | 382 | 384 | ||
280 | @@ -397,7 +399,7 @@ | |||
281 | 397 | rop.SrcBlend = GL_ONE; | 399 | rop.SrcBlend = GL_ONE; |
282 | 398 | rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; | 400 | rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; |
283 | 399 | 401 | ||
285 | 400 | if (bg_blur_texture_.IsValid() && paint_blur) | 402 | if (bg_blur_texture_.IsValid()) |
286 | 401 | { | 403 | { |
287 | 402 | #ifndef NUX_OPENGLES_20 | 404 | #ifndef NUX_OPENGLES_20 |
288 | 403 | if (gfx_context.UsingGLSLCodePath()) | 405 | if (gfx_context.UsingGLSLCodePath()) |
289 | 404 | 406 | ||
290 | === modified file 'plugins/unityshell/src/PanelView.cpp' | |||
291 | --- plugins/unityshell/src/PanelView.cpp 2012-03-29 03:07:39 +0000 | |||
292 | +++ plugins/unityshell/src/PanelView.cpp 2012-04-05 06:31:21 +0000 | |||
293 | @@ -237,12 +237,20 @@ | |||
294 | 237 | 237 | ||
295 | 238 | GfxContext.PushClippingRectangle(GetGeometry()); | 238 | GfxContext.PushClippingRectangle(GetGeometry()); |
296 | 239 | 239 | ||
298 | 240 | if (BackgroundEffectHelper::blur_type != BLUR_NONE && (_overlay_is_open || (_opacity != 1.0f && _opacity != 0.0f))) | 240 | if ((_overlay_is_open || (_opacity != 1.0f && _opacity != 0.0f))) |
299 | 241 | { | 241 | { |
300 | 242 | nux::Geometry blur_geo(geo_absolute.x, geo_absolute.y, geo.width, geo.height); | 242 | nux::Geometry blur_geo(geo_absolute.x, geo_absolute.y, geo.width, geo.height); |
302 | 243 | bg_blur_texture_ = bg_effect_helper_.GetBlurRegion(blur_geo); | 243 | |
303 | 244 | if (BackgroundEffectHelper::blur_type != BLUR_NONE) | ||
304 | 245 | { | ||
305 | 246 | bg_blur_texture_ = bg_effect_helper_.GetBlurRegion(blur_geo); | ||
306 | 247 | } | ||
307 | 248 | else | ||
308 | 249 | { | ||
309 | 250 | bg_blur_texture_ = bg_effect_helper_.GetRegion(blur_geo); | ||
310 | 251 | } | ||
311 | 244 | 252 | ||
313 | 245 | if (bg_blur_texture_.IsValid() && BackgroundEffectHelper::blur_type != BLUR_NONE && (_overlay_is_open || _opacity != 1.0f)) | 253 | if (bg_blur_texture_.IsValid() && (_overlay_is_open || _opacity != 1.0f)) |
314 | 246 | { | 254 | { |
315 | 247 | nux::TexCoordXForm texxform_blur_bg; | 255 | nux::TexCoordXForm texxform_blur_bg; |
316 | 248 | texxform_blur_bg.flip_v_coord = true; | 256 | texxform_blur_bg.flip_v_coord = true; |
317 | @@ -318,7 +326,7 @@ | |||
318 | 318 | GfxContext.GetRenderStates().SetBlend(true); | 326 | GfxContext.GetRenderStates().SetBlend(true); |
319 | 319 | GfxContext.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); | 327 | GfxContext.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
320 | 320 | 328 | ||
322 | 321 | if (bg_blur_texture_.IsValid() && BackgroundEffectHelper::blur_type != BLUR_NONE && (_overlay_is_open || (_opacity != 1.0f && _opacity != 0.0f))) | 329 | if (bg_blur_texture_.IsValid() && (_overlay_is_open || (_opacity != 1.0f && _opacity != 0.0f))) |
323 | 322 | { | 330 | { |
324 | 323 | nux::Geometry geo_absolute = GetAbsoluteGeometry (); | 331 | nux::Geometry geo_absolute = GetAbsoluteGeometry (); |
325 | 324 | nux::TexCoordXForm texxform_blur_bg; | 332 | nux::TexCoordXForm texxform_blur_bg; |
326 | 325 | 333 | ||
327 | === modified file 'plugins/unityshell/src/PlacesGroup.cpp' | |||
328 | --- plugins/unityshell/src/PlacesGroup.cpp 2012-03-21 14:18:06 +0000 | |||
329 | +++ plugins/unityshell/src/PlacesGroup.cpp 2012-04-05 06:31:21 +0000 | |||
330 | @@ -426,8 +426,6 @@ | |||
331 | 426 | nux::Geometry const& base = GetGeometry(); | 426 | nux::Geometry const& base = GetGeometry(); |
332 | 427 | graphics_engine.PushClippingRectangle(base); | 427 | graphics_engine.PushClippingRectangle(base); |
333 | 428 | 428 | ||
334 | 429 | nux::GetPainter().PaintBackground(graphics_engine, base); | ||
335 | 430 | |||
336 | 431 | if (ShouldBeHighlighted()) | 429 | if (ShouldBeHighlighted()) |
337 | 432 | { | 430 | { |
338 | 433 | nux::Geometry geo(_header_layout->GetGeometry()); | 431 | nux::Geometry geo(_header_layout->GetGeometry()); |
339 | 434 | 432 | ||
340 | === modified file 'plugins/unityshell/src/ResultViewGrid.cpp' | |||
341 | --- plugins/unityshell/src/ResultViewGrid.cpp 2012-03-21 14:18:06 +0000 | |||
342 | +++ plugins/unityshell/src/ResultViewGrid.cpp 2012-04-05 06:31:21 +0000 | |||
343 | @@ -620,8 +620,6 @@ | |||
344 | 620 | 620 | ||
345 | 621 | void ResultViewGrid::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) | 621 | void ResultViewGrid::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) |
346 | 622 | { | 622 | { |
347 | 623 | gPainter.PaintBackground(GfxContext, GetGeometry()); | ||
348 | 624 | |||
349 | 625 | int items_per_row = GetItemsPerRow(); | 623 | int items_per_row = GetItemsPerRow(); |
350 | 626 | uint total_rows = (!expanded) ? 0 : (results_.size() / items_per_row) + 1; | 624 | uint total_rows = (!expanded) ? 0 : (results_.size() / items_per_row) + 1; |
351 | 627 | 625 | ||
352 | 628 | 626 | ||
353 | === modified file 'plugins/unityshell/src/ScreenEffectFramebufferObject.cpp' | |||
354 | --- plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2012-03-14 06:24:18 +0000 | |||
355 | +++ plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2012-04-05 06:31:21 +0000 | |||
356 | @@ -101,9 +101,6 @@ | |||
357 | 101 | 101 | ||
358 | 102 | void unity::ScreenEffectFramebufferObject::bind (const nux::Geometry &output) | 102 | void unity::ScreenEffectFramebufferObject::bind (const nux::Geometry &output) |
359 | 103 | { | 103 | { |
360 | 104 | if (!BackgroundEffectHelper::HasDirtyHelpers()) | ||
361 | 105 | return; | ||
362 | 106 | |||
363 | 107 | /* Clear the error bit */ | 104 | /* Clear the error bit */ |
364 | 108 | glGetError (); | 105 | glGetError (); |
365 | 109 | 106 | ||
366 | 110 | 107 | ||
367 | === modified file 'plugins/unityshell/src/unityshell.cpp' | |||
368 | --- plugins/unityshell/src/unityshell.cpp 2012-04-05 03:28:27 +0000 | |||
369 | +++ plugins/unityshell/src/unityshell.cpp 2012-04-05 06:31:21 +0000 | |||
370 | @@ -128,6 +128,8 @@ | |||
371 | 128 | , painting_tray_ (false) | 128 | , painting_tray_ (false) |
372 | 129 | , last_scroll_event_(0) | 129 | , last_scroll_event_(0) |
373 | 130 | , hud_keypress_time_(0) | 130 | , hud_keypress_time_(0) |
374 | 131 | , panel_texture_has_changed_(true) | ||
375 | 132 | , paint_panel_(false) | ||
376 | 131 | { | 133 | { |
377 | 132 | Timer timer; | 134 | Timer timer; |
378 | 133 | gfloat version; | 135 | gfloat version; |
379 | @@ -371,8 +373,11 @@ | |||
380 | 371 | 373 | ||
381 | 372 | RaiseInputWindows(); | 374 | RaiseInputWindows(); |
382 | 373 | }); | 375 | }); |
384 | 374 | LOG_INFO(logger) << "UnityScreen constructed: " << timer.ElapsedSeconds() << "s"; | 376 | |
385 | 377 | LOG_INFO(logger) << "UnityScreen constructed: " << timer.ElapsedSeconds() << "s"; | ||
386 | 375 | } | 378 | } |
387 | 379 | |||
388 | 380 | panel::Style::Instance().changed.connect(sigc::mem_fun(this, &UnityScreen::OnPanelStyleChanged)); | ||
389 | 376 | } | 381 | } |
390 | 377 | 382 | ||
391 | 378 | UnityScreen::~UnityScreen() | 383 | UnityScreen::~UnityScreen() |
392 | @@ -723,6 +728,12 @@ | |||
393 | 723 | wy = y + (last_bound.height - height) / 2; | 728 | wy = y + (last_bound.height - height) / 2; |
394 | 724 | } | 729 | } |
395 | 725 | 730 | ||
396 | 731 | void | ||
397 | 732 | UnityScreen::OnPanelStyleChanged() | ||
398 | 733 | { | ||
399 | 734 | panel_texture_has_changed_ = true; | ||
400 | 735 | } | ||
401 | 736 | |||
402 | 726 | #ifdef USE_GLES | 737 | #ifdef USE_GLES |
403 | 727 | void UnityScreen::paintDisplay() | 738 | void UnityScreen::paintDisplay() |
404 | 728 | #else | 739 | #else |
405 | @@ -734,6 +745,37 @@ | |||
406 | 734 | 745 | ||
407 | 735 | #ifndef USE_GLES | 746 | #ifndef USE_GLES |
408 | 736 | bool was_bound = _fbo->bound (); | 747 | bool was_bound = _fbo->bound (); |
409 | 748 | |||
410 | 749 | if (was_bound && launcher_controller_->IsOverlayOpen() && paint_panel_) | ||
411 | 750 | { | ||
412 | 751 | if (panel_texture_has_changed_ || !panel_texture_.IsValid()) | ||
413 | 752 | { | ||
414 | 753 | panel_texture_.Release(); | ||
415 | 754 | |||
416 | 755 | nux::NBitmapData* bitmap = panel::Style::Instance().GetBackground(screen->width (), screen->height(), 1.0f); | ||
417 | 756 | nux::BaseTexture* texture2D = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture(); | ||
418 | 757 | if (bitmap && texture2D) | ||
419 | 758 | { | ||
420 | 759 | texture2D->Update(bitmap); | ||
421 | 760 | panel_texture_ = texture2D->GetDeviceTexture(); | ||
422 | 761 | texture2D->UnReference(); | ||
423 | 762 | delete bitmap; | ||
424 | 763 | } | ||
425 | 764 | panel_texture_has_changed_ = false; | ||
426 | 765 | } | ||
427 | 766 | |||
428 | 767 | if (panel_texture_.IsValid()) | ||
429 | 768 | { | ||
430 | 769 | nux::GetGraphicsDisplay()->GetGraphicsEngine()->ResetModelViewMatrixStack(); | ||
431 | 770 | nux::GetGraphicsDisplay()->GetGraphicsEngine()->Push2DTranslationModelViewMatrix(0.0f, 0.0f, 0.0f); | ||
432 | 771 | nux::GetGraphicsDisplay()->GetGraphicsEngine()->ResetProjectionMatrix(); | ||
433 | 772 | nux::GetGraphicsDisplay()->GetGraphicsEngine()->SetOrthographicProjectionMatrix(screen->width (), screen->height()); | ||
434 | 773 | |||
435 | 774 | nux::TexCoordXForm texxform; | ||
436 | 775 | nux::GetGraphicsDisplay()->GetGraphicsEngine()->QRP_GLSL_1Tex(0, 0, screen->width (), 24, panel_texture_, texxform, nux::color::White); | ||
437 | 776 | } | ||
438 | 777 | } | ||
439 | 778 | |||
440 | 737 | _fbo->unbind (); | 779 | _fbo->unbind (); |
441 | 738 | 780 | ||
442 | 739 | /* Draw the bit of the relevant framebuffer for each output */ | 781 | /* Draw the bit of the relevant framebuffer for each output */ |
443 | @@ -748,7 +790,7 @@ | |||
444 | 748 | glPopMatrix (); | 790 | glPopMatrix (); |
445 | 749 | } | 791 | } |
446 | 750 | 792 | ||
448 | 751 | nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture = | 793 | nux::ObjectPtr<nux::IOpenGLBaseTexture> device_texture = |
449 | 752 | nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(_fbo->texture(), | 794 | nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(_fbo->texture(), |
450 | 753 | screen->width (), screen->height(), 1, nux::BITFMT_R8G8B8A8); | 795 | screen->width (), screen->height(), 1, nux::BITFMT_R8G8B8A8); |
451 | 754 | #else | 796 | #else |
452 | @@ -1217,6 +1259,7 @@ | |||
453 | 1217 | doShellRepaint = true; | 1259 | doShellRepaint = true; |
454 | 1218 | allowWindowPaint = true; | 1260 | allowWindowPaint = true; |
455 | 1219 | _last_output = output; | 1261 | _last_output = output; |
456 | 1262 | paint_panel_ = false; | ||
457 | 1220 | 1263 | ||
458 | 1221 | #ifndef USE_GLES | 1264 | #ifndef USE_GLES |
459 | 1222 | /* bind the framebuffer here | 1265 | /* bind the framebuffer here |
460 | @@ -2214,6 +2257,22 @@ | |||
461 | 2214 | const CompRegion& region, | 2257 | const CompRegion& region, |
462 | 2215 | unsigned int mask) | 2258 | unsigned int mask) |
463 | 2216 | { | 2259 | { |
464 | 2260 | if (uScreen->doShellRepaint && !uScreen->paint_panel_ && window->type() == CompWindowTypeNormalMask) | ||
465 | 2261 | { | ||
466 | 2262 | guint32 id = window->id(); | ||
467 | 2263 | bool maximized = WindowManager::Default()->IsWindowMaximized(id); | ||
468 | 2264 | bool on_current = window->onCurrentDesktop(); | ||
469 | 2265 | bool override_redirect = window->overrideRedirect(); | ||
470 | 2266 | bool managed = window->managed(); | ||
471 | 2267 | CompPoint viewport = window->defaultViewport(); | ||
472 | 2268 | int output = window->outputDevice(); | ||
473 | 2269 | |||
474 | 2270 | if (maximized && on_current && !override_redirect && managed && viewport == uScreen->screen->vp() && output == (int)uScreen->screen->currentOutputDev().id()) | ||
475 | 2271 | { | ||
476 | 2272 | uScreen->paint_panel_ = true; | ||
477 | 2273 | } | ||
478 | 2274 | } | ||
479 | 2275 | |||
480 | 2217 | if (uScreen->doShellRepaint && !uScreen->forcePaintOnTop ()) | 2276 | if (uScreen->doShellRepaint && !uScreen->forcePaintOnTop ()) |
481 | 2218 | { | 2277 | { |
482 | 2219 | std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList(); | 2278 | std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList(); |
483 | @@ -2222,6 +2281,7 @@ | |||
484 | 2222 | for (CompWindow* w = window; w && uScreen->doShellRepaint; w = w->prev) | 2281 | for (CompWindow* w = window; w && uScreen->doShellRepaint; w = w->prev) |
485 | 2223 | { | 2282 | { |
486 | 2224 | auto id = w->id(); | 2283 | auto id = w->id(); |
487 | 2284 | |||
488 | 2225 | for (unsigned int i = 0; i < size; ++i) | 2285 | for (unsigned int i = 0; i < size; ++i) |
489 | 2226 | { | 2286 | { |
490 | 2227 | if (xwns[i] == id) | 2287 | if (xwns[i] == id) |
491 | 2228 | 2288 | ||
492 | === modified file 'plugins/unityshell/src/unityshell.h' | |||
493 | --- plugins/unityshell/src/unityshell.h 2012-04-05 03:21:31 +0000 | |||
494 | +++ plugins/unityshell/src/unityshell.h 2012-04-05 06:31:21 +0000 | |||
495 | @@ -273,6 +273,8 @@ | |||
496 | 273 | 273 | ||
497 | 274 | void InitHints(); | 274 | void InitHints(); |
498 | 275 | 275 | ||
499 | 276 | void OnPanelStyleChanged(); | ||
500 | 277 | |||
501 | 276 | dash::Settings dash_settings_; | 278 | dash::Settings dash_settings_; |
502 | 277 | dash::Style dash_style_; | 279 | dash::Style dash_style_; |
503 | 278 | panel::Style panel_style_; | 280 | panel::Style panel_style_; |
504 | @@ -342,6 +344,10 @@ | |||
505 | 342 | 344 | ||
506 | 343 | GLMatrix panel_shadow_matrix_; | 345 | GLMatrix panel_shadow_matrix_; |
507 | 344 | 346 | ||
508 | 347 | bool panel_texture_has_changed_; | ||
509 | 348 | bool paint_panel_; | ||
510 | 349 | nux::ObjectPtr<nux::IOpenGLBaseTexture> panel_texture_; | ||
511 | 350 | |||
512 | 345 | #ifndef USE_GLES | 351 | #ifndef USE_GLES |
513 | 346 | ScreenEffectFramebufferObject::GLXGetProcAddressProc glXGetProcAddressP; | 352 | ScreenEffectFramebufferObject::GLXGetProcAddressProc glXGetProcAddressP; |
514 | 347 | #endif | 353 | #endif |
Works fine for me, +1