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
=== modified file 'Nux/Painter.cpp'
--- Nux/Painter.cpp 2011-06-13 13:34:21 +0000
+++ Nux/Painter.cpp 2011-08-22 21:31:36 +0000
@@ -172,6 +172,7 @@
172172
173 BasePainter::~BasePainter()173 BasePainter::~BasePainter()
174 {174 {
175 EmptyBackgroundStack();
175 }176 }
176177
177 int BasePainter::PaintColorTextLineEdit (GraphicsEngine &GfxContext, const Geometry &g, const NString &Str,178 int BasePainter::PaintColorTextLineEdit (GraphicsEngine &GfxContext, const Geometry &g, const NString &Str,
@@ -782,7 +783,7 @@
782783
783 void BasePainter::PaintBackground (GraphicsEngine &GfxContext, const Geometry &geo)784 void BasePainter::PaintBackground (GraphicsEngine &GfxContext, const Geometry &geo)
784 {785 {
785 if (m_BackgroundStack.begin () == m_BackgroundStack.end ())786 if (m_BackgroundStack.empty())
786 {787 {
787 return;788 return;
788 }789 }
@@ -940,6 +941,10 @@
940941
941 void BasePainter::EmptyBackgroundStack()942 void BasePainter::EmptyBackgroundStack()
942 {943 {
944 for (auto layer : m_BackgroundStack)
945 {
946 delete layer;
947 }
943 m_BackgroundStack.clear();948 m_BackgroundStack.clear();
944 }949 }
945950
946951
=== modified file 'Nux/Painter.h'
--- Nux/Painter.h 2011-05-10 23:31:36 +0000
+++ Nux/Painter.h 2011-08-22 21:31:36 +0000
@@ -309,10 +309,10 @@
309 void EmptyBackgroundStack();309 void EmptyBackgroundStack();
310 void PaintBackground (GraphicsEngine &GfxContext, const Geometry &geo);310 void PaintBackground (GraphicsEngine &GfxContext, const Geometry &geo);
311311
312 private:
313
312 std::list<AbstractPaintLayer *> m_BackgroundStack;314 std::list<AbstractPaintLayer *> m_BackgroundStack;
313315
314 private:
315
316 };316 };
317317
318318
319319
=== modified file 'NuxGraphics/RenderingPipeGLSL.cpp'
--- NuxGraphics/RenderingPipeGLSL.cpp 2011-08-19 02:44:33 +0000
+++ NuxGraphics/RenderingPipeGLSL.cpp 2011-08-22 21:31:36 +0000
@@ -761,7 +761,7 @@
761 _horizontal_hq_gauss_filter_prog[k-1]->AddShaderObject(PS);761 _horizontal_hq_gauss_filter_prog[k-1]->AddShaderObject(PS);
762 CHECKGL(glBindAttribLocation(_horizontal_hq_gauss_filter_prog[k-1]->GetOpenGLID(), 0, "AVertex"));762 CHECKGL(glBindAttribLocation(_horizontal_hq_gauss_filter_prog[k-1]->GetOpenGLID(), 0, "AVertex"));
763 _horizontal_hq_gauss_filter_prog[k-1]->Link();763 _horizontal_hq_gauss_filter_prog[k-1]->Link();
764764 delete [] shader_prog;
765 }765 }
766766
767 void GraphicsEngine::InitSLVerticalHQGaussFilter(int sigma)767 void GraphicsEngine::InitSLVerticalHQGaussFilter(int sigma)
@@ -832,6 +832,7 @@
832 _vertical_hq_gauss_filter_prog[k-1]->AddShaderObject (PS);832 _vertical_hq_gauss_filter_prog[k-1]->AddShaderObject (PS);
833 CHECKGL ( glBindAttribLocation (_vertical_hq_gauss_filter_prog[k-1]->GetOpenGLID(), 0, "AVertex") );833 CHECKGL ( glBindAttribLocation (_vertical_hq_gauss_filter_prog[k-1]->GetOpenGLID(), 0, "AVertex") );
834 _vertical_hq_gauss_filter_prog[k-1]->Link();834 _vertical_hq_gauss_filter_prog[k-1]->Link();
835 delete [] shader_prog;
835 }836 }
836837
837 void GraphicsEngine::InitSLColorMatrixFilter ()838 void GraphicsEngine::InitSLColorMatrixFilter ()

Subscribers

People subscribed via source and target branches