Merge lp:~3v1n0/unity/blurring-crash-fix into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 4267
Proposed branch: lp:~3v1n0/unity/blurring-crash-fix
Merge into: lp:unity
Diff against target: 28 lines (+8/-3)
1 file modified
launcher/CairoBaseWindow.cpp (+8/-3)
To merge this branch: bzr merge lp:~3v1n0/unity/blurring-crash-fix
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+337959@code.launchpad.net

Commit message

CairoBaseWindow: don't try to compute the blur of an invalid texture

Nux isn't smart enough to protect us.

Description of the change

As per https://errors.ubuntu.com/problem/23eed577b86c959a28589b8bb1a3bc6ee15b8694 bkg_texture is null, which leads to this error.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/CairoBaseWindow.cpp'
2--- launcher/CairoBaseWindow.cpp 2016-07-04 12:45:06 +0000
3+++ launcher/CairoBaseWindow.cpp 2018-02-21 14:35:25 +0000
4@@ -110,8 +110,14 @@
5
6 nux::ObjectPtr <nux::IOpenGLBaseTexture> bkg_texture = gfxContext.CreateTextureFromBackBuffer(base.x, base.y, base.width, base.height);
7
8- nux::TexCoordXForm texxform_bkg;
9- bg_blur_texture_ = gfxContext.QRP_GetBlurTexture(0, 0, base.width, base.height, bkg_texture, texxform_bkg, nux::color::White, 1.0f, 3);
10+ if (bkg_texture.IsValid())
11+ {
12+ nux::TexCoordXForm texxform_bkg;
13+ bg_blur_texture_ = gfxContext.QRP_GetBlurTexture(0, 0, base.width, base.height, bkg_texture, texxform_bkg, nux::color::White, 1.0f, 3);
14+
15+ if (bg_blur_texture_)
16+ compute_blur_bkg_ = false;
17+ }
18
19 if (current_fbo.IsValid())
20 {
21@@ -124,7 +130,6 @@
22 gfxContext.Push2DWindow(gfxContext.GetWindowWidth(), gfxContext.GetWindowHeight());
23 gfxContext.ApplyClippingRectangle();
24 }
25- compute_blur_bkg_ = false;
26 }
27
28 // the elements position inside the window are referenced to top-left window