diff options
| author | Andrea Azzarone <azzaronea@gmail.com> | 2012-09-05 09:34:41 +0200 |
|---|---|---|
| committer | Andrea Azzarone <azzaronea@gmail.com> | 2012-09-05 09:34:41 +0200 |
| commit | 0935bd689f478968513fbe913eefd5aec21a46e1 (patch) | |
| tree | 2da79ab4dacfe854c4fc312c2396bee149045265 /plugins/unityshell/src | |
| parent | d5893765285fcc917799a8f503cb54fcc3691147 (diff) | |
Re-add code to draw panel background texture when the dash is open and there is a maximized window.
(bzr r2637.7.3)
Diffstat (limited to 'plugins/unityshell/src')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index e3c187d7d..9cd14f321 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -675,24 +675,61 @@ void UnityScreen::paintDisplay() { CompOutput *output = _last_output; + auto graphics_engine = nux::GetGraphicsDisplay()->GetGraphicsEngine(); + auto gpu_device = nux::GetGraphicsDisplay()->GetGpuDevice(); + + if (graphics_engine->UsingGLSLCodePath()) + { + if (launcher_controller_->IsOverlayOpen() && paint_panel_) + { + if (panel_texture_has_changed_ || !panel_texture_.IsValid()) + { + panel_texture_.Release(); + + nux::NBitmapData* bitmap = panel::Style::Instance().GetBackground(screen->width (), screen->height(), 1.0f); + nux::BaseTexture* texture2D = gpu_device->CreateSystemCapableTexture(); + if (bitmap && texture2D) + { + texture2D->Update(bitmap); + panel_texture_ = texture2D->GetDeviceTexture(); + texture2D->UnReference(); + delete bitmap; + } + panel_texture_has_changed_ = false; + } + + if (panel_texture_.IsValid()) + { + graphics_engine->ResetModelViewMatrixStack(); + graphics_engine->Push2DTranslationModelViewMatrix(0.0f, 0.0f, 0.0f); + graphics_engine->ResetProjectionMatrix(); + graphics_engine->SetOrthographicProjectionMatrix(screen->width (), screen->height()); + + nux::TexCoordXForm texxform; + int panel_height = panel_style_.panel_height; + graphics_engine->QRP_GLSL_1Tex(0, 0, screen->width (), panel_height, panel_texture_, texxform, nux::color::White); + } + } + } + nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture = - nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(gScreen->fbo ()->tex ()->name (), - screen->width(), screen->height(), 1, nux::BITFMT_R8G8B8A8); + gpu_device->CreateTexture2DFromID(gScreen->fbo ()->tex ()->name (), + screen->width(), screen->height(), 1, nux::BITFMT_R8G8B8A8); - nux::GetGraphicsDisplay()->GetGpuDevice()->backup_texture0_ = device_texture; + gpu_device->backup_texture0_ = device_texture; - nux::Geometry geo = nux::Geometry (0, 0, screen->width (), screen->height ()); - nux::Geometry oGeo = nux::Geometry (output->x (), output->y (), output->width (), output->height ()); + nux::Geometry geo(0, 0, screen->width (), screen->height ()); + nux::Geometry outputGeo(output->x (), output->y (), output->width (), output->height ()); BackgroundEffectHelper::monitor_rect_ = geo; GLint fboID; // Nux renders to the referenceFramebuffer when it's embedded. glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fboID); - wt->GetWindowCompositor().SetReferenceFramebuffer(fboID, oGeo); + wt->GetWindowCompositor().SetReferenceFramebuffer(fboID, outputGeo); nuxPrologue(); _in_paint = true; - wt->RenderInterfaceFromForeignCmd (&oGeo); + wt->RenderInterfaceFromForeignCmd (&outputGeo); _in_paint = false; nuxEpilogue(); |
