Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
6dfba582
Commit
6dfba582
authored
11 years ago
by
Merov Linden
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/llsnapshotlivepreview.cpp
+3
-9
3 additions, 9 deletions
indra/newview/llsnapshotlivepreview.cpp
with
3 additions
and
9 deletions
indra/newview/llsnapshotlivepreview.cpp
+
3
−
9
View file @
6dfba582
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment