From b9528ac291c0d0a3bb4a987c8ba58082a14060de Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Wed, 19 Sep 2012 19:25:16 +0800 Subject: Don't keep re-blurring parts of the shell we've already painted, because that will creep in and look like a shadow on the edge of the blur region. (LP: #1043260) This happens when the same texture (the FBO texture) is both the source and the destination for the three blur operations (launcher, panel, then dash). My quick fix is to take a copy of the FBO texture at the start of the frame (before any shell is painted), rather than reading from the same texture (FBO) that we're writing to. This also fixes LP: #1039999, because we are no longer assuming the backbuffer is an FBO. Instead we let Nux decide and take the right steps to read the real backbuffer, whatever that is. Fixed bugs: - LP: #1043260 - LP: #1039999 (bzr r2713.7.1) --- plugins/unityshell/src/unityshell.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins/unityshell/src') diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 87e297d44..50ac4e212 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -663,11 +663,13 @@ void UnityScreen::paintDisplay() auto gpu_device = nux::GetGraphicsDisplay()->GetGpuDevice(); - nux::ObjectPtr device_texture = - gpu_device->CreateTexture2DFromID(gScreen->fbo ()->tex ()->name (), - screen->width(), screen->height(), 1, nux::BITFMT_R8G8B8A8); + auto graphics_engine = nux::GetGraphicsDisplay()->GetGraphicsEngine(); + nux::ObjectPtr bg_texture = + graphics_engine->CreateTextureFromBackBuffer(0, 0, + screen->width(), + screen->height()); - gpu_device->backup_texture0_ = device_texture; + gpu_device->backup_texture0_ = bg_texture; nux::Geometry geo(0, 0, screen->width (), screen->height ()); nux::Geometry outputGeo(output->x (), output->y (), output->width (), output->height ()); -- cgit v1.2.3 From b59ba8dad431b4be90cf9f5d2fea10be153f2a96 Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Wed, 19 Sep 2012 19:50:07 +0800 Subject: Try not to slow the system down on every unity frame. Just when blurs need updating. (bzr r2713.7.2) --- plugins/unityshell/src/unityshell.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'plugins/unityshell/src') diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 50ac4e212..1f51c73fe 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -663,13 +663,15 @@ void UnityScreen::paintDisplay() auto gpu_device = nux::GetGraphicsDisplay()->GetGpuDevice(); - auto graphics_engine = nux::GetGraphicsDisplay()->GetGraphicsEngine(); - nux::ObjectPtr bg_texture = - graphics_engine->CreateTextureFromBackBuffer(0, 0, - screen->width(), - screen->height()); - - gpu_device->backup_texture0_ = bg_texture; + if (BackgroundEffectHelper::HasDirtyHelpers()) + { + auto graphics_engine = nux::GetGraphicsDisplay()->GetGraphicsEngine(); + nux::ObjectPtr bg_texture = + graphics_engine->CreateTextureFromBackBuffer(0, 0, + screen->width(), + screen->height()); + gpu_device->backup_texture0_ = bg_texture; + } nux::Geometry geo(0, 0, screen->width (), screen->height ()); nux::Geometry outputGeo(output->x (), output->y (), output->width (), output->height ()); -- cgit v1.2.3