aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatersnapshot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloatersnapshot.cpp')
-rw-r--r--linden/indra/newview/llfloatersnapshot.cpp47
1 files changed, 27 insertions, 20 deletions
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp
index 857b3fa..c83eba3 100644
--- a/linden/indra/newview/llfloatersnapshot.cpp
+++ b/linden/indra/newview/llfloatersnapshot.cpp
@@ -149,7 +149,7 @@ public:
149 149
150protected: 150protected:
151 LLColor4 mColor; 151 LLColor4 mColor;
152 LLPointer<LLImageGL> mViewerImage[2]; 152 LLPointer<LLImageGL> mViewerImage[2]; //used to represent the scene when the frame is frozen.
153 LLRect mImageRect[2]; 153 LLRect mImageRect[2];
154 S32 mWidth[2]; 154 S32 mWidth[2];
155 S32 mHeight[2]; 155 S32 mHeight[2];
@@ -393,6 +393,7 @@ void LLSnapshotLivePreview::drawPreviewRect(S32 offset_x, S32 offset_y)
393 } 393 }
394} 394}
395 395
396//called when the frame is frozen.
396void LLSnapshotLivePreview::draw() 397void LLSnapshotLivePreview::draw()
397{ 398{
398 if (mViewerImage[mCurImageIndex].notNull() && 399 if (mViewerImage[mCurImageIndex].notNull() &&
@@ -813,34 +814,40 @@ void LLSnapshotLivePreview::onIdle( void* snapshot_preview )
813 previewp->mDataSize = previewp->mRawImage->getDataSize(); 814 previewp->mDataSize = previewp->mRawImage->getDataSize();
814 } 815 }
815 816
817 //
818 //the mViewerImage is used to represent the scene when the frame is frozen.
819 //
816 LLPointer<LLImageRaw> scaled = new LLImageRaw(previewp->mRawImageEncoded->getData(), 820 LLPointer<LLImageRaw> scaled = new LLImageRaw(previewp->mRawImageEncoded->getData(),
817 previewp->mRawImageEncoded->getWidth(), 821 previewp->mRawImageEncoded->getWidth(),
818 previewp->mRawImageEncoded->getHeight(), 822 previewp->mRawImageEncoded->getHeight(),
819 previewp->mRawImageEncoded->getComponents()); 823 previewp->mRawImageEncoded->getComponents());
820 824
821 // leave original image dimensions, just scale up texture buffer 825 if(!scaled->isBufferInvalid())
822 if (previewp->mRawImageEncoded->getWidth() > 1024 || previewp->mRawImageEncoded->getHeight() > 1024)
823 { 826 {
824 // go ahead and shrink image to appropriate power of 2 for display 827 // leave original image dimensions, just scale up texture buffer
825 scaled->biasedScaleToPowerOfTwo(1024); 828 if (previewp->mRawImageEncoded->getWidth() > 1024 || previewp->mRawImageEncoded->getHeight() > 1024)
826 previewp->mImageScaled[previewp->mCurImageIndex] = TRUE; 829 {
827 } 830 // go ahead and shrink image to appropriate power of 2 for display
828 else 831 scaled->biasedScaleToPowerOfTwo(1024);
829 { 832 previewp->mImageScaled[previewp->mCurImageIndex] = TRUE;
830 // expand image but keep original image data intact 833 }
831 scaled->expandToPowerOfTwo(1024, FALSE); 834 else
832 } 835 {
836 // expand image but keep original image data intact
837 scaled->expandToPowerOfTwo(1024, FALSE);
838 }
833 839
834 previewp->mViewerImage[previewp->mCurImageIndex] = new LLImageGL(scaled, FALSE); 840 previewp->mViewerImage[previewp->mCurImageIndex] = new LLImageGL(scaled, FALSE);
835 previewp->mViewerImage[previewp->mCurImageIndex]->setMipFilterNearest(previewp->getSnapshotType() != SNAPSHOT_TEXTURE); 841 previewp->mViewerImage[previewp->mCurImageIndex]->setMipFilterNearest(previewp->getSnapshotType() != SNAPSHOT_TEXTURE);
836 LLViewerImage::bindTexture(previewp->mViewerImage[previewp->mCurImageIndex]); 842 LLViewerImage::bindTexture(previewp->mViewerImage[previewp->mCurImageIndex]);
837 previewp->mViewerImage[previewp->mCurImageIndex]->setClamp(TRUE, TRUE); 843 previewp->mViewerImage[previewp->mCurImageIndex]->setClamp(TRUE, TRUE);
838 844
839 previewp->mSnapshotUpToDate = TRUE; 845 previewp->mSnapshotUpToDate = TRUE;
840 previewp->generateThumbnailImage(TRUE) ; 846 previewp->generateThumbnailImage(TRUE) ;
841 847
842 previewp->mPosTakenGlobal = gAgent.getCameraPositionGlobal(); 848 previewp->mPosTakenGlobal = gAgent.getCameraPositionGlobal();
843 previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame 849 previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame
850 }
844 } 851 }
845 previewp->getWindow()->decBusyCount(); 852 previewp->getWindow()->decBusyCount();
846 // only show fullscreen preview when in freeze frame mode 853 // only show fullscreen preview when in freeze frame mode