Skip to content

Commit

Permalink
Merge branch 'develop' into release/luau-scripting
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-goodspeed committed Sep 9, 2024
2 parents 0c451a6 + b7c82a8 commit 9180c4e
Show file tree
Hide file tree
Showing 61 changed files with 1,047 additions and 788 deletions.
62 changes: 62 additions & 0 deletions autobuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2270,6 +2270,68 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>description</key>
<string>Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) Library</string>
</map>
<key>openxr</key>
<map>
<key>platforms</key>
<map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>3cccc3e3f3137066c286270b35abc00ee0c0bb0c</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-openxr/releases/download/v1.1.40-r1/openxr-1.1.40-r1-windows64-10710818432.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>f0ad0418a98fb8cb6e158fca3902c15ac1de9d2a</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-openxr/releases/download/v1.1.40-r1/openxr-1.1.40-r1-linux64-10710818432.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>darwin64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>a9bfabec63a987bd34bcfdc295b928bd0696e1d7</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-openxr/releases/download/v1.1.40-r1/openxr-1.1.40-r1-darwin64-10710818432.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
</map>
<key>license</key>
<string>Apache 2.0</string>
<key>license_file</key>
<string>LICENSES/openxr.txt</string>
<key>copyright</key>
<string>Copyright 2017-2024, The Khronos Group Inc.</string>
<key>version</key>
<string>1.1.40-r1</string>
<key>name</key>
<string>openxr</string>
<key>canonical_repo</key>
<string>https://github.com/secondlife/3p-openxr</string>
<key>description</key>
<string>Generated headers and sources for OpenXR loader.</string>
</map>
<key>slvoice</key>
<map>
<key>platforms</key>
Expand Down
22 changes: 22 additions & 0 deletions indra/cmake/OpenXR.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- cmake -*-

include(Prebuilt)

include_guard()
add_library( ll::openxr INTERFACE IMPORTED )

if(USE_CONAN )
target_link_libraries( ll::openxr INTERFACE CONAN_PKG::openxr )
return()
endif()

use_prebuilt_binary(openxr)
if (WINDOWS)
target_link_libraries( ll::openxr INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/openxr_loader.lib )
else()
target_link_libraries( ll::openxr INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libopenxr_loader.a )
endif (WINDOWS)

if( NOT LINUX )
target_include_directories( ll::openxr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)
endif()
2 changes: 1 addition & 1 deletion indra/llcommon/llapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ bool LLApp::parseCommandOptions(int argc, wchar_t** wargv)
if(wargv[ii][0] != '-')
{
LL_INFOS() << "Did not find option identifier while parsing token: "
<< wargv[ii] << LL_ENDL;
<< (intptr_t)wargv[ii] << LL_ENDL;
return false;
}
int offset = 1;
Expand Down
11 changes: 11 additions & 0 deletions indra/llcommon/llpointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,17 @@ class LLCopyOnWritePointer : public LLPointer<Type>
bool mStayUnique;
};

template<typename Type>
bool operator!=(Type* lhs, const LLPointer<Type>& rhs)
{
return (lhs != rhs.get());
}

template<typename Type>
bool operator==(Type* lhs, const LLPointer<Type>& rhs)
{
return (lhs == rhs.get());
}

// boost hash adapter
template <class Type>
Expand Down
4 changes: 2 additions & 2 deletions indra/llcommon/llpredicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ namespace LLPredicate
Rule()
{}

void require(ENUM e, bool match)
void mandate(ENUM e, bool match)
{
mRule.set(e, match);
}
Expand All @@ -154,7 +154,7 @@ namespace LLPredicate
return (mRule && value).someSet();
}

bool requires(const Value<ENUM> value) const
bool mandates(const Value<ENUM> value) const
{
return (mRule && value).someSet() && (!mRule && value).noneSet();
}
Expand Down
2 changes: 1 addition & 1 deletion indra/llcorehttp/tests/test_httpoperation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace tut
op->setReplyPath(LLCore::HttpOperation::HttpReplyQueuePtr_t(), h1);

