summaryrefslogtreecommitdiff
path: root/indra/newview/llsnapshotlivepreview.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2014-09-08 15:24:22 -0400
committerMonty Brandenberg <monty@lindenlab.com>2014-09-08 15:24:22 -0400
commitbff5a4e7940d40576f52105ab9877f5a6b7d85c8 (patch)
tree9a87e704499c62858c9f449814bb744e2a0a26ab /indra/newview/llsnapshotlivepreview.cpp
parent0c20beda6800149ee71a307ca4e943b5bba56908 (diff)
parenteef4acc5367a486b0c52c6ce5e1aba995fefd99c (diff)
Merge. Update from viewer-release after 3.7.15 release.
Diffstat (limited to 'indra/newview/llsnapshotlivepreview.cpp')
-rw-r--r--indra/newview/llsnapshotlivepreview.cpp32
1 files changed, 24 insertions, 8 deletions
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index f61db77169..1aa7041175 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -151,7 +151,7 @@ F32 LLSnapshotLivePreview::getImageAspect()
void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail, F32 delay)
{
- lldebugs << "updateSnapshot: mSnapshotUpToDate = " << getSnapshotUpToDate() << llendl;
+ LL_DEBUGS() << "updateSnapshot: mSnapshotUpToDate = " << getSnapshotUpToDate() << LL_ENDL;
// Update snapshot if requested.
if (new_snapshot)
@@ -195,6 +195,8 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail
mSnapshotDelayTimer.start();
mSnapshotDelayTimer.setTimerExpirySec(delay);
+ mPosTakenGlobal = gAgentCamera.getCameraPositionGlobal();
+
// Tell the floater container that the snapshot is in the process of updating itself
if (mViewContainer)
{
@@ -594,7 +596,7 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
}
else
{
- llwarns << "Couldn't find a path to the following filter : " << getFilter() << llendl;
+ LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL;
}
}
// Scale to a power of 2 so it can be mapped to a texture
@@ -642,7 +644,7 @@ LLViewerTexture* LLSnapshotLivePreview::getBigThumbnailImage()
}
else
{
- llwarns << "Couldn't find a path to the following filter : " << getFilter() << llendl;
+ LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL;
}
}
// Scale to a power of 2 so it can be mapped to a texture
@@ -695,7 +697,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
// time to produce a snapshot
if(!previewp->getSnapshotUpToDate())
{
- lldebugs << "producing snapshot" << llendl;
+ LL_DEBUGS() << "producing snapshot" << LL_ENDL;
if (!previewp->mPreviewImage)
{
previewp->mPreviewImage = new LLImageRaw;
@@ -760,7 +762,6 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
curr_preview_image->setFilteringOption(previewp->getSnapshotType() == SNAPSHOT_TEXTURE ? LLTexUnit::TFO_ANISOTROPIC : LLTexUnit::TFO_POINT);
curr_preview_image->setAddressMode(LLTexUnit::TAM_CLAMP);
- previewp->mPosTakenGlobal = gAgentCamera.getCameraPositionGlobal();
previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame
}
}
@@ -775,7 +776,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame") && previewp->mAllowFullScreenPreview); // only show fullscreen preview when in freeze frame mode
previewp->mSnapshotDelayTimer.stop();
previewp->mSnapshotActive = FALSE;
- lldebugs << "done creating snapshot" << llendl;
+ LL_DEBUGS() << "done creating snapshot" << LL_ENDL;
}
if (!previewp->getThumbnailUpToDate())
@@ -910,13 +911,13 @@ LLPointer<LLImageFormatted> LLSnapshotLivePreview::getFormattedImage()
}
else
{
- llwarns << "Couldn't find a path to the following filter : " << getFilter() << llendl;
+ LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL;
}
}
// Create the new formatted image of the appropriate format.
LLFloaterSnapshot::ESnapshotFormat format = getSnapshotFormat();
- lldebugs << "Encoding new image of format " << format << llendl;
+ LL_DEBUGS() << "Encoding new image of format " << format << LL_ENDL;
switch (format)
{
@@ -975,6 +976,21 @@ void LLSnapshotLivePreview::saveTexture()
mPreviewImage->getHeight(),
mPreviewImage->getComponents());
+ // Apply the filter to mPreviewImage
+ if (getFilter() != "")
+ {
+ std::string filter_path = LLImageFiltersManager::getInstance()->getFilterPath(getFilter());
+ if (filter_path != "")
+ {
+ LLImageFilter filter(filter_path);
+ filter.executeFilter(scaled);
+ }
+ else
+ {
+ LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL;
+ }
+ }
+
scaled->biasedScaleToPowerOfTwo(MAX_TEXTURE_SIZE);
LL_DEBUGS() << "scaled texture to " << scaled->getWidth() << "x" << scaled->getHeight() << LL_ENDL;