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 | cache_dirty = false; |
6 | return blur_texture_; |
7 | } |
8 | + |
9 | +nux::ObjectPtr<nux::IOpenGLBaseTexture> BackgroundEffectHelper::GetRegion(nux::Geometry geo, bool force_update) |
10 | +{ |
11 | + bool should_update = force_update || cache_dirty; |
12 | + |
13 | + /* Static blur: only update when the size changed */ |
14 | + if ((!should_update) |
15 | + && blur_texture_.IsValid() |
16 | + && (geo == blur_geometry_)) |
17 | + { |
18 | + return blur_texture_; |
19 | + } |
20 | + |
21 | + nux::GraphicsEngine* graphics_engine = nux::GetGraphicsDisplay()->GetGraphicsEngine(); |
22 | + |
23 | + int monitor_width = BackgroundEffectHelper::monitor_rect_.width; |
24 | + int monitor_height = BackgroundEffectHelper::monitor_rect_.height; |
25 | + |
26 | + nux::Geometry temp = geo; |
27 | + temp.OffsetPosition(-monitor_rect_.x, -monitor_rect_.y); |
28 | + blur_geometry_ = nux::Geometry(0, 0, monitor_width, monitor_height).Intersect(temp); |
29 | + |
30 | + nux::GpuDevice* gpu_device = nux::GetGraphicsDisplay()->GetGpuDevice(); |
31 | + if (blur_geometry_.IsNull() || !gpu_device->backup_texture0_.IsValid()) |
32 | + { |
33 | + return nux::ObjectPtr<nux::IOpenGLBaseTexture>(); |
34 | + } |
35 | + |
36 | + // save the current fbo |
37 | + nux::ObjectPtr<nux::IOpenGLFrameBufferObject> current_fbo = gpu_device->GetCurrentFrameBufferObject(); |
38 | + gpu_device->DeactivateFrameBuffer(); |
39 | + |
40 | + // Set a viewport to the requested size |
41 | + // FIXME: We need to do multiple passes for the dirty region |
42 | + // on the underlying backup texture so that we're only updating |
43 | + // the bits that we need |
44 | + graphics_engine->SetViewport(0, 0, blur_geometry_.width, blur_geometry_.height); |
45 | + graphics_engine->SetScissor(0, 0, blur_geometry_.width, blur_geometry_.height); |
46 | + // Disable nux scissoring |
47 | + graphics_engine->GetRenderStates ().EnableScissor (false); |
48 | + |
49 | + // The background texture is the same size as the monitor where we are rendering. |
50 | + nux::TexCoordXForm texxform__bg; |
51 | + texxform__bg.flip_v_coord = false; |
52 | + texxform__bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
53 | + texxform__bg.uoffset = ((float) blur_geometry_.x) / monitor_width; |
54 | + texxform__bg.voffset = ((float) monitor_height - blur_geometry_.y - blur_geometry_.height) / monitor_height; |
55 | + |
56 | + { |
57 | + nux::ObjectPtr<nux::IOpenGLBaseTexture> device_texture = gpu_device->backup_texture0_; |
58 | + nux::ObjectPtr<nux::CachedBaseTexture> noise_device_texture = graphics_engine->CacheResource(noise_texture_); |
59 | + |
60 | + unsigned int offset = 0; |
61 | + int quad_width = blur_geometry_.width; |
62 | + int quad_height = blur_geometry_.height; |
63 | + |
64 | + unsigned int buffer_width = quad_width + 2 * offset; |
65 | + unsigned int buffer_height = quad_height + 2 * offset; |
66 | + |
67 | + texxform__bg.SetFilter(nux::TEXFILTER_NEAREST, nux::TEXFILTER_NEAREST); |
68 | + texxform__bg.flip_v_coord = true; |
69 | + |
70 | + // Copy source texture |
71 | + graphics_engine->QRP_GetCopyTexture(buffer_width, buffer_height, |
72 | + blur_texture_, device_texture, |
73 | + texxform__bg, nux::color::White); |
74 | + } |
75 | + |
76 | + if (current_fbo.IsValid()) |
77 | + { |
78 | + current_fbo->Activate(true); |
79 | + graphics_engine->Push2DWindow(current_fbo->GetWidth(), current_fbo->GetHeight()); |
80 | + graphics_engine->GetRenderStates ().EnableScissor (true); |
81 | + } |
82 | + else |
83 | + { |
84 | + graphics_engine->SetViewport(0, 0, monitor_width, monitor_height); |
85 | + graphics_engine->Push2DWindow(monitor_width, monitor_height); |
86 | + |
87 | + graphics_engine->ApplyClippingRectangle(); |
88 | + } |
89 | + |
90 | + cache_dirty = false; |
91 | + return blur_texture_; |
92 | +} |
93 | + |
94 | |
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 | // We could add more functions here to get different types of effects based on the background texture |
100 | nux::ObjectPtr<nux::IOpenGLBaseTexture> GetPixelatedRegion(nux::Rect rect, int pixel_size, bool update); |
101 | |
102 | + nux::ObjectPtr<nux::IOpenGLBaseTexture> GetRegion(nux::Geometry geo, bool force_update = false); |
103 | + |
104 | void DirtyCache(); |
105 | |
106 | static void ProcessDamage(nux::Geometry geo); |
107 | |
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 | |
113 | if (IsOverlayOpen()) |
114 | { |
115 | + nux::Geometry blur_geo(geo_absolute.x, geo_absolute.y, base.width, base.height); |
116 | + nux::ObjectPtr<nux::IOpenGLBaseTexture> blur_texture; |
117 | + |
118 | if (BackgroundEffectHelper::blur_type != unity::BLUR_NONE && (bkg_box.x + bkg_box.width > 0)) |
119 | { |
120 | - nux::Geometry blur_geo(geo_absolute.x, geo_absolute.y, base.width, base.height); |
121 | - auto blur_texture = bg_effect_helper_.GetBlurRegion(blur_geo); |
122 | - |
123 | - if (blur_texture.IsValid()) |
124 | - { |
125 | - nux::TexCoordXForm texxform_blur_bg; |
126 | - texxform_blur_bg.flip_v_coord = true; |
127 | - texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
128 | - texxform_blur_bg.uoffset = ((float) base.x) / geo_absolute.width; |
129 | - texxform_blur_bg.voffset = ((float) base.y) / geo_absolute.height; |
130 | - |
131 | - GfxContext.PushClippingRectangle(bkg_box); |
132 | + blur_texture = bg_effect_helper_.GetBlurRegion(blur_geo); |
133 | + } |
134 | + else |
135 | + { |
136 | + blur_texture = bg_effect_helper_.GetRegion(blur_geo); |
137 | + } |
138 | + |
139 | + if (blur_texture.IsValid()) |
140 | + { |
141 | + nux::TexCoordXForm texxform_blur_bg; |
142 | + texxform_blur_bg.flip_v_coord = true; |
143 | + texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
144 | + texxform_blur_bg.uoffset = ((float) base.x) / geo_absolute.width; |
145 | + texxform_blur_bg.voffset = ((float) base.y) / geo_absolute.height; |
146 | + |
147 | + GfxContext.PushClippingRectangle(bkg_box); |
148 | |
149 | #ifndef NUX_OPENGLES_20 |
150 | - if (GfxContext.UsingGLSLCodePath()) |
151 | - gPainter.PushDrawCompositionLayer(GfxContext, base, |
152 | - blur_texture, |
153 | - texxform_blur_bg, |
154 | - nux::color::White, |
155 | - _background_color, nux::LAYER_BLEND_MODE_OVERLAY, |
156 | - true, ROP); |
157 | - else |
158 | - gPainter.PushDrawTextureLayer(GfxContext, base, |
159 | - blur_texture, |
160 | - texxform_blur_bg, |
161 | - nux::color::White, |
162 | - true, |
163 | - ROP); |
164 | + if (GfxContext.UsingGLSLCodePath()) |
165 | + gPainter.PushDrawCompositionLayer(GfxContext, base, |
166 | + blur_texture, |
167 | + texxform_blur_bg, |
168 | + nux::color::White, |
169 | + _background_color, nux::LAYER_BLEND_MODE_OVERLAY, |
170 | + true, ROP); |
171 | + else |
172 | + gPainter.PushDrawTextureLayer(GfxContext, base, |
173 | + blur_texture, |
174 | + texxform_blur_bg, |
175 | + nux::color::White, |
176 | + true, |
177 | + ROP); |
178 | #else |
179 | - gPainter.PushDrawCompositionLayer(GfxContext, base, |
180 | - blur_texture, |
181 | - texxform_blur_bg, |
182 | - nux::color::White, |
183 | - _background_color, nux::LAYER_BLEND_MODE_OVERLAY, |
184 | - true, ROP); |
185 | + gPainter.PushDrawCompositionLayer(GfxContext, base, |
186 | + blur_texture, |
187 | + texxform_blur_bg, |
188 | + nux::color::White, |
189 | + _background_color, nux::LAYER_BLEND_MODE_OVERLAY, |
190 | + true, ROP); |
191 | #endif |
192 | - GfxContext.PopClippingRectangle(); |
193 | + GfxContext.PopClippingRectangle(); |
194 | |
195 | - push_count++; |
196 | - } |
197 | + push_count++; |
198 | } |
199 | |
200 | unsigned int alpha = 0, src = 0, dest = 0; |
201 | |
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 | texxform_absolute_bg.voffset = ((float) content_geo.y) / absolute_geo.height; |
207 | texxform_absolute_bg.SetWrap(nux::TEXWRAP_CLAMP, nux::TEXWRAP_CLAMP); |
208 | |
209 | + nux::Geometry blur_geo(absolute_geo.x, absolute_geo.y, content_geo.width, content_geo.height); |
210 | if (paint_blur) |
211 | { |
212 | - nux::Geometry blur_geo(absolute_geo.x, absolute_geo.y, content_geo.width, content_geo.height); |
213 | bg_blur_texture_ = bg_effect_helper_.GetBlurRegion(blur_geo); |
214 | - |
215 | - if (bg_blur_texture_.IsValid()) |
216 | - { |
217 | - nux::Geometry bg_clip = geo; |
218 | - gfx_context.PushClippingRectangle(bg_clip); |
219 | - |
220 | - gfx_context.GetRenderStates().SetBlend(false); |
221 | + } |
222 | + else |
223 | + { |
224 | + bg_blur_texture_ = bg_effect_helper_.GetRegion(blur_geo); |
225 | + } |
226 | + |
227 | + if (bg_blur_texture_.IsValid()) |
228 | + { |
229 | + nux::Geometry bg_clip = geo; |
230 | + gfx_context.PushClippingRectangle(bg_clip); |
231 | + |
232 | + gfx_context.GetRenderStates().SetBlend(false); |
233 | #ifndef NUX_OPENGLES_20 |
234 | - if (gfx_context.UsingGLSLCodePath()) |
235 | - gfx_context.QRP_GLSL_ColorBlendOverTex (content_geo.x, content_geo.y, |
236 | - content_geo.width, content_geo.height, |
237 | - bg_blur_texture_, texxform_absolute_bg, nux::color::White, |
238 | - bg_color_, nux::LAYER_BLEND_MODE_OVERLAY); |
239 | + if (gfx_context.UsingGLSLCodePath()) |
240 | + gfx_context.QRP_GLSL_ColorBlendOverTex (content_geo.x, content_geo.y, |
241 | + content_geo.width, content_geo.height, |
242 | + bg_blur_texture_, texxform_absolute_bg, nux::color::White, |
243 | + bg_color_, nux::LAYER_BLEND_MODE_OVERLAY); |
244 | |
245 | - else |
246 | - gfx_context.QRP_1Tex (content_geo.x, content_geo.y, |
247 | - content_geo.width, content_geo.height, |
248 | - bg_blur_texture_, texxform_absolute_bg, nux::color::White); |
249 | + else |
250 | + gfx_context.QRP_1Tex (content_geo.x, content_geo.y, |
251 | + content_geo.width, content_geo.height, |
252 | + bg_blur_texture_, texxform_absolute_bg, nux::color::White); |
253 | #else |
254 | - gfx_context.QRP_GLSL_ColorBlendOverTex (content_geo.x, content_geo.y, |
255 | - content_geo.width, content_geo.height, |
256 | - bg_blur_texture_, texxform_absolute_bg, nux::color::White, |
257 | - bg_color_, nux::LAYER_BLEND_MODE_OVERLAY); |
258 | + gfx_context.QRP_GLSL_ColorBlendOverTex (content_geo.x, content_geo.y, |
259 | + content_geo.width, content_geo.height, |
260 | + bg_blur_texture_, texxform_absolute_bg, nux::color::White, |
261 | + bg_color_, nux::LAYER_BLEND_MODE_OVERLAY); |
262 | |
263 | #endif |
264 | - gPainter.PopBackground(); |
265 | |
266 | - gfx_context.PopClippingRectangle(); |
267 | - } |
268 | + gfx_context.PopClippingRectangle(); |
269 | } |
270 | |
271 | // Draw the left and top lines |
272 | @@ -376,7 +379,6 @@ |
273 | |
274 | void OverlayRendererImpl::DrawContent(nux::GraphicsEngine& gfx_context, nux::Geometry content_geo, nux::Geometry absolute_geo, nux::Geometry geometry) |
275 | { |
276 | - bool paint_blur = BackgroundEffectHelper::blur_type != BLUR_NONE; |
277 | nux::Geometry geo = geometry; |
278 | bgs = 0; |
279 | |
280 | @@ -397,7 +399,7 @@ |
281 | rop.SrcBlend = GL_ONE; |
282 | rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; |
283 | |
284 | - if (bg_blur_texture_.IsValid() && paint_blur) |
285 | + if (bg_blur_texture_.IsValid()) |
286 | { |
287 | #ifndef NUX_OPENGLES_20 |
288 | if (gfx_context.UsingGLSLCodePath()) |
289 | |
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 | |
295 | GfxContext.PushClippingRectangle(GetGeometry()); |
296 | |
297 | - if (BackgroundEffectHelper::blur_type != BLUR_NONE && (_overlay_is_open || (_opacity != 1.0f && _opacity != 0.0f))) |
298 | + if ((_overlay_is_open || (_opacity != 1.0f && _opacity != 0.0f))) |
299 | { |
300 | nux::Geometry blur_geo(geo_absolute.x, geo_absolute.y, geo.width, geo.height); |
301 | - bg_blur_texture_ = bg_effect_helper_.GetBlurRegion(blur_geo); |
302 | + |
303 | + if (BackgroundEffectHelper::blur_type != BLUR_NONE) |
304 | + { |
305 | + bg_blur_texture_ = bg_effect_helper_.GetBlurRegion(blur_geo); |
306 | + } |
307 | + else |
308 | + { |
309 | + bg_blur_texture_ = bg_effect_helper_.GetRegion(blur_geo); |
310 | + } |
311 | |
312 | - if (bg_blur_texture_.IsValid() && BackgroundEffectHelper::blur_type != BLUR_NONE && (_overlay_is_open || _opacity != 1.0f)) |
313 | + if (bg_blur_texture_.IsValid() && (_overlay_is_open || _opacity != 1.0f)) |
314 | { |
315 | nux::TexCoordXForm texxform_blur_bg; |
316 | texxform_blur_bg.flip_v_coord = true; |
317 | @@ -318,7 +326,7 @@ |
318 | GfxContext.GetRenderStates().SetBlend(true); |
319 | GfxContext.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
320 | |
321 | - if (bg_blur_texture_.IsValid() && BackgroundEffectHelper::blur_type != BLUR_NONE && (_overlay_is_open || (_opacity != 1.0f && _opacity != 0.0f))) |
322 | + if (bg_blur_texture_.IsValid() && (_overlay_is_open || (_opacity != 1.0f && _opacity != 0.0f))) |
323 | { |
324 | nux::Geometry geo_absolute = GetAbsoluteGeometry (); |
325 | nux::TexCoordXForm texxform_blur_bg; |
326 | |
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 | nux::Geometry const& base = GetGeometry(); |
332 | graphics_engine.PushClippingRectangle(base); |
333 | |
334 | - nux::GetPainter().PaintBackground(graphics_engine, base); |
335 | - |
336 | if (ShouldBeHighlighted()) |
337 | { |
338 | nux::Geometry geo(_header_layout->GetGeometry()); |
339 | |
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 | |
345 | void ResultViewGrid::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) |
346 | { |
347 | - gPainter.PaintBackground(GfxContext, GetGeometry()); |
348 | - |
349 | int items_per_row = GetItemsPerRow(); |
350 | uint total_rows = (!expanded) ? 0 : (results_.size() / items_per_row) + 1; |
351 | |
352 | |
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 | |
358 | void unity::ScreenEffectFramebufferObject::bind (const nux::Geometry &output) |
359 | { |
360 | - if (!BackgroundEffectHelper::HasDirtyHelpers()) |
361 | - return; |
362 | - |
363 | /* Clear the error bit */ |
364 | glGetError (); |
365 | |
366 | |
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 | , painting_tray_ (false) |
372 | , last_scroll_event_(0) |
373 | , hud_keypress_time_(0) |
374 | + , panel_texture_has_changed_(true) |
375 | + , paint_panel_(false) |
376 | { |
377 | Timer timer; |
378 | gfloat version; |
379 | @@ -371,8 +373,11 @@ |
380 | |
381 | RaiseInputWindows(); |
382 | }); |
383 | - LOG_INFO(logger) << "UnityScreen constructed: " << timer.ElapsedSeconds() << "s"; |
384 | + |
385 | + LOG_INFO(logger) << "UnityScreen constructed: " << timer.ElapsedSeconds() << "s"; |
386 | } |
387 | + |
388 | + panel::Style::Instance().changed.connect(sigc::mem_fun(this, &UnityScreen::OnPanelStyleChanged)); |
389 | } |
390 | |
391 | UnityScreen::~UnityScreen() |
392 | @@ -723,6 +728,12 @@ |
393 | wy = y + (last_bound.height - height) / 2; |
394 | } |
395 | |
396 | +void |
397 | +UnityScreen::OnPanelStyleChanged() |
398 | +{ |
399 | + panel_texture_has_changed_ = true; |
400 | +} |
401 | + |
402 | #ifdef USE_GLES |
403 | void UnityScreen::paintDisplay() |
404 | #else |
405 | @@ -734,6 +745,37 @@ |
406 | |
407 | #ifndef USE_GLES |
408 | bool was_bound = _fbo->bound (); |
409 | + |
410 | + if (was_bound && launcher_controller_->IsOverlayOpen() && paint_panel_) |
411 | + { |
412 | + if (panel_texture_has_changed_ || !panel_texture_.IsValid()) |
413 | + { |
414 | + panel_texture_.Release(); |
415 | + |
416 | + nux::NBitmapData* bitmap = panel::Style::Instance().GetBackground(screen->width (), screen->height(), 1.0f); |
417 | + nux::BaseTexture* texture2D = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture(); |
418 | + if (bitmap && texture2D) |
419 | + { |
420 | + texture2D->Update(bitmap); |
421 | + panel_texture_ = texture2D->GetDeviceTexture(); |
422 | + texture2D->UnReference(); |
423 | + delete bitmap; |
424 | + } |
425 | + panel_texture_has_changed_ = false; |
426 | + } |
427 | + |
428 | + if (panel_texture_.IsValid()) |
429 | + { |
430 | + nux::GetGraphicsDisplay()->GetGraphicsEngine()->ResetModelViewMatrixStack(); |
431 | + nux::GetGraphicsDisplay()->GetGraphicsEngine()->Push2DTranslationModelViewMatrix(0.0f, 0.0f, 0.0f); |
432 | + nux::GetGraphicsDisplay()->GetGraphicsEngine()->ResetProjectionMatrix(); |
433 | + nux::GetGraphicsDisplay()->GetGraphicsEngine()->SetOrthographicProjectionMatrix(screen->width (), screen->height()); |
434 | + |
435 | + nux::TexCoordXForm texxform; |
436 | + nux::GetGraphicsDisplay()->GetGraphicsEngine()->QRP_GLSL_1Tex(0, 0, screen->width (), 24, panel_texture_, texxform, nux::color::White); |
437 | + } |
438 | + } |
439 | + |
440 | _fbo->unbind (); |
441 | |
442 | /* Draw the bit of the relevant framebuffer for each output */ |
443 | @@ -748,7 +790,7 @@ |
444 | glPopMatrix (); |
445 | } |
446 | |
447 | - nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture = |
448 | + nux::ObjectPtr<nux::IOpenGLBaseTexture> device_texture = |
449 | nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(_fbo->texture(), |
450 | screen->width (), screen->height(), 1, nux::BITFMT_R8G8B8A8); |
451 | #else |
452 | @@ -1217,6 +1259,7 @@ |
453 | doShellRepaint = true; |
454 | allowWindowPaint = true; |
455 | _last_output = output; |
456 | + paint_panel_ = false; |
457 | |
458 | #ifndef USE_GLES |
459 | /* bind the framebuffer here |
460 | @@ -2214,6 +2257,22 @@ |
461 | const CompRegion& region, |
462 | unsigned int mask) |
463 | { |
464 | + if (uScreen->doShellRepaint && !uScreen->paint_panel_ && window->type() == CompWindowTypeNormalMask) |
465 | + { |
466 | + guint32 id = window->id(); |
467 | + bool maximized = WindowManager::Default()->IsWindowMaximized(id); |
468 | + bool on_current = window->onCurrentDesktop(); |
469 | + bool override_redirect = window->overrideRedirect(); |
470 | + bool managed = window->managed(); |
471 | + CompPoint viewport = window->defaultViewport(); |
472 | + int output = window->outputDevice(); |
473 | + |
474 | + if (maximized && on_current && !override_redirect && managed && viewport == uScreen->screen->vp() && output == (int)uScreen->screen->currentOutputDev().id()) |
475 | + { |
476 | + uScreen->paint_panel_ = true; |
477 | + } |
478 | + } |
479 | + |
480 | if (uScreen->doShellRepaint && !uScreen->forcePaintOnTop ()) |
481 | { |
482 | std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList(); |
483 | @@ -2222,6 +2281,7 @@ |
484 | for (CompWindow* w = window; w && uScreen->doShellRepaint; w = w->prev) |
485 | { |
486 | auto id = w->id(); |
487 | + |
488 | for (unsigned int i = 0; i < size; ++i) |
489 | { |
490 | if (xwns[i] == id) |
491 | |
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 | |
497 | void InitHints(); |
498 | |
499 | + void OnPanelStyleChanged(); |
500 | + |
501 | dash::Settings dash_settings_; |
502 | dash::Style dash_style_; |
503 | panel::Style panel_style_; |
504 | @@ -342,6 +344,10 @@ |
505 | |
506 | GLMatrix panel_shadow_matrix_; |
507 | |
508 | + bool panel_texture_has_changed_; |
509 | + bool paint_panel_; |
510 | + nux::ObjectPtr<nux::IOpenGLBaseTexture> panel_texture_; |
511 | + |
512 | #ifndef USE_GLES |
513 | ScreenEffectFramebufferObject::GLXGetProcAddressProc glXGetProcAddressP; |
514 | #endif |
Works fine for me, +1