diff options
author | Monroe Linden <monroe@lindenlab.com> | 2009-11-05 16:08:04 -0800 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2009-11-05 16:08:04 -0800 |
commit | 81192236ac44ea500ea6ec6f8de32be11e9165ca (patch) | |
tree | 1fef6fe3a13b7f29b8209be513e93e530d3cf363 /indra/newview/llviewermedia.cpp | |
parent | aee6cf3d2d36bf492b9f0a8530e63b9deac9e629 (diff) |
Fix for DEV-39258.
When the amount of the texture that's being drawn by the plugin shrinks in either width or height, reallocate the texture (which clears it).
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; |