Skip to content
Snippets Groups Projects
Commit 6dfba582 authored by Merov Linden's avatar Merov Linden
Browse files

ACME-1195 : Make SL Share snapshot use faster thumbnail computation and display

parent 6bf3cb87
No related branches found
No related tags found
No related merge requests found
...@@ -458,7 +458,7 @@ void LLSnapshotLivePreview::reshape(S32 width, S32 height, BOOL called_from_pare ...@@ -458,7 +458,7 @@ void LLSnapshotLivePreview::reshape(S32 width, S32 height, BOOL called_from_pare
BOOL LLSnapshotLivePreview::setThumbnailImageSize() BOOL LLSnapshotLivePreview::setThumbnailImageSize()
{ {
if(getWidth() < 10 || getHeight() < 10) if (getWidth() < 10 || getHeight() < 10)
{ {
return FALSE ; return FALSE ;
} }
...@@ -468,8 +468,6 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize() ...@@ -468,8 +468,6 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize()
F32 aspect_ratio = ((F32)width) / ((F32)height); F32 aspect_ratio = ((F32)width) / ((F32)height);
// UI size for thumbnail // UI size for thumbnail
// *FIXME: the rect does not change, so maybe there's no need to recalculate max w/h.
//const LLRect& thumbnail_rect = mThumbnailPlaceholderRect;
S32 max_width = mThumbnailPlaceholderRect.getWidth(); S32 max_width = mThumbnailPlaceholderRect.getWidth();
S32 max_height = mThumbnailPlaceholderRect.getHeight(); S32 max_height = mThumbnailPlaceholderRect.getHeight();
...@@ -485,14 +483,14 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize() ...@@ -485,14 +483,14 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize()
mThumbnailHeight = max_height; mThumbnailHeight = max_height;
mThumbnailWidth = llround((F32)max_height * aspect_ratio); mThumbnailWidth = llround((F32)max_height * aspect_ratio);
} }
if (mThumbnailWidth > width || mThumbnailHeight > height) if (mThumbnailWidth > width || mThumbnailHeight > height)
{ {
return FALSE ;//if the window is too small, ignore thumbnail updating. return FALSE ;//if the window is too small, ignore thumbnail updating.
} }
S32 left = 0 , top = mThumbnailHeight, right = mThumbnailWidth, bottom = 0 ; S32 left = 0 , top = mThumbnailHeight, right = mThumbnailWidth, bottom = 0 ;
if(!mKeepAspectRatio && !mThumbnailSubsampled) if (!mKeepAspectRatio)
{ {
F32 ratio_x = (F32)getWidth() / width ; F32 ratio_x = (F32)getWidth() / width ;
F32 ratio_y = (F32)getHeight() / height ; F32 ratio_y = (F32)getHeight() / height ;
...@@ -643,10 +641,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) ...@@ -643,10 +641,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
} }
// time to produce a snapshot // time to produce a snapshot
//previewp->setThumbnailImageSize();
lldebugs << "producing snapshot" << llendl; lldebugs << "producing snapshot" << llendl;
llinfos << "Merov : producing snapshot" << llendl;
if (!previewp->mPreviewImage) if (!previewp->mPreviewImage)
{ {
previewp->mPreviewImage = new LLImageRaw; previewp->mPreviewImage = new LLImageRaw;
...@@ -732,7 +727,6 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) ...@@ -732,7 +727,6 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
previewp->generateThumbnailImage() ; previewp->generateThumbnailImage() ;
} }
lldebugs << "done creating snapshot" << llendl; lldebugs << "done creating snapshot" << llendl;
llinfos << "Merov : Done creating snapshot" << llendl;
LLFloaterSnapshot::postUpdate(); LLFloaterSnapshot::postUpdate();
LLFloaterFacebook::postUpdate(); LLFloaterFacebook::postUpdate();
LLFloaterFlickr::postUpdate(); LLFloaterFlickr::postUpdate();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment