[vlc-commits] commit: Qt4: don't cache inside pictureflow (Ilkka Ollakka )
git at videolan.org
git at videolan.org
Sun Oct 31 17:54:13 CET 2010
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Oct 31 18:53:19 2010 +0200| [6201f61b298391fe2912113a1ece6e6bddc8f017] | committer: Ilkka Ollakka
Qt4: don't cache inside pictureflow
doesn't seem to help at all in thatway, also leaked in playlist-tree mode
(so if you revert, remember to fix that)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6201f61b298391fe2912113a1ece6e6bddc8f017
---
modules/gui/qt4/util/pictureflow.cpp | 21 +++++----------------
1 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/modules/gui/qt4/util/pictureflow.cpp b/modules/gui/qt4/util/pictureflow.cpp
index db894d6..3a33963 100644
--- a/modules/gui/qt4/util/pictureflow.cpp
+++ b/modules/gui/qt4/util/pictureflow.cpp
@@ -33,8 +33,6 @@
#endif
#include <QApplication>
-#include <QCache>
-#include <QHash>
#include <QImage>
#include <QKeyEvent>
#include <QPainter>
@@ -197,8 +195,6 @@ private:
QImage buffer;
QVector<PFreal> rays;
QImage* blankSurface;
- QCache<int, QImage> surfaceCache;
- QHash<int, QImage*> imageHash;
void render();
void renderSlides();
@@ -417,7 +413,6 @@ PictureFlowSoftwareRenderer::PictureFlowSoftwareRenderer():
PictureFlowSoftwareRenderer::~PictureFlowSoftwareRenderer()
{
- surfaceCache.clear();
buffer = QImage();
delete blankSurface;
}
@@ -432,12 +427,10 @@ void PictureFlowSoftwareRenderer::paint()
if (state->backgroundColor != bgcolor) {
bgcolor = state->backgroundColor;
- surfaceCache.clear();
}
if ((int)(state->reflectionEffect) != effect) {
effect = (int)state->reflectionEffect;
- surfaceCache.clear();
}
if (dirty)
@@ -473,7 +466,6 @@ void PictureFlowSoftwareRenderer::init()
if (!widget)
return;
- surfaceCache.clear();
blankSurface = 0;
size = widget->size();
@@ -623,16 +615,9 @@ QImage* PictureFlowSoftwareRenderer::surface(int slideIndex)
QImage* img = new QImage(PLModel::getArtPixmap( state->model->index( slideIndex, 0, state->model->currentIndex().parent() ),
QSize( state->slideWidth, state->slideHeight ) ).toImage());
- bool exist = imageHash.contains(slideIndex);
- if (exist)
- if (img == imageHash.find(slideIndex).value())
- if (surfaceCache.contains(key))
- return surfaceCache[key];
-
QImage* sr = prepareSurface(img, state->slideWidth, state->slideHeight, bgcolor, state->reflectionEffect);
- surfaceCache.insert(key, sr);
- imageHash.insert(slideIndex, img);
+ delete img;
return sr;
}
@@ -676,7 +661,10 @@ QRect PictureFlowSoftwareRenderer::renderSlide(const SlideInfo &slide, int col1,
int xi = qMax((PFreal)0, (w * PFREAL_ONE / 2) + fdiv(xs * h, dist + ys) >> PFREAL_SHIFT);
if (xi >= w)
+ {
+ delete src;
return rect;
+ }
bool flag = false;
rect.setLeft(xi);
@@ -746,6 +734,7 @@ QRect PictureFlowSoftwareRenderer::renderSlide(const SlideInfo &slide, int col1,
rect.setTop(0);
rect.setBottom(h - 1);
+ delete src;
return rect;
}
More information about the vlc-commits
mailing list