Merge lp:~nick-dedekind/unity/lp1059607.dash-filter-redraw into lp:unity

Proposed by Nick Dedekind
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 2796
Proposed branch: lp:~nick-dedekind/unity/lp1059607.dash-filter-redraw
Merge into: lp:unity
Diff against target: 67 lines (+36/-0)
1 file modified
dash/LensView.cpp (+36/-0)
To merge this branch: bzr merge lp:~nick-dedekind/unity/lp1059607.dash-filter-redraw
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
Review via email: mp+127447@code.launchpad.net

Commit message

Fixed dash filter redraw issue (LP: #1059607)

Description of the change

Fixed dash filter redraw issue (LP: #1059607)

Redirected parent redraw check in Lens view.

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Normally things should get merged with trunk first, then backported.

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dash/LensView.cpp'
2--- dash/LensView.cpp 2012-09-19 18:45:56 +0000
3+++ dash/LensView.cpp 2012-10-02 10:22:22 +0000
4@@ -22,6 +22,8 @@
5 #include <boost/lexical_cast.hpp>
6
7 #include <NuxCore/Logger.h>
8+#include <Nux/HScrollBar.h>
9+#include <Nux/VScrollBar.h>
10
11 #include "unity-shared/DashStyle.h"
12 #include "CoverflowResultView.h"
13@@ -96,6 +98,14 @@
14 up_area_ = area;
15 }
16
17+ void RedrawScrollbars()
18+ {
19+ if (m_horizontal_scrollbar_enable)
20+ _hscrollbar->QueueDraw();
21+ if (m_vertical_scrollbar_enable)
22+ _vscrollbar->QueueDraw();
23+ }
24+
25 protected:
26
27 // This is so we can break the natural key navigation path.
28@@ -662,6 +672,16 @@
29 nux::Geometry const& geo = GetGeometry();
30
31 gfx_context.PushClippingRectangle(geo);
32+
33+ if (RedirectedAncestor())
34+ {
35+ unsigned int alpha = 0, src = 0, dest = 0;
36+ gfx_context.GetRenderStates().GetBlend(alpha, src, dest);
37+ gfx_context.GetRenderStates().SetBlend(false);
38+ gfx_context.QRP_Color(GetX(), GetY(), GetWidth(), GetHeight(), nux::Color(0.0f, 0.0f, 0.0f, 0.0f));
39+ gfx_context.GetRenderStates().SetBlend(alpha, src, dest);
40+ }
41+
42 nux::GetPainter().PaintBackground(gfx_context, geo);
43 gfx_context.PopClippingRectangle();
44 }
45@@ -669,6 +689,22 @@
46 void LensView::DrawContent(nux::GraphicsEngine& gfx_context, bool force_draw)
47 {
48 gfx_context.PushClippingRectangle(GetGeometry());
49+
50+ // This is necessary when doing redirected rendering.
51+ // Clean the area below this view before drawing anything.
52+ if (RedirectedAncestor() && !IsFullRedraw())
53+ {
54+ // scrollbars are drawn in Draw, not DrawContent, so we need to flag them to redraw.
55+ scroll_view_->RedrawScrollbars();
56+ fscroll_view_->RedrawScrollbars();
57+
58+ unsigned int alpha = 0, src = 0, dest = 0;
59+ gfx_context.GetRenderStates().GetBlend(alpha, src, dest);
60+ gfx_context.GetRenderStates().SetBlend(false);
61+ gfx_context.QRP_Color(GetX(), GetY(), GetWidth(), GetHeight(), nux::Color(0.0f, 0.0f, 0.0f, 0.0f));
62+ gfx_context.GetRenderStates().SetBlend(alpha, src, dest);
63+ }
64+
65 layout_->ProcessDraw(gfx_context, force_draw);
66 gfx_context.PopClippingRectangle();
67 }