summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp54
1 files changed, 29 insertions, 25 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 7b5eb581fe..3a2d1c400b 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -79,10 +79,10 @@
#include <boost/bind.hpp> // for SkinFolder listener
#include <boost/signals2.hpp>
-extern BOOL gCubeSnapshot;
+extern bool gCubeSnapshot;
// *TODO: Consider enabling mipmaps (they have been disabled for a long time). Likely has a significant performance impact for tiled/high texture repeat media. Mip generation in a shader may also be an option if necessary.
-constexpr BOOL USE_MIPMAPS = FALSE;
+constexpr bool USE_MIPMAPS = false;
void init_threaded_picker_load_dialog(LLPluginClassMedia* plugin, LLFilePicker::ELoadFilter filter, bool get_multiple)
{
@@ -1661,13 +1661,13 @@ void LLViewerMediaImpl::destroyMediaSource()
LLViewerMediaTexture* oldImage = LLViewerTextureManager::findMediaTexture( mTextureId );
if (oldImage)
{
- oldImage->setPlaying(FALSE) ;
+ oldImage->setPlaying(false) ;
}
cancelMimeTypeProbe();
{
- LLMutexLock lock(&mLock); // Delay tear-down while bg thread is updating
+ LLCoros::LockType lock(mLock); // Delay tear-down while bg thread is updating
if(mMediaSource)
{
mMediaSource->setDeleteOK(true) ;
@@ -1757,9 +1757,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
bool javascript_enabled = gSavedSettings.getBOOL("BrowserJavascriptEnabled");
media_source->setJavascriptEnabled(javascript_enabled || clean_browser);
- // collect 'web security disabled' (see Chrome --web-security-disabled) setting from prefs and send to embedded browser
- bool web_security_disabled = gSavedSettings.getBOOL("BrowserWebSecurityDisabled");
- media_source->setWebSecurityDisabled(web_security_disabled || clean_browser);
+ media_source->setWebSecurityDisabled(clean_browser);
// collect setting indicates if local file access from file URLs is allowed from prefs and send to embedded browser
bool file_access_from_file_urls = gSavedSettings.getBOOL("BrowserFileAccessFromFileUrls");
@@ -2353,7 +2351,7 @@ void LLViewerMediaImpl::onMouseCaptureLost()
}
//////////////////////////////////////////////////////////////////////////////////////////
-BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask)
+bool LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask)
{
// NOTE: this is called when the mouse is released when we have capture.
// Due to the way mouse coordinates are mapped to the object, we can't use the x and y coordinates that come in with the event.
@@ -2361,10 +2359,10 @@ BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask)
if(hasMouseCapture())
{
// Release the mouse -- this will also send a mouseup to the media
- gFocusMgr.setMouseCapture( FALSE );
+ gFocusMgr.setMouseCapture( nullptr );
}
- return TRUE;
+ return true;
}
//////////////////////////////////////////////////////////////////////////////////////////
@@ -2690,7 +2688,13 @@ void LLViewerMediaImpl::mimeDiscoveryCoro(std::string url)
{
if (initializeMedia(mimeType))
{
- loadURI();
+ ref();
+ LLAppViewer::instance()->postToMainCoro([this]()
+ {
+ loadURI();
+ unref();
+ });
+
}
}
@@ -2773,7 +2777,7 @@ bool LLViewerMediaImpl::handleUnicodeCharHere(llwchar uni_char)
{
LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
- mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char)), gKeyboard->currentMask(FALSE), native_key_data);
+ mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char)), gKeyboard->currentMask(false), native_key_data);
}
}
@@ -2783,7 +2787,7 @@ bool LLViewerMediaImpl::handleUnicodeCharHere(llwchar uni_char)
//////////////////////////////////////////////////////////////////////////////////////////
bool LLViewerMediaImpl::canNavigateForward()
{
- BOOL result = FALSE;
+ bool result = false;
if (mMediaSource)
{
result = mMediaSource->getHistoryForwardAvailable();
@@ -2794,7 +2798,7 @@ bool LLViewerMediaImpl::canNavigateForward()
//////////////////////////////////////////////////////////////////////////////////////////
bool LLViewerMediaImpl::canNavigateBack()
{
- BOOL result = FALSE;
+ bool result = false;
if (mMediaSource)
{
result = mMediaSource->getHistoryBackAvailable();
@@ -2949,7 +2953,7 @@ bool LLViewerMediaImpl::preMediaTexUpdate(LLViewerMediaTexture*& media_tex, U8*&
//S32 media_depth = mMediaSource->getTextureDepth();
// Since we're updating this texture, we know it's playing. Tell the texture to do its replacement magic so it gets rendered.
- media_tex->setPlaying(TRUE);
+ media_tex->setPlaying(true);
if (mMediaSource->getDirty(&dirty_rect))
{
@@ -2984,7 +2988,7 @@ bool LLViewerMediaImpl::preMediaTexUpdate(LLViewerMediaTexture*& media_tex, U8*&
void LLViewerMediaImpl::doMediaTexUpdate(LLViewerMediaTexture* media_tex, U8* data, S32 data_width, S32 data_height, S32 x_pos, S32 y_pos, S32 width, S32 height, bool sync)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_MEDIA;
- LLMutexLock lock(&mLock); // don't allow media source tear-down during update
+ LLCoros::LockType lock(mLock); // don't allow media source tear-down during update
// wrap "data" in an LLImageRaw but do NOT make a copy
LLPointer<LLImageRaw> raw = new LLImageRaw(data, media_tex->getWidth(), media_tex->getHeight(), media_tex->getComponents(), true);
@@ -2996,7 +3000,7 @@ void LLViewerMediaImpl::doMediaTexUpdate(LLViewerMediaTexture* media_tex, U8* da
// -Cosmic,2023-04-04
// Allocate GL texture based on LLImageRaw but do NOT copy to GL
LLGLuint tex_name = 0;
- media_tex->createGLTexture(0, raw, 0, TRUE, LLGLTexture::OTHER, true, &tex_name);
+ media_tex->createGLTexture(0, raw, 0, true, LLGLTexture::OTHER, true, &tex_name);
// copy just the subimage covered by the image raw to GL
media_tex->setSubImage(data, data_width, data_height, x_pos, y_pos, width, height, tex_name);
@@ -3514,13 +3518,13 @@ LLViewerMediaImpl::cut()
////////////////////////////////////////////////////////////////////////////////
// virtual
-BOOL
+bool
LLViewerMediaImpl::canCut() const
{
if (mMediaSource)
return mMediaSource->canCut();
else
- return FALSE;
+ return false;
}
////////////////////////////////////////////////////////////////////////////////
@@ -3534,13 +3538,13 @@ LLViewerMediaImpl::copy()
////////////////////////////////////////////////////////////////////////////////
// virtual
-BOOL
+bool
LLViewerMediaImpl::canCopy() const
{
if (mMediaSource)
return mMediaSource->canCopy();
else
- return FALSE;
+ return false;
}
////////////////////////////////////////////////////////////////////////////////
@@ -3554,21 +3558,21 @@ LLViewerMediaImpl::paste()
////////////////////////////////////////////////////////////////////////////////
// virtual
-BOOL
+bool
LLViewerMediaImpl::canPaste() const
{
if (mMediaSource)
return mMediaSource->canPaste();
else
- return FALSE;
+ return false;
}
-void LLViewerMediaImpl::setUpdated(BOOL updated)
+void LLViewerMediaImpl::setUpdated(bool updated)
{
mIsUpdated = updated ;
}
-BOOL LLViewerMediaImpl::isUpdated()
+bool LLViewerMediaImpl::isUpdated()
{
return mIsUpdated ;
}