// Check ref count
ensure(op.unique() == 1);
ensure(op.use_count() == 1);

// release the reference, releasing the operation but
// not the handlers.
Expand Down
2 changes: 1 addition & 1 deletion indra/llimage/llimagej2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r
S32 height = (h > 0) ? h : 2048;
S32 max_dimension = llmax(width, height); // Find largest dimension
S32 block_area = MAX_BLOCK_SIZE * MAX_BLOCK_SIZE; // Calculated initial block area from established max block size (currently 64)
block_area *= (max_dimension / MAX_BLOCK_SIZE / max_components); // Adjust initial block area by ratio of largest dimension to block size per component
block_area *= llmax((max_dimension / MAX_BLOCK_SIZE / max_components), 1); // Adjust initial block area by ratio of largest dimension to block size per component
S32 totalbytes = (S32) (block_area * max_components * precision); // First block layer computed before loop without compression rate
S32 block_layers = 1; // Start at layer 1 since first block layer is computed outside loop
while (block_layers < 6) // Walk five layers for the five discards in JPEG2000
Expand Down
24 changes: 13 additions & 11 deletions indra/llui/llfolderviewitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ void LLFolderViewItem::refresh()
LLFolderViewModelItem& vmi = *getViewModelItem();

mLabel = utf8str_to_wstring(vmi.getDisplayName());
mLabelFontBuffer.reset();
setToolTip(vmi.getName());
// icons are slightly expensive to get, can be optimized
// see LLInventoryIcon::getIcon()
Expand All @@ -320,6 +321,7 @@ void LLFolderViewItem::refresh()
// Can do a number of expensive checks, like checking active motions, wearables or friend list
mLabelStyle = vmi.getLabelStyle();
mLabelSuffix = utf8str_to_wstring(vmi.getLabelSuffix());
mSuffixFontBuffer.reset();
}

// Dirty the filter flag of the model from the view (CHUI-849)
Expand Down Expand Up @@ -775,24 +777,24 @@ void LLFolderViewItem::drawOpenFolderArrow(const Params& default_params, const L
return mIsItemCut;
}

