diff options
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 14 |
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; |