summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2009-11-06 20:03:52 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2009-11-06 20:03:52 +0200
commitd60962324ad8cb3b7c02f9b2412b785d33099cea (patch)
tree0e6e97c6a65751909f85064932b93c4f4698d1ca /indra/newview/llviewermedia.cpp
parent0d10e916ecb0bfc61b57d7645bd213fc90b15f56 (diff)
parent66171216b01c1c5afafd3405a9d17e81f50c1925 (diff)
Merge from default branch
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 55e4f28e75..40bf9fb1fe 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -658,6 +658,8 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id,
mMediaAutoScale(media_auto_scale),
mMediaLoop(media_loop),
mNeedsNewTexture(true),
+ mTextureUsedWidth(0),
+ mTextureUsedHeight(0),
mSuspendUpdates(false),
mVisible(true),
mLastSetCursor( UI_CURSOR_ARROW ),
@@ -1568,8 +1570,11 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage()
if (mNeedsNewTexture
|| placeholder_image->getUseMipMaps()
- || placeholder_image->getWidth() != mMediaSource->getTextureWidth()
- || placeholder_image->getHeight() != mMediaSource->getTextureHeight())
+ || (placeholder_image->getWidth() != mMediaSource->getTextureWidth())
+ || (placeholder_image->getHeight() != mMediaSource->getTextureHeight())
+ || (mTextureUsedWidth > mMediaSource->getWidth())
+ || (mTextureUsedHeight > mMediaSource->getHeight())
+ )
{
LL_DEBUGS("Media") << "initializing media placeholder" << LL_ENDL;
LL_DEBUGS("Media") << "movie image id " << mTextureId << LL_ENDL;
@@ -1601,6 +1606,11 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage()
// FIXME
// placeholder_image->mIsMediaTexture = true;
mNeedsNewTexture = false;
+
+ // If the amount of the texture being drawn by the media goes down in either width or height,
+ // recreate the texture to avoid leaving parts of the old image behind.
+ mTextureUsedWidth = mMediaSource->getWidth();
+ mTextureUsedHeight = mMediaSource->getHeight();
}
return placeholder_image;