diff options
| author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2018-02-21 15:26:56 +0000 |
|---|---|---|
| committer | Bileto Bot <ci-train-bot@canonical.com> | 2018-02-21 15:26:56 +0000 |
| commit | 8cfd8242218d4f3ccba88b81921fa46e67df11b5 (patch) | |
| tree | 4d292bd4d4b0900b20d7f8fa8bec0ab74754a155 | |
| parent | 8b9490c7028ebbc30c5278c0eead0b5f6ead6b70 (diff) | |
| parent | e308c3cfb8962bdb6160173cc97555656d8634ef (diff) | |
CairoBaseWindow: don't try to compute the blur of an invalid texture
Nux isn't smart enough to protect us. (LP: #1290056) Approved by: Andrea Azzarone (bzr r4267)
| -rw-r--r-- | launcher/CairoBaseWindow.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/launcher/CairoBaseWindow.cpp b/launcher/CairoBaseWindow.cpp index 83472e202..5de652fb2 100644 --- a/launcher/CairoBaseWindow.cpp +++ b/launcher/CairoBaseWindow.cpp @@ -110,8 +110,14 @@ void CairoBaseWindow::Draw(nux::GraphicsEngine& gfxContext, bool forceDraw) nux::ObjectPtr <nux::IOpenGLBaseTexture> bkg_texture = gfxContext.CreateTextureFromBackBuffer(base.x, base.y, base.width, base.height); - nux::TexCoordXForm texxform_bkg; - bg_blur_texture_ = gfxContext.QRP_GetBlurTexture(0, 0, base.width, base.height, bkg_texture, texxform_bkg, nux::color::White, 1.0f, 3); + if (bkg_texture.IsValid()) + { + nux::TexCoordXForm texxform_bkg; + bg_blur_texture_ = gfxContext.QRP_GetBlurTexture(0, 0, base.width, base.height, bkg_texture, texxform_bkg, nux::color::White, 1.0f, 3); + + if (bg_blur_texture_) + compute_blur_bkg_ = false; + } if (current_fbo.IsValid()) { @@ -124,7 +130,6 @@ void CairoBaseWindow::Draw(nux::GraphicsEngine& gfxContext, bool forceDraw) gfxContext.Push2DWindow(gfxContext.GetWindowWidth(), gfxContext.GetWindowHeight()); gfxContext.ApplyClippingRectangle(); } - compute_blur_bkg_ = false; } // the elements position inside the window are referenced to top-left window |
