summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewermedia.cpp14
-rw-r--r--indra/newview/llviewermedia.h2
2 files changed, 14 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;
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index d6dde0c93e..4cb0817735 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -306,6 +306,8 @@ public:
bool mMediaAutoScale;
bool mMediaLoop;
bool mNeedsNewTexture;
+ S32 mTextureUsedWidth;
+ S32 mTextureUsedHeight;
bool mSuspendUpdates;
bool mVisible;
ECursorType mLastSetCursor;