summaryrefslogtreecommitdiff
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2018-02-19 16:20:19 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2018-02-19 16:20:19 +0100
commite308c3cfb8962bdb6160173cc97555656d8634ef (patch)
tree28bf062179c4091a722bdd5ce63680d9fb432f51
parent008bf57d7e80a7859881afd38179dc6be3be8116 (diff)
CairoBaseWindow: don't try to compute the blur of an invalid texture
Nux isn't smart enough to protect us. Fixes LP: #1290056 (bzr r4265.2.1)
-rw-r--r--launcher/CairoBaseWindow.cpp11
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