void LLFolderViewItem::drawHighlight(const bool showContent, const bool hasKeyboardFocus, const LLUIColor &selectColor, const LLUIColor &flashColor,
const LLUIColor &focusOutlineColor, const LLUIColor &mouseOverColor)
void LLFolderViewItem::drawHighlight(bool showContent, bool hasKeyboardFocus,
const LLUIColor& selectColor, const LLUIColor& flashColor,
const LLUIColor& focusOutlineColor, const LLUIColor& mouseOverColor)
{
const S32 focus_top = getRect().getHeight();
const S32 focus_bottom = getRect().getHeight() - mItemHeight;
const bool folder_open = (getRect().getHeight() > mItemHeight + 4);
const S32 FOCUS_LEFT = 1;

// Determine which background color to use for highlighting
const LLUIColor& bgColor = (isFlashing() ? flashColor : selectColor);
const LLUIColor& bgColor = isFlashing() ? flashColor : selectColor;

//--------------------------------------------------------------------------------//
// Draw highlight for selected items
// Note: Always render "current" item or flashing item, only render other selected
// items if mShowSingleSelection is false.
//
if (isHighlightAllowed())

{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);

Expand All @@ -801,7 +803,7 @@ void LLFolderViewItem::drawHighlight(const bool showContent, const bool hasKeybo
{
LLColor4 bg_color = bgColor;
// do time-based fade of extra objects
F32 fade_time = (getRoot() ? getRoot()->getSelectionFadeElapsedTime() : 0.0f);
F32 fade_time = getRoot() ? getRoot()->getSelectionFadeElapsedTime() : 0.f;
if (getRoot() && getRoot()->getShowSingleSelection())
{
// fading out
Expand Down Expand Up @@ -890,7 +892,7 @@ void LLFolderViewItem::drawLabel(const LLFontGL * font, const F32 x, const F32 y
//--------------------------------------------------------------------------------//
// Draw the actual label text
//
font->render(mLabel, 0, x, y, color,
mLabelFontBuffer.render(font, mLabel, 0, x, y, color,
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
S32_MAX, getRect().getWidth() - (S32) x - mLabelPaddingRight, &right_x, /*use_ellipses*/true);
}
Expand All @@ -907,7 +909,7 @@ void LLFolderViewItem::draw()

getViewModelItem()->update();

if(!mSingleFolderMode)
if (!mSingleFolderMode)
{
drawOpenFolderArrow(default_params, sFgColor);
}
Expand Down Expand Up @@ -940,7 +942,7 @@ void LLFolderViewItem::draw()
return;
}

auto filter_string_length = mViewModelItem->hasFilterStringMatch() ? static_cast<S32>(mViewModelItem->getFilterStringSize()) : 0;
S32 filter_string_length = mViewModelItem->hasFilterStringMatch() ? (S32)mViewModelItem->getFilterStringSize() : 0;
F32 right_x = 0;
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad - (F32)TOP_PAD;
F32 text_left = (F32)getLabelXPos();
Expand Down Expand Up @@ -999,9 +1001,9 @@ void LLFolderViewItem::draw()
//
if (!mLabelSuffix.empty())
{
suffix_font->render( mLabelSuffix, 0, right_x, y, isFadeItem() ? color : sSuffixColor.get(),
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
S32_MAX, S32_MAX, &right_x);
mSuffixFontBuffer.render(suffix_font, mLabelSuffix, 0, right_x, y, isFadeItem() ? color : sSuffixColor.get(),
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
S32_MAX, S32_MAX, &right_x);
}

//--------------------------------------------------------------------------------//
Expand Down
8 changes: 6 additions & 2 deletions indra/llui/llfolderviewitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "llflashtimer.h"
#include "llview.h"
#include "lluiimage.h"
#include "llfontvertexbuffer.h"

class LLFolderView;
class LLFolderViewModelItem;
Expand Down Expand Up @@ -297,8 +298,8 @@ class LLFolderViewItem : public LLView
// virtual void handleDropped();
virtual void draw();
void drawOpenFolderArrow(const Params& default_params, const LLUIColor& fg_color);
void drawHighlight(const bool showContent, const bool hasKeyboardFocus, const LLUIColor &selectColor, const LLUIColor &flashColor, const LLUIColor &outlineColor, const LLUIColor &mouseOverColor);
void drawLabel(const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x);
void drawHighlight(bool showContent, bool hasKeyboardFocus, const LLUIColor& selectColor, const LLUIColor& flashColor, const LLUIColor& outlineColor, const LLUIColor& mouseOverColor);
void drawLabel(const LLFontGL* font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x);
virtual bool handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
EDragAndDropType cargo_type,
void* cargo_data,
Expand All @@ -307,6 +308,9 @@ class LLFolderViewItem : public LLView

private:
static std::map<U8, LLFontGL*> sFonts; // map of styles to fonts

LLFontVertexBuffer mLabelFontBuffer;
LLFontVertexBuffer mSuffixFontBuffer;
};

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions indra/llui/llfolderviewmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ class LLFolderViewModelItemCommon : public LLFolderViewModelItem
dirtyFilter();
requestSort();
}

virtual void removeChild(LLFolderViewModelItem* child)
{
mChildren.remove(child);
Expand Down
11 changes: 5 additions & 6 deletions indra/llui/lltextbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3342,7 +3342,6 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele

const LLWString& text = getWText();
S32 text_gen = mEditor.getTextGeneration();
bool is_text_read_only = mEditor.getReadOnly();

if (text_gen != mLastGeneration)
{
Expand All @@ -3354,16 +3353,16 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
}

const LLFontGL* font = mStyle->getFont();

LLColor4 color = (is_text_read_only ? mStyle->getReadOnlyColor() : mStyle->getColor()) % (alpha * mStyle->getAlpha());
LLColor4 color = (mEditor.getReadOnly() ? mStyle->getReadOnlyColor() : mStyle->getColor()) % (alpha * mStyle->getAlpha());
bool use_font_buffers = useFontBuffers();

if( selection_start > seg_start )
{
// Draw normally
S32 start = seg_start;
S32 end = llmin( selection_start, seg_end );
S32 length = end - start;
if (is_text_read_only)
if (use_font_buffers)
{
mFontBufferPreSelection.render(
font,
Expand Down Expand Up @@ -3407,7 +3406,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
S32 end = llmin( selection_end, seg_end );
S32 length = end - start;

if (is_text_read_only)
if (use_font_buffers)
{
mFontBufferSelection.render(
font,
Expand Down Expand Up @@ -3444,7 +3443,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
S32 start = llmax( selection_end, seg_start );
S32 end = seg_end;
S32 length = end - start;
if (is_text_read_only)
if (use_font_buffers)
{
mFontBufferPostSelection.render(
font,
Expand Down
3 changes: 2 additions & 1 deletion indra/llui/lltextbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ class LLNormalTextSegment : public LLTextSegment
/*virtual*/ bool handleToolTip(S32 x, S32 y, MASK mask);

protected:
virtual bool useFontBuffers() const { return true; }
F32 drawClippedSegment(S32 seg_start, S32 seg_end, S32 selection_start, S32 selection_end, LLRectf rect);

virtual const LLWString& getWText() const;
Expand Down Expand Up @@ -484,7 +485,7 @@ class LLTextBase
LLRect getDocRectFromDocIndex(S32 pos) const;

void setReadOnly(bool read_only) { mReadOnly = read_only; }
bool getReadOnly() { return mReadOnly; }
bool getReadOnly() const { return mReadOnly; }

void setSkipLinkUnderline(bool skip_link_underline) { mSkipLinkUnderline = skip_link_underline; }
bool getSkipLinkUnderline() { return mSkipLinkUnderline; }
Expand Down
2 changes: 2 additions & 0 deletions indra/llui/lltexteditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ class LLTextEditor :
virtual bool getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect *bounds, LLRect *control) const;
virtual S32 getPreeditFontSize() const;
virtual LLWString getPreeditString() const { return getWText(); }

virtual bool useFontBuffers() const { return getReadOnly(); }
//
// Protected data
//
Expand Down
2 changes: 1 addition & 1 deletion indra/llui/llviewereventrecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) {

event.insert("event",LLSD("keyDown"));

LL_DEBUGS() << "[VITA] unicode key: " << uni_char << LL_ENDL;
LL_DEBUGS() << "[VITA] unicode key: " << (int)uni_char << LL_ENDL;
LL_DEBUGS() << "[VITA] dumpxml " << LLSDXMLStreamer(event) << "\n" << LL_ENDL;


Expand Down
8 changes: 7 additions & 1 deletion indra/llwindow/llwindowwin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4649,6 +4649,12 @@ void LLWindowWin32::LLWindowWin32Thread::checkDXMem()
{
if (!mGLReady || mGotGLBuffer) { return; }

if ((gGLManager.mHasAMDAssociations || gGLManager.mHasNVXGpuMemoryInfo) && gGLManager.mVRAM != 0)
{ // OpenGL already told us the memory budget, don't ask DX
mGotGLBuffer = true;
return;
}

IDXGIFactory4* p_factory = nullptr;

HRESULT res = CreateDXGIFactory1(__uuidof(IDXGIFactory4), (void**)&p_factory);
Expand Down Expand Up @@ -4745,7 +4751,7 @@ void LLWindowWin32::LLWindowWin32Thread::run()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_WIN32;

// Check memory budget using DirectX
// Check memory budget using DirectX if OpenGL doesn't have the means to tell us
checkDXMem();

if (mWindowHandleThrd != 0)
Expand Down
Loading

0 comments on commit 9180c4e

Please sign in to comment.