Skip to content

Commit

Permalink
WDeclarativeImageBase: Fix the 'onFilterUpdated' function
Browse files Browse the repository at this point in the history
  • Loading branch information
3unjee committed Oct 6, 2018
1 parent 42f8944 commit 228a750
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
2 changes: 2 additions & 0 deletions dist/changes/1.4.1.md
Expand Up @@ -32,6 +32,8 @@

- WDeclarativeImageBase: Fix the 'set filter' function.

- WDeclarativeImageBase: Fix the 'onFilterUpdated' function.

- WDeclarativeImage(s): Fix the 'scale' implementation.

- WDeclarativeTextSvg: Fix the 'get width' implementation.
Expand Down
25 changes: 6 additions & 19 deletions src/SkGui/src/declarative/WDeclarativeImageBase.cpp
Expand Up @@ -172,7 +172,7 @@ void WDeclarativeImageBasePrivate::readDefault()
WPixmapCache::readPixmap(&(pixmapDefault),
WControllerFile::toLocalFile(urlDefault), sourceSize, sourceArea);

applyFilter();
if (filter) applyFilter();
}

//-------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -219,7 +219,7 @@ void WDeclarativeImageBasePrivate::applyRequest()

setSourceDefault(pix.isNull());

applyFilter();
if (filter) applyFilter();

q->pixmapChange();

Expand All @@ -242,8 +242,6 @@ void WDeclarativeImageBasePrivate::applyRequest()

void WDeclarativeImageBasePrivate::applyFilter()
{
if (filter == NULL) return;

if (sourceDefault == false || pixmapDefault.isNull())
{
QPixmap pixmap = pix.pixmap();
Expand Down Expand Up @@ -349,11 +347,11 @@ void WDeclarativeImageBasePrivate::onLoaded(WCacheFile * file)

void WDeclarativeImageBasePrivate::onFilterUpdated()
{
Q_Q(WDeclarativeImageBase);
if (loadLater) return;

if (pix.isNull() || loadLater) return;
Q_Q(WDeclarativeImageBase);

filter->applyFilter(const_cast<QPixmap *> (&(pix.pixmap())));
applyFilter();

q->pixmapChange();

Expand Down Expand Up @@ -998,18 +996,7 @@ void WDeclarativeImageBase::setFilter(WImageFilter * filter)
{
connect(filter, SIGNAL(filterUpdated()), this, SLOT(onFilterUpdated()));

if (d->loadLater == false)
{
d->applyFilter();

pixmapChange();

#ifdef QT_LATEST
d->updateTexture = true;
#endif

update();
}
d->onFilterUpdated();
}

emit filterChanged();
Expand Down

0 comments on commit 228a750

Please sign in to comment.