diff --git a/autobuild.xml b/autobuild.xml index a500f7d8ee..6d2ea1d933 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3,6 +3,62 @@ installables + glib + + copyright + Copyright (C) glib project + license + LGPL + license_file + LICENSES/glib.txt + name + glib + platforms + + linux64 + + archive + + hash + 9c93ba8b8af97fc8379f77de77e1540a + url + http://3p.firestormviewer.org/glib-2.48.0.202301938-linux64-202301938.tar.bz2 + + name + linux + + + version + 2.48.0 + + fltk + + copyright + Copyright (C) fltk project + license + LGPL/fltk + license_file + LICENSES/fltk.txt + name + fltk + platforms + + linux64 + + archive + + hash + 81fe1e927e4fe3c5e5f15ce6219ca883 + url + http://3p.firestormviewer.org/fltk-1.3.5.202282121-linux64-202282121.tar.bz2 + + name + linux + + + version + 1.3.5 + jemalloc copyright @@ -1092,11 +1148,11 @@ archive hash - bde9eb3e53001584edb1af44e3b265a2 + 2db00aa4126d4ee8152fc49b03bb3fe1 hash_algorithm md5 url - file:///opt/firestorm/fmodstudio-2.02.04-darwin-213491614.tar.bz2 + file:///opt/firestorm/fmodstudio-2.02.05-darwin-220160006.tar.bz2 name darwin @@ -1517,46 +1573,6 @@ version 0.10.6.314267 - gtk-atk-pango-glib - - copyright - Copyright (various, see sources) - license - lgpl - license_file - LICENSES/gtk-atk-pango-glib.txt - name - gtk-atk-pango-glib - platforms - - linux - - archive - - hash - fb047d496c32cc3b9f99793ee6ebb1e3 - url - http://3p.firestormviewer.org/gtk_atk_pango_glib-2.1-linux-180871647.tar.bz2 - - name - linux - - linux64 - - archive - - hash - d918d894430c1d1d869b9f2e06570c65 - url - http://3p.firestormviewer.org/gtk_atk_pango_glib-2.1-linux64-180841902.tar.bz2 - - name - linux64 - - - version - 2.1 - havok-source copyright diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 415d7bf6f8..6cac3fe7ab 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -243,15 +243,8 @@ elseif(LINUX) # have to deal with if (NOT USESYSTEMLIBS) set(release_files - #libapr-1.so.0 - #libaprutil-1.so.0 - libatk-1.0.so #libdb-5.1.so ${EXPAT_COPY} - #libfreetype.so.6.6.2 - #libfreetype.so.6 - libgmodule-2.0.so - libgobject-2.0.so libhunspell-1.3.so.0.0.0 libopenal.so #libopenjpeg.so diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake index 5e46b6711a..160196a672 100644 --- a/indra/cmake/DBusGlib.cmake +++ b/indra/cmake/DBusGlib.cmake @@ -1,29 +1,27 @@ # -*- cmake -*- include(Prebuilt) +include(GLIB) -if (USESYSTEMLIBS) - include(FindPkgConfig) +if( GLIB_FOUND ) + if (USESYSTEMLIBS) + include(FindPkgConfig) - pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) + pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) -elseif (LINUX) - use_prebuilt_binary(dbus_glib) - set(DBUSGLIB_FOUND ON FORCE BOOL) - set(DBUSGLIB_INCLUDE_DIRS + elseif (LINUX) + use_prebuilt_binary(dbus_glib) + set(DBUSGLIB_FOUND ON FORCE BOOL) + set(DBUSGLIB_INCLUDE_DIRS + ${GLIB_INCLUDE_DIRS} ${LIBS_PREBUILT_DIR}/include/dbus ) - # We don't need to explicitly link against dbus-glib itself, because - # the viewer probes for the system's copy at runtime. - set(DBUSGLIB_LIBRARIES - gobject-2.0 - glib-2.0 - ) -endif (USESYSTEMLIBS) + endif (USESYSTEMLIBS) -if (DBUSGLIB_FOUND) - set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.") -endif (DBUSGLIB_FOUND) + if (DBUSGLIB_FOUND) + set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.") + endif (DBUSGLIB_FOUND) -if (DBUSGLIB) - add_definitions(-DLL_DBUS_ENABLED=1) -endif (DBUSGLIB) + if (DBUSGLIB) + add_definitions(-DLL_DBUS_ENABLED=1) + endif (DBUSGLIB) +endif() diff --git a/indra/cmake/GLIB.cmake b/indra/cmake/GLIB.cmake new file mode 100644 index 0000000000..0024cb26ac --- /dev/null +++ b/indra/cmake/GLIB.cmake @@ -0,0 +1,11 @@ + +include(Prebuilt) + +if( LINUX ) + use_prebuilt_binary(glib) + set(GLIB_FOUND ON CACHE BOOL "Build against glib 2") + set(GLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/glib-2.0 ${LIBS_PREBUILT_DIR}/lib/release/glib-2.0/include ) + set(GLIB_LIBRARIES libgobject-2.0.a libglib-2.0.a libffi.a libpcre.a) + + add_definitions(-DLL_GLIB=1) +endif() diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index f1a8b68900..8c5d266cf5 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -5,23 +5,29 @@ include(FreeType) if (USESYSTEMLIBS) include(FindPkgConfig) + if( NOT GTK_VERSION ) + set( GTK_VERSION 2.0 ) + endif() if (LINUX) set(PKGCONFIG_PACKAGES atk cairo - gdk-2.0 + gdk-${GTK_VERSION} gdk-pixbuf-2.0 glib-2.0 gmodule-2.0 - gtk+-2.0 + gtk+-${GTK_VERSION} gthread-2.0 libpng pango pangoft2 - pangox - pangoxft - sdl + sdl2 ) + if( GTK_VERSION LESS "3.0" ) + LIST( APPEND PKGCONFIG_PACKAGES pangoxft ) + else() + add_definitions( -DGTK_DISABLE_DEPRECATED) + endif() endif (LINUX) foreach(pkg ${PKGCONFIG_PACKAGES}) @@ -31,29 +37,16 @@ if (USESYSTEMLIBS) list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES}) add_definitions(${${pkg}_CFLAGS_OTHERS}) endforeach(pkg) + list(APPEND UI_LIBRARIES X11) else (USESYSTEMLIBS) if (LINUX) - use_prebuilt_binary(gtk-atk-pango-glib) + use_prebuilt_binary(fltk) endif (LINUX) if (LINUX) set(UI_LIB_NAMES + libfltk.a freetype - atk-1.0 - gdk-x11-2.0 - gdk_pixbuf-2.0 - glib-2.0 - gmodule-2.0 - gobject-2.0 - gthread-2.0 - gtk-x11-2.0 - pango-1.0 - pangoft2-1.0 - pangox-1.0 - #pangoxft-1.0 - gio-2.0 - pangocairo-1.0 - ffi ) foreach(libname ${UI_LIB_NAMES}) @@ -80,5 +73,5 @@ else (USESYSTEMLIBS) endif (USESYSTEMLIBS) if (LINUX) - add_definitions(-DLL_GTK=1 -DLL_X11=1) + add_definitions(-DLL_X11=1 -DLL_FLTK=1) endif (LINUX) diff --git a/indra/linux_crash_logger/llcrashloggerlinux.cpp b/indra/linux_crash_logger/llcrashloggerlinux.cpp index f6fd71e849..0395935d04 100644 --- a/indra/linux_crash_logger/llcrashloggerlinux.cpp +++ b/indra/linux_crash_logger/llcrashloggerlinux.cpp @@ -40,6 +40,7 @@ #if LL_GTK # include "gtk/gtk.h" +#error "Direct use of GTK is deprecated" #endif // LL_GTK #define MAX_LOADSTRING 100 diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index b84d74a244..15f67bf73a 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -43,6 +43,7 @@ #if LL_GTK extern "C" { # include "gtk/gtk.h" +#error "Direct use of GTK is deprecated" } #include #endif // LL_GTK @@ -186,6 +187,248 @@ Display* LLWindowSDL::get_SDL_Display(void) } #endif // LL_X11 +#if LL_X11 + +// Clipboard handing via native X11, base on the implementation in Cool VL by Henri Beauchamp + +namespace +{ + std::array gSupportedAtoms; + + Atom XA_CLIPBOARD; + Atom XA_TARGETS; + Atom PVT_PASTE_BUFFER; + long const MAX_PASTE_BUFFER_SIZE = 16383; + + void filterSelectionRequest( XEvent aEvent ) + { + auto *display = LLWindowSDL::getSDLDisplay(); + auto &request = aEvent.xselectionrequest; + + XSelectionEvent reply { SelectionNotify, aEvent.xany.serial, aEvent.xany.send_event, display, + request.requestor, request.selection, request.target, + request.property,request.time }; + + if (request.target == XA_TARGETS) + { + XChangeProperty(display, request.requestor, request.property, + XA_ATOM, 32, PropModeReplace, + (unsigned char *) &gSupportedAtoms.front(), gSupportedAtoms.size()); + } + else if (std::find(gSupportedAtoms.begin(), gSupportedAtoms.end(), request.target) != + gSupportedAtoms.end()) + { + std::string utf8; + if (request.selection == XA_PRIMARY) + utf8 = wstring_to_utf8str(gWindowImplementation->getPrimaryText()); + else + utf8 = wstring_to_utf8str(gWindowImplementation->getSecondaryText()); + + XChangeProperty(display, request.requestor, request.property, + request.target, 8, PropModeReplace, + (unsigned char *) utf8.c_str(), utf8.length()); + } + else if (request.selection == XA_CLIPBOARD) + { + // Did not have what they wanted, so no property set + reply.property = None; + } + else + return; + + XSendEvent(request.display, request.requestor, False, NoEventMask, (XEvent *) &reply); + XSync(display, False); + } + + void filterSelectionClearRequest( XEvent aEvent ) + { + auto &request = aEvent.xselectionrequest; + if (request.selection == XA_PRIMARY) + gWindowImplementation->clearPrimaryText(); + else if (request.selection == XA_CLIPBOARD) + gWindowImplementation->clearSecondaryText(); + } + + int x11_clipboard_filter(const SDL_Event *evt) + { + Display *display = LLWindowSDL::getSDLDisplay(); + if (!display) + return 1; + + if (evt->type != SDL_SYSWMEVENT) + return 1; + + auto xevent = evt->syswm.msg->event.xevent; + + if (xevent.type == SelectionRequest) + filterSelectionRequest( xevent ); + else if (xevent.type == SelectionClear) + filterSelectionClearRequest( xevent ); + return 1; + } + + bool grab_property(Display* display, Window window, Atom selection, Atom target) + { + if( !display ) + return false; + + maybe_lock_display(); + + XDeleteProperty(display, window, PVT_PASTE_BUFFER); + XFlush(display); + + XConvertSelection(display, selection, target, PVT_PASTE_BUFFER, window, CurrentTime); + + // Unlock the connection so that the SDL event loop may function + maybe_unlock_display(); + + const auto start{ SDL_GetTicks() }; + const auto end{ start + 1000 }; + + XEvent xevent {}; + bool response = false; + + do + { + SDL_Event event {}; + + // Wait for an event + SDL_WaitEvent(&event); + + // If the event is a window manager event + if (event.type == SDL_SYSWMEVENT) + { + xevent = event.syswm.msg->event.xevent; + + if (xevent.type == SelectionNotify && xevent.xselection.requestor == window) + response = true; + } + } while (!response && SDL_GetTicks() < end ); + + return response && xevent.xselection.property != None; + } +} + +void LLWindowSDL::initialiseX11Clipboard() +{ + if (!mSDL_Display) + return; + + SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE); + SDL_SetEventFilter(x11_clipboard_filter); + + maybe_lock_display(); + + XA_CLIPBOARD = XInternAtom(mSDL_Display, "CLIPBOARD", False); + + gSupportedAtoms[0] = XA_STRING; + + gSupportedAtoms[1] = XInternAtom(mSDL_Display, "COMPOUND_TEXT", False); + gSupportedAtoms[2] = XInternAtom(mSDL_Display, "UTF8_STRING", False); + + // TARGETS atom + XA_TARGETS = XInternAtom(mSDL_Display, "TARGETS", False); + + // SL_PASTE_BUFFER atom + PVT_PASTE_BUFFER = XInternAtom(mSDL_Display, "FS_PASTE_BUFFER", False); + + maybe_unlock_display(); +} + +bool LLWindowSDL::getSelectionText( Atom aSelection, Atom aType, LLWString &text ) +{ + if( !mSDL_Display ) + return false; + + if( !grab_property(mSDL_Display, mSDL_XWindowID, aSelection,aType ) ) + return false; + + maybe_lock_display(); + + Atom type; + int format{}; + unsigned long len{},remaining {}; + unsigned char* data = nullptr; + int res = XGetWindowProperty(mSDL_Display, mSDL_XWindowID, + PVT_PASTE_BUFFER, 0, MAX_PASTE_BUFFER_SIZE, False, + AnyPropertyType, &type, &format, &len, + &remaining, &data); + if (data && len) + { + text = LLWString( + utf8str_to_wstring(reinterpret_cast< char const *>( data ) ) + ); + XFree(data); + } + + maybe_unlock_display(); + return res == Success; +} + +bool LLWindowSDL::getSelectionText(Atom selection, LLWString& text) +{ + if (!mSDL_Display) + return false; + + maybe_lock_display(); + + Window owner = XGetSelectionOwner(mSDL_Display, selection); + if (owner == None) + { + if (selection == XA_PRIMARY) + { + owner = DefaultRootWindow(mSDL_Display); + selection = XA_CUT_BUFFER0; + } + else + { + maybe_unlock_display(); + return false; + } + } + + maybe_unlock_display(); + + for( Atom atom : gSupportedAtoms ) + { + if(getSelectionText(selection, atom, text ) ) + return true; + } + + return false; +} + +bool LLWindowSDL::setSelectionText(Atom selection, const LLWString& text) +{ + maybe_lock_display(); + + if (selection == XA_PRIMARY) + { + std::string utf8 = wstring_to_utf8str(text); + XStoreBytes(mSDL_Display, utf8.c_str(), utf8.length() + 1); + mPrimaryClipboard = text; + } + else + mSecondaryClipboard = text; + + XSetSelectionOwner(mSDL_Display, selection, mSDL_XWindowID, CurrentTime); + + auto owner = XGetSelectionOwner(mSDL_Display, selection); + + maybe_unlock_display(); + + return owner == mSDL_XWindowID; +} + +Display* LLWindowSDL::getSDLDisplay() +{ + if (gWindowImplementation) + return gWindowImplementation->mSDL_Display; + return nullptr; +} + +#endif + LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, S32 x, S32 y, S32 width, @@ -253,6 +496,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, #if LL_X11 mFlashing = FALSE; + initialiseX11Clipboard(); #endif // LL_X11 mKeyScanCode = 0; @@ -1356,33 +1600,34 @@ BOOL LLWindowSDL::copyTextToPrimary(const LLWString &text) #else BOOL LLWindowSDL::isClipboardTextAvailable() -{ - return FALSE; // unsupported +{ + return mSDL_Display && XGetSelectionOwner(mSDL_Display, XA_CLIPBOARD) != None; } BOOL LLWindowSDL::pasteTextFromClipboard(LLWString &dst) { - return FALSE; // unsupported + return getSelectionText(XA_CLIPBOARD, dst); } BOOL LLWindowSDL::copyTextToClipboard(const LLWString &s) { - return FALSE; // unsupported + return setSelectionText(XA_CLIPBOARD, s); } BOOL LLWindowSDL::isPrimaryTextAvailable() { - return FALSE; // unsupported + LLWString text; + return getSelectionText(XA_PRIMARY, text) && !text.empty(); } BOOL LLWindowSDL::pasteTextFromPrimary(LLWString &dst) { - return FALSE; // unsupported + return getSelectionText(XA_PRIMARY, dst); } BOOL LLWindowSDL::copyTextToPrimary(const LLWString &s) { - return FALSE; // unsupported + return setSelectionText(XA_PRIMARY, s); } #endif // LL_GTK @@ -2396,39 +2641,6 @@ static void color_changed_callback(GtkWidget *widget, gtk_color_selection_get_current_color(colorsel, colorp); } - -/* - Make the raw keyboard data available - used to poke through to LLQtWebKit so - that Qt/Webkit has access to the virtual keycodes etc. that it needs -*/ -LLSD LLWindowSDL::getNativeKeyData() -{ - LLSD result = LLSD::emptyMap(); - - U32 modifiers = 0; // pretend-native modifiers... oh what a tangled web we weave! - - // we go through so many levels of device abstraction that I can't really guess - // what a plugin under GDK under Qt under SL under SDL under X11 considers - // a 'native' modifier mask. this has been sort of reverse-engineered... they *appear* - // to match GDK consts, but that may be co-incidence. - modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0; - modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift - modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0; - modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0; - modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl - modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;// untested - modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;// untested - // *todo: test ALTs - I don't have a case for testing these. Do you? - // *todo: NUM? - I don't care enough right now (and it's not a GDK modifier). - - result["scan_code"] = (S32)mKeyScanCode; - result["virtual_key"] = (S32)mKeyVirtualKey; - result["modifiers"] = (S32)modifiers; - result[ "sdl_sym" ] = (S32)mSDLSym; // Store the SDL Keysym too. - return result; -} - - BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) { BOOL rtn = FALSE; @@ -2513,6 +2725,37 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) } #endif // LL_GTK +/* + Make the raw keyboard data available - used to poke through to LLQtWebKit so + that Qt/Webkit has access to the virtual keycodes etc. that it needs +*/ +LLSD LLWindowSDL::getNativeKeyData() +{ + LLSD result = LLSD::emptyMap(); + + U32 modifiers = 0; // pretend-native modifiers... oh what a tangled web we weave! + + // we go through so many levels of device abstraction that I can't really guess + // what a plugin under GDK under Qt under SL under SDL under X11 considers + // a 'native' modifier mask. this has been sort of reverse-engineered... they *appear* + // to match GDK consts, but that may be co-incidence. + modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0; + modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift + modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0; + modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0; + modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl + modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;// untested + modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;// untested + // *todo: test ALTs - I don't have a case for testing these. Do you? + // *todo: NUM? - I don't care enough right now (and it's not a GDK modifier). + + result["scan_code"] = (S32)mKeyScanCode; + result["virtual_key"] = (S32)mKeyVirtualKey; + result["modifiers"] = (S32)modifiers; + result[ "sdl_sym" ] = (S32)mSDLSym; // Store the SDL Keysym too. + return result; +} + #if LL_LINUX // extracted from spawnWebBrowser for clarity and to eliminate // compiler confusion regarding close(int fd) vs. LLWindow::close() diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index de0ee173ec..a0ca9839a5 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -220,6 +220,24 @@ private: U32 mSDLSym; // Store the SDL Keysym too. BOOL mUseLegacyCursors; // Legacy cursor setting from main program + +public: +#if LL_X11 + static Display* getSDLDisplay(); + LLWString const& getPrimaryText() const { return mPrimaryClipboard; } + LLWString const& getSecondaryText() const { return mSecondaryClipboard; } + void clearPrimaryText() { mPrimaryClipboard.clear(); } + void clearSecondaryText() { mSecondaryClipboard.clear(); } +private: + void initialiseX11Clipboard(); + + bool getSelectionText(Atom selection, LLWString& text); + bool getSelectionText( Atom selection, Atom type, LLWString &text ); + + bool setSelectionText(Atom selection, const LLWString& text); +#endif + LLWString mPrimaryClipboard; + LLWString mSecondaryClipboard; }; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 75810b3570..20242361b8 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2512,7 +2512,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${BOOST_WAVE_LIBRARY} #FS specific ${BOOST_THREAD_LIBRARY} #FS specific ${BOOST_CONTEXT_LIBRARY} - ${DBUSGLIB_LIBRARIES} + ${GLIB_LIBRARIES} ${OPENGL_LIBRARIES} ${FMODWRAPPER_LIBRARY} # must come after LLAudio ${OPENAL_LIBRARIES} diff --git a/indra/newview/fsfloaterperformance.cpp b/indra/newview/fsfloaterperformance.cpp index c8f5d64d76..43401fe0b4 100644 --- a/indra/newview/fsfloaterperformance.cpp +++ b/indra/newview/fsfloaterperformance.cpp @@ -139,7 +139,7 @@ BOOL FSFloaterPerformance::postBuild() mObjectList->setHoverIconName("StopReload_Off"); mObjectList->setIconClickedCallback(boost::bind(&FSFloaterPerformance::detachItem, this, _1)); - mSettingsPanel->getChild("graphics_quality")->setCommitCallback(boost::bind(&FSFloaterPerformance::onChangeQuality, this, _2)); + mSettingsPanel->getChild("quality_vs_perf_selection")->setCommitCallback(boost::bind(&FSFloaterPerformance::onChangeQuality, this, _2)); mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&FSFloaterPerformance::onClickExceptions, this)); mNearbyPanel->getChild("hide_avatars")->setCommitCallback(boost::bind(&FSFloaterPerformance::onClickHideAvatars, this)); @@ -240,104 +240,106 @@ void FSFloaterPerformance::draw() // tot_frame_time_ns -= tot_limit_time_ns; // tot_frame_time_ns -= tot_sleep_time_ns; - if(tot_frame_time_ns == 0) + if(tot_frame_time_ns != 0) { - LL_WARNS("performance") << "things went wrong, quit while we can." << LL_ENDL; - return; - } - auto pct_avatar_time = (tot_avatar_time_ns * 100)/tot_frame_time_ns; - auto pct_huds_time = (tot_huds_time_ns * 100)/tot_frame_time_ns; - auto pct_ui_time = (tot_ui_time_ns * 100)/tot_frame_time_ns; - auto pct_idle_time = (tot_idle_time_ns * 100)/tot_frame_time_ns; - auto pct_swap_time = (tot_swap_time_ns * 100)/tot_frame_time_ns; - auto pct_scene_render_time = (tot_scene_time_ns * 100)/tot_frame_time_ns; - pct_avatar_time = llclamp(pct_avatar_time,0.,100.); - pct_huds_time = llclamp(pct_huds_time,0.,100.); - pct_ui_time = llclamp(pct_ui_time,0.,100.); - pct_idle_time = llclamp(pct_idle_time,0.,100.); - pct_swap_time = llclamp(pct_swap_time,0.,100.); - pct_scene_render_time = llclamp(pct_scene_render_time,0.,100.); + auto pct_avatar_time = (tot_avatar_time_ns * 100)/tot_frame_time_ns; + auto pct_huds_time = (tot_huds_time_ns * 100)/tot_frame_time_ns; + auto pct_ui_time = (tot_ui_time_ns * 100)/tot_frame_time_ns; + auto pct_idle_time = (tot_idle_time_ns * 100)/tot_frame_time_ns; + auto pct_swap_time = (tot_swap_time_ns * 100)/tot_frame_time_ns; + auto pct_scene_render_time = (tot_scene_time_ns * 100)/tot_frame_time_ns; + pct_avatar_time = llclamp(pct_avatar_time,0.,100.); + pct_huds_time = llclamp(pct_huds_time,0.,100.); + pct_ui_time = llclamp(pct_ui_time,0.,100.); + pct_idle_time = llclamp(pct_idle_time,0.,100.); + pct_swap_time = llclamp(pct_swap_time,0.,100.); + pct_scene_render_time = llclamp(pct_scene_render_time,0.,100.); - args["AV_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_avatar_time)); - args["HUDS_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_huds_time)); - args["UI_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_ui_time)); - args["IDLE_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_idle_time)); - args["SWAP_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_swap_time)); - args["SCENERY_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_scene_render_time)); - args["TOT_FRAME_TIME"] = llformat("%02u", (U32)llround(tot_frame_time_ns/1000000)); - args["FPSCAP"] = llformat("%02u", (U32)fpsCap); - args["FPSTARGET"] = llformat("%02u", (U32)targetFPS); + args["AV_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_avatar_time)); + args["HUDS_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_huds_time)); + args["UI_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_ui_time)); + args["IDLE_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_idle_time)); + args["SWAP_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_swap_time)); + args["SCENERY_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_scene_render_time)); + args["TOT_FRAME_TIME"] = llformat("%02u", (U32)llround(tot_frame_time_ns/1000000)); + args["FPSCAP"] = llformat("%02u", (U32)fpsCap); + args["FPSTARGET"] = llformat("%02u", (U32)targetFPS); - getChild("av_frame_stats")->setText(getString("av_frame_pct", args)); - getChild("huds_frame_stats")->setText(getString("huds_frame_pct", args)); - getChild("frame_breakdown")->setText(getString("frame_stats", args)); - - auto textbox = getChild("fps_warning"); - if (tot_sleep_time_raw > 0) // We are sleeping because view is not focussed - { - textbox->setVisible(true); - textbox->setText(getString("focus_fps")); - textbox->setColor(LLUIColorTable::instance().getColor("DrYellow")); - unreliable = true; - } - else if (tot_limit_time_raw > 0) - { - textbox->setVisible(true); - textbox->setText(getString("limit_fps", args)); - textbox->setColor(LLUIColorTable::instance().getColor("DrYellow")); - unreliable = true; - } - else if (FSPerfStats::autoTune) - { - textbox->setVisible(true); - textbox->setText(getString("tuning_fps", args)); - textbox->setColor(LLUIColorTable::instance().getColor("green")); + getChild("av_frame_stats")->setText(getString("av_frame_pct", args)); + getChild("huds_frame_stats")->setText(getString("huds_frame_pct", args)); + getChild("frame_breakdown")->setText(getString("frame_stats", args)); + + auto textbox = getChild("fps_warning"); + if (tot_sleep_time_raw > 0) // We are sleeping because view is not focussed + { + textbox->setVisible(true); + textbox->setText(getString("focus_fps")); + textbox->setColor(LLUIColorTable::instance().getColor("DrYellow")); + unreliable = true; + } + else if (tot_limit_time_raw > 0) + { + textbox->setVisible(true); + textbox->setText(getString("limit_fps", args)); + textbox->setColor(LLUIColorTable::instance().getColor("DrYellow")); + unreliable = true; + } + else if (FSPerfStats::autoTune) + { + textbox->setVisible(true); + textbox->setText(getString("tuning_fps", args)); + textbox->setColor(LLUIColorTable::instance().getColor("green")); + } + else + { + textbox->setVisible(false); + } + + if (FSPerfStats::autoTune && !unreliable ) + { + // the tuning itself is managed from another thread but we can report progress here + + // Is our target frame time lower than current? If so we need to take action to reduce draw overheads. + if (target_frame_time_ns <= tot_frame_time_ns) + { + U32 non_avatar_time_ns = tot_frame_time_ns - tot_avatar_time_ns; + // If the target frame time < non avatar frame time then we can pototentially reach it. + if (non_avatar_time_ns < target_frame_time_ns) + { + textbox->setColor(LLUIColorTable::instance().getColor("orange")); + } + else + { + // TODO(Beq): Set advisory text for further actions + textbox->setColor(LLUIColorTable::instance().getColor("red")); + } + } + else if (target_frame_time_ns > (tot_frame_time_ns + FSPerfStats::renderAvatarMaxART_ns)) + { + // if we have more time to spare. Display this (the service will update things) + textbox->setColor(LLUIColorTable::instance().getColor("green")); + } + } + + if (mHUDsPanel->getVisible()) + { + populateHUDList(); + } + else if (mNearbyPanel->getVisible()) + { + populateNearbyList(); + mNearbyPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); + } + else if (mComplexityPanel->getVisible()) + { + populateObjectList(); + } } else { - textbox->setVisible(false); + LL_WARNS("performance") << "Scene time 0. Skipping til we have data." << LL_ENDL; } - - if (FSPerfStats::autoTune && !unreliable ) - { - // the tuning itself is managed from another thread but we can report progress here - - // Is our target frame time lower than current? If so we need to take action to reduce draw overheads. - if (target_frame_time_ns <= tot_frame_time_ns) - { - U32 non_avatar_time_ns = tot_frame_time_ns - tot_avatar_time_ns; - // If the target frame time < non avatar frame time then we can pototentially reach it. - if (non_avatar_time_ns < target_frame_time_ns) - { - textbox->setColor(LLUIColorTable::instance().getColor("orange")); - } - else - { - // TODO(Beq): Set advisory text for further actions - textbox->setColor(LLUIColorTable::instance().getColor("red")); - } - } - else if (target_frame_time_ns > (tot_frame_time_ns + FSPerfStats::renderAvatarMaxART_ns)) - { - // if we have more time to spare. Display this (the service will update things) - textbox->setColor(LLUIColorTable::instance().getColor("green")); - } - } - - if (mHUDsPanel->getVisible()) - { - populateHUDList(); - } - else if (mNearbyPanel->getVisible()) - { - populateNearbyList(); - mNearbyPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); - } - else if (mComplexityPanel->getVisible()) - { - populateObjectList(); - } - + mUpdateTimer->setTimerExpirySec(REFRESH_INTERVAL); } LLFloater::draw(); @@ -732,11 +734,9 @@ void FSFloaterPerformance::detachItem(const LLUUID& item_id) void FSFloaterPerformance::onChangeQuality(const LLSD& data) { - LLFloaterPreference* instance = LLFloaterReg::getTypedInstance("preferences"); - if (instance) - { - instance->onChangeQuality(data); - } + U32 level = (U32)(data.asReal()); + LLFeatureManager::getInstance()->setGraphicsLevel(level, true); + refresh(); } void FSFloaterPerformance::onClickHideAvatars() diff --git a/indra/newview/fsperfstats.cpp b/indra/newview/fsperfstats.cpp index 6d009e059d..fdbbd72ef4 100644 --- a/indra/newview/fsperfstats.cpp +++ b/indra/newview/fsperfstats.cpp @@ -109,6 +109,7 @@ namespace FSPerfStats unreliable = true; lastStats[static_cast(StatType_t::RENDER_FPSLIMIT)] = sceneStats[static_cast(StatType_t::RENDER_FPSLIMIT)]; lastStats[static_cast(StatType_t::RENDER_SLEEP)] = sceneStats[static_cast(StatType_t::RENDER_SLEEP)]; + lastStats[static_cast(StatType_t::RENDER_FRAME)] = sceneStats[static_cast(StatType_t::RENDER_FRAME)]; // bring over the total frame render time to deal with region crossing overlap issues } if(!unreliable) diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h index ed71ff36fd..1196bc58c1 100644 --- a/indra/newview/llappviewerlinux.h +++ b/indra/newview/llappviewerlinux.h @@ -27,15 +27,17 @@ #ifndef LL_LLAPPVIEWERLINUX_H #define LL_LLAPPVIEWERLINUX_H +#ifdef LL_GLIB extern "C" { # include -} #if LL_DBUS_ENABLED -extern "C" { # include # include +#endif + } + #endif #ifndef LL_LLAPPVIEWER_H @@ -70,7 +72,7 @@ protected: virtual bool sendURLToOtherInstance(const std::string& url); }; -#if LL_DBUS_ENABLED +#if LL_DBUS_ENABLED && LL_GLIB typedef struct { GObject parent; diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index e8d523c8ec..1d440fe309 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -885,6 +885,7 @@ static void on_avatar_name_cache_notify(const LLUUID& agent_id, } else { + args["ONLINE_STATUS"] = true; LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args); } diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index 01790ad19e..9db6aa1d8a 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -41,6 +41,11 @@ # include "llfilepicker.h" #endif +#ifdef LL_FLTK + #include "FL/Fl.H" + #include "FL/Fl_Native_File_Chooser.H" +#endif + // // Globals // @@ -193,32 +198,41 @@ LLDirPicker::LLDirPicker() : mFileName(NULL), mLocked(false) { +#ifndef LL_FLTK mFilePicker = new LLFilePicker(); +#endif + reset(); } LLDirPicker::~LLDirPicker() { +#ifndef LL_FLTK delete mFilePicker; +#endif } void LLDirPicker::reset() { +#ifndef LL_FLTK if (mFilePicker) - mFilePicker->reset(); + mFilePicker->reset(); +#else + mDir = ""; +#endif } BOOL LLDirPicker::getDir(std::string* filename, bool blocking) { reset(); - // if local file browsing is turned off, return without opening dialog if ( check_local_file_access_enabled() == false ) { return FALSE; } +#ifndef LL_FLTK #if !LL_MESA_HEADLESS if (mFilePicker) @@ -237,15 +251,38 @@ BOOL LLDirPicker::getDir(std::string* filename, bool blocking) #endif // !LL_MESA_HEADLESS return FALSE; +#else + Fl_Native_File_Chooser flDlg; + flDlg.title("Pick a dir"); + flDlg.type(Fl_Native_File_Chooser::BROWSE_DIRECTORY ); + + int res = flDlg.show(); + if( res == 0 ) + { + char const *pDir = flDlg.filename(0); + if( pDir ) + mDir = pDir; + } + else if( res == -1 ) + { + LL_WARNS() << "FLTK failed: " << flDlg.errmsg() << LL_ENDL; + } + + return !mDir.empty(); +#endif } std::string LLDirPicker::getDirName() { +#ifndef LL_FLTK if (mFilePicker) { return mFilePicker->getFirstFile(); } return ""; +#else + return mDir; +#endif } #else // not implemented diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h index 52febe4523..5683e34131 100644 --- a/indra/newview/lldirpicker.h +++ b/indra/newview/lldirpicker.h @@ -80,7 +80,7 @@ private: #if LL_LINUX || LL_DARWIN // On Linux we just implement LLDirPicker on top of LLFilePicker - LLFilePicker *mFilePicker; + // LLFilePicker *mFilePicker; #endif diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index be62f7b3a9..f02363505f 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -36,10 +36,16 @@ #include "llviewercontrol.h" #include "llwindow.h" // beforeDialog() +#undef LL_GTK #if LL_SDL #include "llwindowsdl.h" // for some X/GTK utils to help with filepickers #endif // LL_SDL +#ifdef LL_FLTK + #include "FL/Fl.H" + #include "FL/Fl_Native_File_Chooser.H" +#endif + #if LL_LINUX #include "llhttpconstants.h" // file picker uses some of thes constants on Linux #endif @@ -1566,12 +1572,79 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking) return rtn; } +#elif LL_FLTK +BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking ) +{ + return openFileDialog( filter, blocking, eSaveFile ); +} + +BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking ) +{ + return openFileDialog( filter, blocking, eOpenFile ); +} + +BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking) +{ + return openFileDialog( filter, blocking, eOpenMultiple ); +} + +void setupFilter( Fl_Native_File_Chooser &chooser, LLFilePicker::ESaveFilter filter ) +{ +} + +void setupFilter( Fl_Native_File_Chooser &chooser, LLFilePicker::ELoadFilter filter ) +{ +} + +bool LLFilePicker::openFileDialog( int32_t filter, bool blocking, EType aType ) +{ + if ( check_local_file_access_enabled() == false ) + return false; + + reset(); + Fl_Native_File_Chooser::Type flType = Fl_Native_File_Chooser::BROWSE_FILE; + + if( aType == eOpenMultiple ) + flType = Fl_Native_File_Chooser::BROWSE_MULTI_FILE; + else if( aType == eSaveFile ) + flType = Fl_Native_File_Chooser::BROWSE_SAVE_FILE; + + Fl_Native_File_Chooser flDlg; + flDlg.title("Pick a file"); + flDlg.type( flType ); + + if( aType == eSaveFile ) + setupFilter( flDlg, (ESaveFilter) filter ); + else + setupFilter( flDlg, (ELoadFilter) filter ); + + int res = flDlg.show(); + if( res == 0 ) + { + int32_t count = flDlg.count(); + if( count < 0 ) + count = 0; + for( int32_t i = 0; i < count; ++i ) + { + char const *pFile = flDlg.filename(i); + if( pFile && strlen(pFile) > 0 ) + mFiles.push_back( pFile ); + } + } + else if( res == -1 ) + { + LL_WARNS() << "FLTK failed: " << flDlg.errmsg() << LL_ENDL; + } + + return mFiles.empty()?FALSE:TRUE; +} + # else // LL_GTK // Hacky stubs designed to facilitate fake getSaveFile and getOpenFile with // static results, when we don't have a real filepicker. -BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename ) +BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking ) { // if local file browsing is turned off, return without opening dialog // (Even though this is a stub, I think we still should not return anything at all) @@ -1634,7 +1707,7 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking) #else // not implemented -BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename ) +BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blockin ) { reset(); return FALSE; diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 53ea7fd316..1aa5802d02 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -33,6 +33,12 @@ #ifndef LL_LLFILEPICKER_H #define LL_LLFILEPICKER_H +#if LL_FLTK + #if LL_GTK + #undef LL_GTK + #endif +#endif + #include "stdtypes.h" #if LL_DARWIN @@ -58,12 +64,13 @@ extern "C" { // mostly for Linux, possible on others #if LL_GTK # include "gtk/gtk.h" +#error "Direct use of GTK is deprecated" #endif // LL_GTK } class LLFilePicker { -#ifdef LL_GTK +#if LL_GTK friend class LLDirPicker; friend void chooser_responder(GtkWidget *, gint, gpointer); #endif // LL_GTK @@ -187,7 +194,14 @@ private: // we also remember the extension of the last added file. std::string mCurrentExtension; #endif - +#if LL_FLTK + enum EType + { + eSaveFile, eOpenFile, eOpenMultiple + }; + bool openFileDialog( int32_t filter, bool blocking, EType aType ); +#endif + std::vector mFiles; S32 mCurrentFile; bool mLocked; diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 3136f96fe4..2031fc6a4e 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -569,7 +569,7 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, RlvUtil::filterLocation(tmp_chat.mText); tmp_chat.mRlvLocFiltered = TRUE; } - if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) && (!tmp_chat.mRlvNamesFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) ) + if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) && (!tmp_chat.mRlvNamesFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) && (!args.has("ONLINE_STATUS") || !args["ONLINE_STATUS"].asBoolean()) ) { RlvUtil::filterNames(tmp_chat.mText); tmp_chat.mRlvNamesFiltered = TRUE; diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index c60ab8ca2a..500ec37738 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -334,15 +334,15 @@ BOOL LLFloaterTools::postBuild() sShowObjectCost = gSavedSettings.getBOOL("ShowObjectRenderingCost"); // Added back more/less button - LLButton* btnExpand = getChild("btnExpand"); + LLButton* btnExpand = findChild("btnExpand"); if (btnExpand && mTab) { mExpandedHeight = getRect().getHeight(); mCollapsedHeight = mExpandedHeight - mTab->getRect().getHeight() + btnExpand->getRect().getHeight(); - if(!gSavedSettings.getBOOL("FSToolboxExpanded")) + if (!gSavedSettings.getBOOL("FSToolboxExpanded")) { mTab->setVisible(FALSE); - reshape( getRect().getWidth(), mCollapsedHeight); + reshape(getRect().getWidth(), mCollapsedHeight); btnExpand->setImageOverlay("Arrow_Down", btnExpand->getImageOverlayHAlign()); } } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 5f37b868f5..7bbc41783a 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -619,7 +619,8 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if(update_cache) { - objectp = regionp->updateCacheEntry(local_id, objectp, update_type); + //update object cache if the object receives a full-update or terse update + objectp = regionp->updateCacheEntry(local_id, objectp); } // This looks like it will break if the local_id of the object doesn't change diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 00ad76fc31..a2c8ba80aa 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1855,13 +1855,8 @@ LLViewerObject* LLViewerRegion::addNewObject(LLVOCacheEntry* entry) //update object cache if the object receives a full-update or terse update //update_type == EObjectUpdateType::OUT_TERSE_IMPROVED or EObjectUpdateType::OUT_FULL -LLViewerObject* LLViewerRegion::updateCacheEntry(U32 local_id, LLViewerObject* objectp, U32 update_type) +LLViewerObject* LLViewerRegion::updateCacheEntry(U32 local_id, LLViewerObject* objectp) { - if(objectp && update_type != (U32)OUT_TERSE_IMPROVED) - { - return objectp; //no need to access cache - } - LLVOCacheEntry* entry = getCacheEntry(local_id); if (!entry) { @@ -1873,11 +1868,8 @@ LLViewerObject* LLViewerRegion::updateCacheEntry(U32 local_id, LLViewerObject* o objectp = addNewObject(entry); } - //remove from cache if terse update - if(update_type == (U32)OUT_TERSE_IMPROVED) - { - killCacheEntry(entry, true); - } + //remove from cache. + killCacheEntry(entry, true); return objectp; } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 2aa8258a75..77acc5a98b 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -380,7 +380,7 @@ public: void requestCacheMisses(); void addCacheMissFull(const U32 local_id); //update object cache if the object receives a full-update or terse update - LLViewerObject* updateCacheEntry(U32 local_id, LLViewerObject* objectp, U32 update_type); + LLViewerObject* updateCacheEntry(U32 local_id, LLViewerObject* objectp); void findOrphans(U32 parent_id); void clearCachedVisibleObjects(); void dumpCache(); diff --git a/indra/newview/skins/default/xui/de/floater_performance.xml b/indra/newview/skins/default/xui/de/floater_performance.xml index 28a98d3e55..4985f92000 100644 --- a/indra/newview/skins/default/xui/de/floater_performance.xml +++ b/indra/newview/skins/default/xui/de/floater_performance.xml @@ -48,7 +48,7 @@ - + diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index 10d9c71fc6..fedea24bd3 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -7,8 +7,6 @@ save_rect="true" title="Improve Graphics Speed (Experimental)" can_resize="false" - min_height="652" - max_height="652" min_width="580" width="580"> @@ -172,7 +170,6 @@ Target [FPSTARGET] fps + width="190" /> +width="190" /> +width="190" /> - - + diff --git a/indra/newview/skins/default/xui/ru/floater_performance.xml b/indra/newview/skins/default/xui/ru/floater_performance.xml index 37f18b0b27..2380f6de67 100644 --- a/indra/newview/skins/default/xui/ru/floater_performance.xml +++ b/indra/newview/skins/default/xui/ru/floater_performance.xml @@ -38,7 +38,7 @@ - + diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml b/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml index 23944592a9..5701593277 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml @@ -225,6 +225,7 @@ + diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 22e67d5684..c9bfd76b0d 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1993,7 +1993,7 @@ class LinuxManifest(ViewerManifest): self.path("libopenal.so", "libopenal.so.1") # Install as versioned file in case it's missing from the 3p- and won't get copied below self.path("libopenal.so*") #self.path("libnotify.so.1.1.2", "libnotify.so.1") # LO - uncomment when testing libnotify(growl) on linux - self.path("libpangox-1.0.so*") + #self.path("libpangox-1.0.so*") # KLUDGE: As of 2012-04-11, the 'fontconfig' package installs # libfontconfig.so.1.4.4, along with symlinks libfontconfig.so.1 # and libfontconfig.so. Before we added support for library-file @@ -2078,7 +2078,7 @@ class LinuxManifest(ViewerManifest): [os.path.join(self.get_dst_prefix(), dir) for dir in ('bin', 'lib')] + # Remove VMP # ['-type', 'f', '!', '-name', '*.py', - ['-type', 'f', "!", "-name", "*.dat", "!", "-name", "*.pak", "!", "-name", "*.bin", + ['-type', 'f', "!", "-name", "*.dat", "!", "-name", "*.pak", "!", "-name", "*.bin", "!", "-name", "*.lib", "!", "-name", "*.pdb", # Remove VMP '!', '-name', 'update_install', '-exec', 'strip', '-S', '{}', ';']) @@ -2181,7 +2181,7 @@ class Linux_x86_64_Manifest(LinuxManifest): if self.is_packaging_viewer(): with self.prefix(src=os.path.join(pkgdir, 'lib', 'release'), dst="lib"): - self.path("libffi*.so*") + #self.path("libffi*.so*") # vivox 32-bit hack. # one has to extract libopenal.so from the 32-bit openal package, or official LL viewer, and rename it to libopenal32.so # and place it in the prebuilt lib/release directory diff --git a/scripts/configure_firestorm.sh b/scripts/configure_firestorm.sh index 3f5f4b1f2f..5d58566116 100755 --- a/scripts/configure_firestorm.sh +++ b/scripts/configure_firestorm.sh @@ -42,6 +42,7 @@ WANTS_TESTBUILD=$FALSE WANTS_TRACY=$FALSE WANTS_BUILD=$FALSE WANTS_CRASHREPORTING=$FALSE +WANTS_CACHE=$FALSE TARGET_PLATFORM="darwin" # darwin, windows, linux BTYPE="Release" CHANNEL="" # will be overwritten later with platform-specific values unless manually specified. @@ -83,8 +84,9 @@ showUsage() echo " --testbuild : Create time-limited test build (build date + )" echo " --platform : Build for specified platform (darwin | windows | linux)" echo " --jobs : Build with jobs in parallel (Linux and Darwin only)" - echo " --ninja : Build using Ninja (Linux only)" + echo " --ninja : Build using Ninja" echo " --vscode : Exports compile commands for VSCode (Linux only)" + echo " --compiler-cache : Try to detect and use compiler cache (needs also --ninja for OSX and Windows)" echo echo "All arguments not in the above list will be passed through to LL's configure/build." echo @@ -94,7 +96,7 @@ getArgs() # $* = the options passed in from main { if [ $# -gt 0 ]; then - while getoptex "clean build config version package no-package fmodstudio openal ninja vscode jobs: platform: kdu opensim no-opensim singlegrid: avx avx2 tracy crashreporting testbuild: help chan: btype:" "$@" ; do + while getoptex "clean build config version package no-package fmodstudio openal ninja vscode compiler-cache jobs: platform: kdu opensim no-opensim singlegrid: avx avx2 tracy crashreporting testbuild: help chan: btype:" "$@" ; do #ensure options are valid if [ -z "$OPTOPT" ] ; then @@ -133,6 +135,7 @@ getArgs() jobs) JOBS="$OPTARG";; ninja) WANTS_NINJA=$TRUE;; vscode) WANTS_VSCODE=$TRUE;; + compiler-cache) WANTS_CACHE=$TRUE;; help) showUsage && exit 0;; @@ -324,6 +327,7 @@ echo -e " BUILD: `b2a $WANTS_BUILD`" | echo -e " CONFIG: `b2a $WANTS_CONFIG`" | tee -a $LOG echo -e " NINJA: `b2a $WANTS_NINJA`" | tee -a $LOG echo -e " VSCODE: `b2a $WANTS_VSCODE`" | tee -a $LOG +echo -e " COMPILER CACHE: `b2a $WANTS_CACHE`" | tee -a $LOG echo -e " PASSTHRU: $LL_ARGS_PASSTHRU" | tee -a $LOG echo -e " BTYPE: $BTYPE" | tee -a $LOG if [ $TARGET_PLATFORM == "linux" -o $TARGET_PLATFORM == "darwin" ] ; then @@ -525,11 +529,7 @@ if [ $WANTS_CONFIG -eq $TRUE ] ; then TARGET="Xcode" elif [ \( $TARGET_PLATFORM == "linux" \) ] ; then OPENAL="-DOPENAL:BOOL=ON" - if [ $WANTS_NINJA -eq $TRUE ] ; then - TARGET="Ninja" - else - TARGET="Unix Makefiles" - fi + TARGET="Unix Makefiles" if [ $WANTS_VSCODE -eq $TRUE ] ; then VSCODE_FLAGS="-DCMAKE_EXPORT_COMPILE_COMMANDS=On" ROOT_DIR=$(dirname $(dirname $(readlink -f $0))) @@ -545,8 +545,28 @@ if [ $WANTS_CONFIG -eq $TRUE ] ; then UNATTENDED="-DUNATTENDED=ON" fi + if [ $WANTS_NINJA -eq $TRUE ] ; then + TARGET="Ninja" + fi + + CACHE_OPT="" + + if [ $WANTS_CACHE -eq $TRUE ] + then + if [ `which ccache 2>/dev/null` ] + then + echo "Found ccache" + CACHE_OPT="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" + fi + if [ `which buildcache 2>/dev/null` ] + then + echo "Found buildcache" + CACHE_OPT="-DCMAKE_C_COMPILER_LAUNCHER=buildcache -DCMAKE_CXX_COMPILER_LAUNCHER=buildcache" + fi + fi + cmake -G "$TARGET" ../indra $CHANNEL ${GITHASH} $FMODSTUDIO $OPENAL $KDU $OPENSIM $SINGLEGRID $AVX_OPTIMIZATION $AVX2_OPTIMIZATION $TRACY_PROFILER $TESTBUILD $PACKAGE \ - $UNATTENDED -DLL_TESTS:BOOL=OFF -DADDRESS_SIZE:STRING=$AUTOBUILD_ADDRSIZE -DCMAKE_BUILD_TYPE:STRING=$BTYPE \ + $UNATTENDED -DLL_TESTS:BOOL=OFF -DADDRESS_SIZE:STRING=$AUTOBUILD_ADDRSIZE -DCMAKE_BUILD_TYPE:STRING=$BTYPE $CACHE_OPT \ $CRASH_REPORTING -DVIEWER_SYMBOL_FILE:STRING="${VIEWER_SYMBOL_FILE:-}" -DROOT_PROJECT_NAME:STRING=Firestorm $LL_ARGS_PASSTHRU ${VSCODE_FLAGS:-} | tee $LOG if [ $TARGET_PLATFORM == "windows" ] ; then diff --git a/scripts/export_for_merge.sh b/scripts/export_for_merge.sh deleted file mode 100644 index 40cef000f6..0000000000 --- a/scripts/export_for_merge.sh +++ /dev/null @@ -1,11 +0,0 @@ -if [ -d exp/ ] -then - rm exp/*.diff -else - mkdir exp -fi - -for i in $(cat exp.txt) -do - hg export -o exp/$i.diff -r $i - done diff --git a/scripts/import_to_branch.sh b/scripts/import_to_branch.sh deleted file mode 100644 index e05e94e5fa..0000000000 --- a/scripts/import_to_branch.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -read -p "Calling hg revert and purge on indra/. Then importing changes. Continue? " ANSWER - -case "$ANSWER" in - y|Y)echo "Carrying on" - ;; - *) echo "Exit" - exit 0 - ;; -esac - -if [ ! -d indra/ ] -then - echo "Indra directory not found" - exit 1 -fi - -hg revert indra/ -hg revert autobuild.xml -hg purge indra/ - -for i in $(cat exp.txt|sort -n) -do - echo "Importing change $i" - hg import --no-commit -f exp/$i.diff || exit 1 -done - -read -p "All patches applied without errors. Apply them again and commit? " ANSWER - -case "$ANSWER" in - y|Y)echo "Carrying on" - ;; - *) echo "Exit" - exit 0 - ;; -esac - -hg revert indra/ -hg revert autobuild.xml -hg purge indra/ - -for i in $(cat exp.txt|sort -n) -do - echo "Importing change $i" - hg import exp/$i.diff || exit 1 -done