summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-01-11 17:54:05 -0800
committerMonroe Linden <monroe@lindenlab.com>2010-01-11 17:54:05 -0800
commit3b2697cb93e6b8a1f1281aeab0e960bc6704d8c4 (patch)
tree2088640dba30fc418976db037dc4d44b3b6bcf3d /indra/newview/llviewermedia.cpp
parent05cbb2b46b4afe24cd2c17967da2694ffa85fb69 (diff)
Fix for black/grey look at login screen and backspace going back in search/help windows. This should address EXT-4097.
Added a notion of "background color" to LLViewerMediaImpl and LLPluginClassMedia. Added background color parameters to the size_change message. Webkit plugin now sets the background color of the instance from the supplied background color, and navigates to a data: url with that background color instead of about:blank as its initial navigate. Webkit plugin now no longer waits for the first onPageChanged event LLViewerMediaImpl now clears the texture to the background color when initializing it. Made LLMediaCtrl fill with its opaque background color when the media impl isn't set up yet. Removed the initial data URL from the search and help floaters, since what it was doing is now handled internally by the new background color code. Reviewed by callum and rick.
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 9671b9e5dc..023c288d92 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1005,6 +1005,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id,
mMediaAutoPlay(false),
mInNearbyMediaList(false),
mClearCache(false),
+ mBackgroundColor(LLColor4::white),
mIsUpdated(false)
{
@@ -1217,6 +1218,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
media_source->setAutoScale(mMediaAutoScale);
media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent());
media_source->focus(mHasFocus);
+ media_source->setBackgroundColor(mBackgroundColor);
if(mClearCache)
{
@@ -1983,8 +1985,8 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage()
|| placeholder_image->getUseMipMaps()
|| (placeholder_image->getWidth() != mMediaSource->getTextureWidth())
|| (placeholder_image->getHeight() != mMediaSource->getTextureHeight())
- || (mTextureUsedWidth > mMediaSource->getWidth())
- || (mTextureUsedHeight > mMediaSource->getHeight())
+ || (mTextureUsedWidth != mMediaSource->getWidth())
+ || (mTextureUsedHeight != mMediaSource->getHeight())
)
{
LL_DEBUGS("Media") << "initializing media placeholder" << LL_ENDL;
@@ -2002,7 +2004,9 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage()
// MEDIAOPT: seems insane that we actually have to make an imageraw then
// immediately discard it
LLPointer<LLImageRaw> raw = new LLImageRaw(texture_width, texture_height, texture_depth);
- raw->clear(0x00, 0x00, 0x00, 0xff);
+ // Clear the texture to the background color, ignoring alpha.
+ // convert background color channels from [0.0, 1.0] to [0, 255];
+ raw->clear(int(mBackgroundColor.mV[VX] * 255.0f), int(mBackgroundColor.mV[VY] * 255.0f), int(mBackgroundColor.mV[VZ] * 255.0f), 0xff);
int discard_level = 0;
// ask media source for correct GL image format constants
@@ -2473,6 +2477,16 @@ void LLViewerMediaImpl::setUsedInUI(bool used_in_ui)
}
};
+void LLViewerMediaImpl::setBackgroundColor(LLColor4 color)
+{
+ mBackgroundColor = color;
+
+ if(mMediaSource)
+ {
+ mMediaSource->setBackgroundColor(mBackgroundColor);
+ }
+};
+
F64 LLViewerMediaImpl::getCPUUsage() const
{
F64 result = 0.0f;