Nux

Merge lp:~thumper/nux/next-changes into lp:nux

Proposed by Tim Penhey
Status: Work in progress
Proposed branch: lp:~thumper/nux/next-changes
Merge into: lp:nux
Prerequisite: lp:~thumper/nux/object-cleanup-attempt-2
Diff against target: 69 lines (+10/-4)
3 files modified
Nux/Painter.cpp (+6/-1)
Nux/Painter.h (+2/-2)
NuxGraphics/RenderingPipeGLSL.cpp (+2/-1)
To merge this branch: bzr merge lp:~thumper/nux/next-changes
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+72500@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

445. By Tim Penhey

Merge object cleanup branch.

444. By Tim Penhey

make the background stack private, and make sure the layers get deleted when the object is destroyed.

443. By Tim Penhey

Delete the shader_prog once we are done.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nux/Painter.cpp'
2--- Nux/Painter.cpp 2011-06-13 13:34:21 +0000
3+++ Nux/Painter.cpp 2011-08-22 21:31:36 +0000
4@@ -172,6 +172,7 @@
5
6 BasePainter::~BasePainter()
7 {
8+ EmptyBackgroundStack();
9 }
10
11 int BasePainter::PaintColorTextLineEdit (GraphicsEngine &GfxContext, const Geometry &g, const NString &Str,
12@@ -782,7 +783,7 @@
13
14 void BasePainter::PaintBackground (GraphicsEngine &GfxContext, const Geometry &geo)
15 {
16- if (m_BackgroundStack.begin () == m_BackgroundStack.end ())
17+ if (m_BackgroundStack.empty())
18 {
19 return;
20 }
21@@ -940,6 +941,10 @@
22
23 void BasePainter::EmptyBackgroundStack()
24 {
25+ for (auto layer : m_BackgroundStack)
26+ {
27+ delete layer;
28+ }
29 m_BackgroundStack.clear();
30 }
31
32
33=== modified file 'Nux/Painter.h'
34--- Nux/Painter.h 2011-05-10 23:31:36 +0000
35+++ Nux/Painter.h 2011-08-22 21:31:36 +0000
36@@ -309,10 +309,10 @@
37 void EmptyBackgroundStack();
38 void PaintBackground (GraphicsEngine &GfxContext, const Geometry &geo);
39
40+ private:
41+
42 std::list<AbstractPaintLayer *> m_BackgroundStack;
43
44- private:
45-
46 };
47
48
49
50=== modified file 'NuxGraphics/RenderingPipeGLSL.cpp'
51--- NuxGraphics/RenderingPipeGLSL.cpp 2011-08-19 02:44:33 +0000
52+++ NuxGraphics/RenderingPipeGLSL.cpp 2011-08-22 21:31:36 +0000
53@@ -761,7 +761,7 @@
54 _horizontal_hq_gauss_filter_prog[k-1]->AddShaderObject(PS);
55 CHECKGL(glBindAttribLocation(_horizontal_hq_gauss_filter_prog[k-1]->GetOpenGLID(), 0, "AVertex"));
56 _horizontal_hq_gauss_filter_prog[k-1]->Link();
57-
58+ delete [] shader_prog;
59 }
60
61 void GraphicsEngine::InitSLVerticalHQGaussFilter(int sigma)
62@@ -832,6 +832,7 @@
63 _vertical_hq_gauss_filter_prog[k-1]->AddShaderObject (PS);
64 CHECKGL ( glBindAttribLocation (_vertical_hq_gauss_filter_prog[k-1]->GetOpenGLID(), 0, "AVertex") );
65 _vertical_hq_gauss_filter_prog[k-1]->Link();
66+ delete [] shader_prog;
67 }
68
69 void GraphicsEngine::InitSLColorMatrixFilter ()

Subscribers

People subscribed via source and target branches