From 0b63977570221ae7ca0ad46c9f844603ff91eeb4 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 11 Jan 2010 09:53:24 -0800 Subject: Fix build issue with ba93e704bd4f --- indra/newview/llviewermedia.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index f91d126073..9671b9e5dc 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -48,6 +48,8 @@ #include "llviewerwindow.h" #include "llfocusmgr.h" #include "llcallbacklist.h" +#include "llparcel.h" +#include "llaudioengine.h" // for gAudiop #include "llevent.h" // LLSimpleListener #include "llnotificationsutil.h" @@ -909,14 +911,14 @@ void LLViewerMedia::cleanupClass() ////////////////////////////////////////////////////////////////////////////////////////// // static -bool LLViewerParcelMedia::needsMediaFirstRun() +bool LLViewerMedia::needsMediaFirstRun() { return gWarningSettings.getBOOL("FirstStreamingMedia"); } ////////////////////////////////////////////////////////////////////////////////////////// // static -void LLViewerParcelMedia::displayMediaFirstRun() +void LLViewerMedia::displayMediaFirstRun() { gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); @@ -926,7 +928,7 @@ void LLViewerParcelMedia::displayMediaFirstRun() ////////////////////////////////////////////////////////////////////////////////////////// // static -bool LLViewerParcelMedia::firstRunCallback(const LLSD& notification, const LLSD& response) +bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) -- cgit v1.2.3 From 3b2697cb93e6b8a1f1281aeab0e960bc6704d8c4 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Mon, 11 Jan 2010 17:54:05 -0800 Subject: 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. --- indra/newview/llviewermedia.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') 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 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; -- cgit v1.2.3