merge changes for 3.4.5
commit
c880c961bb
|
|
@ -393,3 +393,27 @@ cd39255bd23330fd30c04105f2811e941d8524fe 3.4.4-beta2
|
|||
c374035d459af3c03dea2dd90880dfc25de64706 DRTVWR-275
|
||||
05d9f1dd7a954069af2a33abedb7713fa36a04cb 3.4.4-beta4
|
||||
e1bb1ae7d8b12faeb37933a737c199cc9b9f89cc 3.4.4-release
|
||||
391a8c74cec7275c5d26c85ad108d4782a3e3dd9 DRTVWR-268
|
||||
a36f1f354b02aa6e448ca13685de167d0a0a3d03 DRTVWR-272
|
||||
37dba00ad820de3a808d4039396b162a9c275b3e DRTVWR-269
|
||||
7c6dfdc1b7a2ce0d8e3a8f3ce3058547ea065c0f DRTVWR-250
|
||||
b9ff9730daa53a541925300cbd02bb14575a5705 DRTVWR-277
|
||||
af6b711a97073431953b55ee808aaa09900c27e5 DRTVWR-276
|
||||
8302fefde6c8f4a64bfc7f04929f8bc85f5c6c7b DRTVWR-279
|
||||
c296133849d1f103c0e2abc41e6599daed00b67b DRTVWR-280
|
||||
40a2265058abc9fde4914c10185f916435818621 3.4.5-beta1
|
||||
5df4802bec93c8d0a509946d826bb4c50c5442ec DRTVWR-281
|
||||
7c1c33ba4cfd2d15ca51cc1ac440eca551331a4a DRTVWR-283
|
||||
6b9c7dbebef793230d64e1b452577c8b142d4143 3.4.5-beta2
|
||||
ccf991e02dc2f63fb646324230d54832683f4a9b DRTVWR-286
|
||||
2d849850558a5a0324b398d1c102d30bcbdfb88f DRTVWR-287
|
||||
e06898df8644fe567bee94f817d03abc1c380993 3.4.5-beta3
|
||||
a676b4d6c037b39fe5b8e42cf8839a9303936089 DRTVWR-289
|
||||
28fa8b944a0c1869636ab00cc400f5aa71f6fa3c DRTVWR-290
|
||||
7f09bbc28c297f14b67961be7b6575445fa160e8 DRTVWR-291
|
||||
b23419a2748483c98f3b84b630468a21c88feba5 DRTVWR-292
|
||||
1567de5700c273b583dac41b64275c223287306e 3.4.5-beta4
|
||||
1cce8447f8f574673e3f47d6fe584262e6964fe2 DRTVWR-296
|
||||
0a5d409161ef2a89b28c9a741051dd2dedc707d6 DRTVWR-297
|
||||
852b69ef0b5fe6b13b69cc2217282cc64de6afab 3.4.5-beta5
|
||||
a49c715243a36a8a380504d14cb7416b3039c956 3.4.5-release
|
||||
|
|
|
|||
|
|
@ -1463,6 +1463,30 @@
|
|||
</map>
|
||||
</map>
|
||||
</map>
|
||||
<key>nvapi</key>
|
||||
<map>
|
||||
<key>license</key>
|
||||
<string>NVAPI</string>
|
||||
<key>license_file</key>
|
||||
<string>LICENSES/NVAPI_SDK_License_Agreement.pdf</string>
|
||||
<key>name</key>
|
||||
<string>nvapi</string>
|
||||
<key>platforms</key>
|
||||
<map>
|
||||
<key>windows</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>baf519d36dffe4e4a59471450e391d01</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-nvapi/rev/267102/arch/CYGWIN/installer/nvapi-304-windows-20121116.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
</map>
|
||||
</map>
|
||||
</map>
|
||||
<key>ogg-vorbis</key>
|
||||
<map>
|
||||
<key>license</key>
|
||||
|
|
|
|||
|
|
@ -895,6 +895,7 @@ NickyD
|
|||
MAINT-873
|
||||
Nicky Dasmijn
|
||||
VWR-29228
|
||||
MAINT-873
|
||||
Nicky Perian
|
||||
OPEN-1
|
||||
STORM-1087
|
||||
|
|
@ -1250,6 +1251,7 @@ Whimsy Winx
|
|||
Whirly Fizzle
|
||||
STORM-1895
|
||||
MAINT-873
|
||||
STORM-1930
|
||||
Whoops Babii
|
||||
VWR-631
|
||||
VWR-1640
|
||||
|
|
|
|||
|
|
@ -82,8 +82,7 @@ if (VIEWER)
|
|||
|
||||
if (LINUX)
|
||||
add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
|
||||
add_subdirectory(${VIEWER_PREFIX}linux_updater)
|
||||
add_dependencies(viewer linux-crash-logger-strip-target linux-updater)
|
||||
add_dependencies(viewer linux-crash-logger-strip-target)
|
||||
elseif (DARWIN)
|
||||
add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
|
||||
add_subdirectory(${VIEWER_PREFIX}mac_updater)
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
|
|||
if (WINDOWS)
|
||||
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname}
|
||||
PROPERTIES
|
||||
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${TCMALLOC_LINK_FLAGS}"
|
||||
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS"
|
||||
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
|
||||
LINK_FLAGS_RELEASE ""
|
||||
)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ else (LINUX)
|
|||
set(LLCOMMON_LIBRARIES llcommon)
|
||||
endif (LINUX)
|
||||
|
||||
add_definitions(${TCMALLOC_FLAG})
|
||||
# add_definitions(${TCMALLOC_FLAG})
|
||||
|
||||
set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a static library.")
|
||||
if(LLCOMMON_LINK_SHARED)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
set(NVAPI ON CACHE BOOL "Use NVAPI.")
|
||||
|
||||
if (NVAPI)
|
||||
if (WINDOWS)
|
||||
use_prebuilt_binary(nvapi)
|
||||
set(NVAPI_LIBRARY nvapi)
|
||||
else (WINDOWS)
|
||||
set(NVAPI_LIBRARY "")
|
||||
endif (WINDOWS)
|
||||
else (NVAPI)
|
||||
set(NVAPI_LIBRARY "")
|
||||
endif (NVAPI)
|
||||
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
project(linux_updater)
|
||||
|
||||
include(00-Common)
|
||||
include(CURL)
|
||||
include(CARes)
|
||||
include(OpenSSL)
|
||||
include(UI)
|
||||
include(LLCommon)
|
||||
include(LLVFS)
|
||||
include(LLXML)
|
||||
include(LLUI)
|
||||
include(Linking)
|
||||
|
||||
include_directories(
|
||||
${LLCOMMON_INCLUDE_DIRS}
|
||||
${LLVFS_INCLUDE_DIRS}
|
||||
${LLXML_INCLUDE_DIRS}
|
||||
${LLUI_INCLUDE_DIRS}
|
||||
${CURL_INCLUDE_DIRS}
|
||||
${CARES_INCLUDE_DIRS}
|
||||
${OPENSSL_INCLUDE_DIRS}
|
||||
${UI_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(linux_updater_SOURCE_FILES linux_updater.cpp)
|
||||
|
||||
set(linux_updater_HEADER_FILES CMakeLists.txt)
|
||||
|
||||
set_source_files_properties(${linux_updater_HEADER_FILES}
|
||||
PROPERTIES HEADER_FILES_ONLY TRUE)
|
||||
|
||||
list(APPEND linux_updater_SOURCE_FILES ${linux_updater_HEADER_FILES})
|
||||
|
||||
add_executable(linux-updater ${linux_updater_SOURCE_FILES})
|
||||
|
||||
target_link_libraries(linux-updater
|
||||
${CURL_LIBRARIES}
|
||||
${CARES_LIBRARIES}
|
||||
${OPENSSL_LIBRARIES}
|
||||
${CRYPTO_LIBRARIES}
|
||||
${UI_LIBRARIES}
|
||||
${LLXML_LIBRARIES}
|
||||
${LLUI_LIBRARIES}
|
||||
${LLVFS_LIBRARIES}
|
||||
${LLCOMMON_LIBRARIES}
|
||||
)
|
||||
|
||||
add_custom_target(linux-updater-target ALL
|
||||
DEPENDS linux-updater)
|
||||
|
|
@ -1,926 +0,0 @@
|
|||
/**
|
||||
* @file linux_updater.cpp
|
||||
* @author Kyle Ambroff <ambroff@lindenlab.com>, Tofu Linden
|
||||
* @brief Viewer update program for unix platforms that support GTK+
|
||||
*
|
||||
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "llerrorcontrol.h"
|
||||
#include "llfile.h"
|
||||
#include "lldir.h"
|
||||
#include "lldiriterator.h"
|
||||
|
||||
/*==========================================================================*|
|
||||
// IQA-490: Use of LLTrans -- by this program at least -- appears to be buggy.
|
||||
// With it, the 3.3.2 beta 1 linux-updater.bin crashes; without it seems stable.
|
||||
#include "llxmlnode.h"
|
||||
#include "lltrans.h"
|
||||
|*==========================================================================*/
|
||||
|
||||
static class LLTrans
|
||||
{
|
||||
public:
|
||||
LLTrans();
|
||||
static std::string getString(const std::string& key);
|
||||
|
||||
private:
|
||||
std::string _getString(const std::string& key) const;
|
||||
|
||||
typedef std::map<std::string, std::string> MessageMap;
|
||||
MessageMap mMessages;
|
||||
} sLLTransInstance;
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <map>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
extern "C" {
|
||||
#include <gtk/gtk.h>
|
||||
}
|
||||
|
||||
const guint UPDATE_PROGRESS_TIMEOUT = 100;
|
||||
const guint UPDATE_PROGRESS_TEXT_TIMEOUT = 1000;
|
||||
const guint ROTATE_IMAGE_TIMEOUT = 8000;
|
||||
|
||||
typedef struct _updater_app_state {
|
||||
std::string app_name;
|
||||
std::string url;
|
||||
std::string file;
|
||||
std::string image_dir;
|
||||
std::string dest_dir;
|
||||
std::string strings_dirs;
|
||||
std::string strings_file;
|
||||
|
||||
LLDirIterator *image_dir_iter;
|
||||
|
||||
GtkWidget *window;
|
||||
GtkWidget *progress_bar;
|
||||
GtkWidget *image;
|
||||
|
||||
double progress_value;
|
||||
bool activity_mode;
|
||||
|
||||
guint image_rotation_timeout_id;
|
||||
guint progress_update_timeout_id;
|
||||
guint update_progress_text_timeout_id;
|
||||
|
||||
bool failure;
|
||||
} UpdaterAppState;
|
||||
|
||||
// List of entries from strings.xml to always replace
|
||||
static std::set<std::string> default_trans_args;
|
||||
void init_default_trans_args()
|
||||
{
|
||||
default_trans_args.insert("SECOND_LIFE"); // World
|
||||
default_trans_args.insert("APP_NAME");
|
||||
default_trans_args.insert("SECOND_LIFE_GRID");
|
||||
default_trans_args.insert("SUPPORT_SITE");
|
||||
}
|
||||
|
||||
bool translate_init(std::string comma_delim_path_list,
|
||||
std::string base_xml_name)
|
||||
{
|
||||
return true;
|
||||
/*==========================================================================*|
|
||||
init_default_trans_args();
|
||||
|
||||
// extract paths string vector from comma-delimited flat string
|
||||
std::vector<std::string> paths;
|
||||
LLStringUtil::getTokens(comma_delim_path_list, paths, ","); // split over ','
|
||||
|
||||
for(std::vector<std::string>::iterator it = paths.begin(), end_it = paths.end();
|
||||
it != end_it;
|
||||
++it)
|
||||
{
|
||||
(*it) = gDirUtilp->findSkinnedFilename(*it, base_xml_name);
|
||||
}
|
||||
|
||||
// suck the translation xml files into memory
|
||||
LLXMLNodePtr root;
|
||||
bool success = LLXMLNode::getLayeredXMLNode(root, paths);
|
||||
if (!success)
|
||||
{
|
||||
// couldn't load string table XML
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// get those strings out of the XML
|
||||
LLTrans::parseStrings(root, default_trans_args);
|
||||
return true;
|
||||
}
|
||||
|*==========================================================================*/
|
||||
}
|
||||
|
||||
|
||||
void updater_app_ui_init(void);
|
||||
void updater_app_quit(UpdaterAppState *app_state);
|
||||
void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state);
|
||||
std::string next_image_filename(std::string& image_path, LLDirIterator& iter);
|
||||
void display_error(GtkWidget *parent, std::string title, std::string message);
|
||||
BOOL install_package(std::string package_file, std::string destination);
|
||||
BOOL spawn_viewer(UpdaterAppState *app_state);
|
||||
|
||||
extern "C" {
|
||||
void on_window_closed(GtkWidget *sender, GdkEvent *event, gpointer state);
|
||||
gpointer worker_thread_cb(gpointer *data);
|
||||
int download_progress_cb(gpointer data, double t, double d, double utotal, double ulnow);
|
||||
gboolean rotate_image_cb(gpointer data);
|
||||
gboolean progress_update_timeout(gpointer data);
|
||||
gboolean update_progress_text_timeout(gpointer data);
|
||||
}
|
||||
|
||||
void updater_app_ui_init(UpdaterAppState *app_state)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *summary_label;
|
||||
GtkWidget *description_label;
|
||||
GtkWidget *frame;
|
||||
|
||||
llassert(app_state != NULL);
|
||||
|
||||
// set up window and main container
|
||||
std::string window_title = LLTrans::getString("UpdaterWindowTitle");
|
||||
app_state->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title(GTK_WINDOW(app_state->window),
|
||||
window_title.c_str());
|
||||
gtk_window_set_resizable(GTK_WINDOW(app_state->window), FALSE);
|
||||
gtk_window_set_position(GTK_WINDOW(app_state->window),
|
||||
GTK_WIN_POS_CENTER_ALWAYS);
|
||||
|
||||
gtk_container_set_border_width(GTK_CONTAINER(app_state->window), 12);
|
||||
g_signal_connect(G_OBJECT(app_state->window), "delete-event",
|
||||
G_CALLBACK(on_window_closed), app_state);
|
||||
|
||||
vbox = gtk_vbox_new(FALSE, 6);
|
||||
gtk_container_add(GTK_CONTAINER(app_state->window), vbox);
|
||||
|
||||
// set top label
|
||||
std::ostringstream label_ostr;
|
||||
label_ostr << "<big><b>"
|
||||
<< LLTrans::getString("UpdaterNowUpdating")
|
||||
<< "</b></big>";
|
||||
|
||||
summary_label = gtk_label_new(NULL);
|
||||
gtk_label_set_use_markup(GTK_LABEL(summary_label), TRUE);
|
||||
gtk_label_set_markup(GTK_LABEL(summary_label),
|
||||
label_ostr.str().c_str());
|
||||
gtk_misc_set_alignment(GTK_MISC(summary_label), 0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), summary_label, FALSE, FALSE, 0);
|
||||
|
||||
// create the description label
|
||||
description_label = gtk_label_new(LLTrans::getString("UpdaterUpdatingDescriptive").c_str());
|
||||
gtk_label_set_line_wrap(GTK_LABEL(description_label), TRUE);
|
||||
gtk_misc_set_alignment(GTK_MISC(description_label), 0, 0.5);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), description_label, FALSE, FALSE, 0);
|
||||
|
||||
// If an image path has been set, load the background images
|
||||
if (!app_state->image_dir.empty()) {
|
||||
frame = gtk_frame_new(NULL);
|
||||
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
|
||||
|
||||
// load the first image
|
||||
app_state->image = gtk_image_new_from_file
|
||||
(next_image_filename(app_state->image_dir, *app_state->image_dir_iter).c_str());
|
||||
gtk_widget_set_size_request(app_state->image, 340, 310);
|
||||
gtk_container_add(GTK_CONTAINER(frame), app_state->image);
|
||||
|
||||
// rotate the images every 5 seconds
|
||||
app_state->image_rotation_timeout_id = g_timeout_add
|
||||
(ROTATE_IMAGE_TIMEOUT, rotate_image_cb, app_state);
|
||||
}
|
||||
|
||||
// set up progress bar, and update it roughly every 1/10 of a second
|
||||
app_state->progress_bar = gtk_progress_bar_new();
|
||||
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(app_state->progress_bar),
|
||||
LLTrans::getString("UpdaterProgressBarTextWithEllipses").c_str());
|
||||
gtk_box_pack_start(GTK_BOX(vbox),
|
||||
app_state->progress_bar, FALSE, TRUE, 0);
|
||||
app_state->progress_update_timeout_id = g_timeout_add
|
||||
(UPDATE_PROGRESS_TIMEOUT, progress_update_timeout, app_state);
|
||||
app_state->update_progress_text_timeout_id = g_timeout_add
|
||||
(UPDATE_PROGRESS_TEXT_TIMEOUT, update_progress_text_timeout, app_state);
|
||||
|
||||
gtk_widget_show_all(app_state->window);
|
||||
}
|
||||
|
||||
gboolean rotate_image_cb(gpointer data)
|
||||
{
|
||||
UpdaterAppState *app_state;
|
||||
std::string filename;
|
||||
|
||||
llassert(data != NULL);
|
||||
app_state = (UpdaterAppState *) data;
|
||||
|
||||
filename = next_image_filename(app_state->image_dir, *app_state->image_dir_iter);
|
||||
|
||||
gdk_threads_enter();
|
||||
gtk_image_set_from_file(GTK_IMAGE(app_state->image), filename.c_str());
|
||||
gdk_threads_leave();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
std::string next_image_filename(std::string& image_path, LLDirIterator& iter)
|
||||
{
|
||||
std::string image_filename;
|
||||
iter.next(image_filename);
|
||||
return gDirUtilp->add(image_path, image_filename);
|
||||
}
|
||||
|
||||
void on_window_closed(GtkWidget *sender, GdkEvent* event, gpointer data)
|
||||
{
|
||||
UpdaterAppState *app_state;
|
||||
|
||||
llassert(data != NULL);
|
||||
app_state = (UpdaterAppState *) data;
|
||||
|
||||
updater_app_quit(app_state);
|
||||
}
|
||||
|
||||
void updater_app_quit(UpdaterAppState *app_state)
|
||||
{
|
||||
if (app_state != NULL)
|
||||
{
|
||||
g_source_remove(app_state->progress_update_timeout_id);
|
||||
|
||||
if (!app_state->image_dir.empty())
|
||||
{
|
||||
g_source_remove(app_state->image_rotation_timeout_id);
|
||||
}
|
||||
}
|
||||
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
void display_error(GtkWidget *parent, std::string title, std::string message)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
"%s", message.c_str());
|
||||
gtk_window_set_title(GTK_WINDOW(dialog), title.c_str());
|
||||
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
|
||||
gpointer worker_thread_cb(gpointer data)
|
||||
{
|
||||
UpdaterAppState *app_state;
|
||||
CURL *curl;
|
||||
CURLcode result;
|
||||
FILE *package_file;
|
||||
GError *error = NULL;
|
||||
int fd;
|
||||
|
||||
//g_return_val_if_fail (data != NULL, NULL);
|
||||
app_state = (UpdaterAppState *) data;
|
||||
|
||||
try {
|
||||
|
||||
if(!app_state->url.empty())
|
||||
{
|
||||
char* tmp_local_filename = NULL;
|
||||
// create temporary file to store the package.
|
||||
fd = g_file_open_tmp
|
||||
("secondlife-update-XXXXXX", &tmp_local_filename, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
llerrs << "Unable to create temporary file: "
|
||||
<< error->message
|
||||
<< llendl;
|
||||
|
||||
g_error_free(error);
|
||||
throw 0;
|
||||
}
|
||||
|
||||
if(tmp_local_filename != NULL)
|
||||
{
|
||||
app_state->file = tmp_local_filename;
|
||||
g_free(tmp_local_filename);
|
||||
}
|
||||
|
||||
package_file = fdopen(fd, "wb");
|
||||
if (package_file == NULL)
|
||||
{
|
||||
llerrs << "Failed to create temporary file: "
|
||||
<< app_state->file.c_str()
|
||||
<< llendl;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
LLTrans::getString("UpdaterFailDownloadTitle"),
|
||||
LLTrans::getString("UpdaterFailUpdateDescriptive"));
|
||||
gdk_threads_leave();
|
||||
throw 0;
|
||||
}
|
||||
|
||||
// initialize curl and start downloading the package
|
||||
llinfos << "Downloading package: " << app_state->url << llendl;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if (curl == NULL)
|
||||
{
|
||||
llerrs << "Failed to initialize libcurl" << llendl;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
LLTrans::getString("UpdaterFailDownloadTitle"),
|
||||
LLTrans::getString("UpdaterFailUpdateDescriptive"));
|
||||
gdk_threads_leave();
|
||||
throw 0;
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, app_state->url.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, TRUE);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, TRUE);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, package_file);
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
|
||||
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION,
|
||||
&download_progress_cb);
|
||||
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, app_state);
|
||||
|
||||
result = curl_easy_perform(curl);
|
||||
fclose(package_file);
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
if (result)
|
||||
{
|
||||
llerrs << "Failed to download update: "
|
||||
<< app_state->url
|
||||
<< llendl;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
LLTrans::getString("UpdaterFailDownloadTitle"),
|
||||
LLTrans::getString("UpdaterFailUpdateDescriptive"));
|
||||
gdk_threads_leave();
|
||||
|
||||
throw 0;
|
||||
}
|
||||
}
|
||||
|
||||
// now pulse the progres bar back and forth while the package is
|
||||
// being unpacked
|
||||
gdk_threads_enter();
|
||||
std::string installing_msg = LLTrans::getString("UpdaterNowInstalling");
|
||||
gtk_progress_bar_set_text(
|
||||
GTK_PROGRESS_BAR(app_state->progress_bar),
|
||||
installing_msg.c_str());
|
||||
app_state->activity_mode = TRUE;
|
||||
gdk_threads_leave();
|
||||
|
||||
// *TODO: if the destination is not writable, terminate this
|
||||
// thread and show file chooser?
|
||||
if (!install_package(app_state->file.c_str(), app_state->dest_dir))
|
||||
{
|
||||
llwarns << "Failed to install package to destination: "
|
||||
<< app_state->dest_dir
|
||||
<< llendl;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
LLTrans::getString("UpdaterFailInstallTitle"),
|
||||
LLTrans::getString("UpdaterFailUpdateDescriptive"));
|
||||
//"Failed to update " + app_state->app_name,
|
||||
gdk_threads_leave();
|
||||
throw 0;
|
||||
}
|
||||
|
||||
// try to spawn the new viewer
|
||||
if (!spawn_viewer(app_state))
|
||||
{
|
||||
llwarns << "Viewer was not installed properly in : "
|
||||
<< app_state->dest_dir
|
||||
<< llendl;
|
||||
|
||||
gdk_threads_enter();
|
||||
display_error(app_state->window,
|
||||
LLTrans::getString("UpdaterFailStartTitle"),
|
||||
LLTrans::getString("UpdaterFailUpdateDescriptive"));
|
||||
gdk_threads_leave();
|
||||
throw 0;
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
app_state->failure = TRUE;
|
||||
}
|
||||
|
||||
gdk_threads_enter();
|
||||
updater_app_quit(app_state);
|
||||
gdk_threads_leave();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
gboolean less_anal_gspawnsync(gchar **argv,
|
||||
gchar **stderr_output,
|
||||
gint *child_exit_status,
|
||||
GError **spawn_error)
|
||||
{
|
||||
// store current SIGCHLD handler if there is one, replace with default
|
||||
// handler to make glib happy
|
||||
struct sigaction sigchld_backup;
|
||||
struct sigaction sigchld_appease_glib;
|
||||
sigchld_appease_glib.sa_handler = SIG_DFL;
|
||||
sigemptyset(&sigchld_appease_glib.sa_mask);
|
||||
sigchld_appease_glib.sa_flags = 0;
|
||||
sigaction(SIGCHLD, &sigchld_appease_glib, &sigchld_backup);
|
||||
|
||||
gboolean rtn = g_spawn_sync(NULL,
|
||||
argv,
|
||||
NULL,
|
||||
(GSpawnFlags) (G_SPAWN_STDOUT_TO_DEV_NULL),
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
stderr_output,
|
||||
child_exit_status,
|
||||
spawn_error);
|
||||
|
||||
// restore SIGCHLD handler
|
||||
sigaction(SIGCHLD, &sigchld_backup, NULL);
|
||||
|
||||
return rtn;
|
||||
}
|
||||
|
||||
|
||||
// perform a rename, or perform a (prompted) root rename if that fails
|
||||
int
|
||||
rename_with_sudo_fallback(const std::string& filename, const std::string& newname)
|
||||
{
|
||||
int rtncode = ::rename(filename.c_str(), newname.c_str());
|
||||
lldebugs << "rename result is: " << rtncode << " / " << errno << llendl;
|
||||
if (rtncode && (EACCES == errno || EPERM == errno || EXDEV == errno))
|
||||
{
|
||||
llinfos << "Permission problem in rename, or moving between different mount points. Retrying as a mv under a sudo." << llendl;
|
||||
// failed due to permissions, try again as a gksudo or kdesu mv wrapper hack
|
||||
char *sudo_cmd = NULL;
|
||||
sudo_cmd = g_find_program_in_path("gksudo");
|
||||
if (!sudo_cmd)
|
||||
{
|
||||
sudo_cmd = g_find_program_in_path("kdesu");
|
||||
}
|
||||
if (sudo_cmd)
|
||||
{
|
||||
char *mv_cmd = NULL;
|
||||
mv_cmd = g_find_program_in_path("mv");
|
||||
if (mv_cmd)
|
||||
{
|
||||
char *src_string_copy = g_strdup(filename.c_str());
|
||||
char *dst_string_copy = g_strdup(newname.c_str());
|
||||
char* argv[] =
|
||||
{
|
||||
sudo_cmd,
|
||||
mv_cmd,
|
||||
src_string_copy,
|
||||
dst_string_copy,
|
||||
NULL
|
||||
};
|
||||
|
||||
gchar *stderr_output = NULL;
|
||||
gint child_exit_status = 0;
|
||||
GError *spawn_error = NULL;
|
||||
if (!less_anal_gspawnsync(argv, &stderr_output,
|
||||
&child_exit_status, &spawn_error))
|
||||
{
|
||||
llwarns << "Failed to spawn child process: "
|
||||
<< spawn_error->message
|
||||
<< llendl;
|
||||
}
|
||||
else if (child_exit_status)
|
||||
{
|
||||
llwarns << "mv command failed: "
|
||||
<< (stderr_output ? stderr_output : "(no reason given)")
|
||||
<< llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
// everything looks good, clear the error code
|
||||
rtncode = 0;
|
||||
}
|
||||
|
||||
g_free(src_string_copy);
|
||||
g_free(dst_string_copy);
|
||||
if (spawn_error) g_error_free(spawn_error);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rtncode;
|
||||
}
|
||||
|
||||
gboolean install_package(std::string package_file, std::string destination)
|
||||
{
|
||||
char *tar_cmd = NULL;
|
||||
std::ostringstream command;
|
||||
|
||||
// Find the absolute path to the 'tar' command.
|
||||
tar_cmd = g_find_program_in_path("tar");
|
||||
if (!tar_cmd)
|
||||
{
|
||||
llerrs << "`tar' was not found in $PATH" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
llinfos << "Found tar command: " << tar_cmd << llendl;
|
||||
|
||||
// Unpack the tarball in a temporary place first, then move it to
|
||||
// its final destination
|
||||
std::string tmp_dest_dir = gDirUtilp->getTempFilename();
|
||||
if (LLFile::mkdir(tmp_dest_dir, 0744))
|
||||
{
|
||||
llerrs << "Failed to create directory: "
|
||||
<< destination
|
||||
<< llendl;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
char *package_file_string_copy = g_strdup(package_file.c_str());
|
||||
char *tmp_dest_dir_string_copy = g_strdup(tmp_dest_dir.c_str());
|
||||
gchar *argv[8] = {
|
||||
tar_cmd,
|
||||
const_cast<gchar*>("--strip"), const_cast<gchar*>("1"),
|
||||
const_cast<gchar*>("-xjf"),
|
||||
package_file_string_copy,
|
||||
const_cast<gchar*>("-C"), tmp_dest_dir_string_copy,
|
||||
NULL,
|
||||
};
|
||||
|
||||
llinfos << "Untarring package: " << package_file << llendl;
|
||||
|
||||
// store current SIGCHLD handler if there is one, replace with default
|
||||
// handler to make glib happy
|
||||
struct sigaction sigchld_backup;
|
||||
struct sigaction sigchld_appease_glib;
|
||||
sigchld_appease_glib.sa_handler = SIG_DFL;
|
||||
sigemptyset(&sigchld_appease_glib.sa_mask);
|
||||
sigchld_appease_glib.sa_flags = 0;
|
||||
sigaction(SIGCHLD, &sigchld_appease_glib, &sigchld_backup);
|
||||
|
||||
gchar *stderr_output = NULL;
|
||||
gint child_exit_status = 0;
|
||||
GError *untar_error = NULL;
|
||||
if (!less_anal_gspawnsync(argv, &stderr_output,
|
||||
&child_exit_status, &untar_error))
|
||||
{
|
||||
llwarns << "Failed to spawn child process: "
|
||||
<< untar_error->message
|
||||
<< llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (child_exit_status)
|
||||
{
|
||||
llwarns << "Untar command failed: "
|
||||
<< (stderr_output ? stderr_output : "(no reason given)")
|
||||
<< llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_free(tar_cmd);
|
||||
g_free(package_file_string_copy);
|
||||
g_free(tmp_dest_dir_string_copy);
|
||||
g_free(stderr_output);
|
||||
if (untar_error) g_error_free(untar_error);
|
||||
|
||||
// move the existing package out of the way if it exists
|
||||
if (gDirUtilp->fileExists(destination))
|
||||
{
|
||||
std::string backup_dir = destination + ".backup";
|
||||
int oldcounter = 1;
|
||||
while (gDirUtilp->fileExists(backup_dir))
|
||||
{
|
||||
// find a foo.backup.N folder name that isn't taken yet
|
||||
backup_dir = destination + ".backup." + llformat("%d", oldcounter);
|
||||
++oldcounter;
|
||||
}
|
||||
|
||||
if (rename_with_sudo_fallback(destination, backup_dir))
|
||||
{
|
||||
llwarns << "Failed to move directory: '"
|
||||
<< destination << "' -> '" << backup_dir
|
||||
<< llendl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// The package has been unpacked in a staging directory, now we just
|
||||
// need to move it to its destination.
|
||||
if (rename_with_sudo_fallback(tmp_dest_dir, destination))
|
||||
{
|
||||
llwarns << "Failed to move installation to the destination: "
|
||||
<< destination
|
||||
<< llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// \0/ Success!
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean progress_update_timeout(gpointer data)
|
||||
{
|
||||
UpdaterAppState *app_state;
|
||||
|
||||
llassert(data != NULL);
|
||||
|
||||
app_state = (UpdaterAppState *) data;
|
||||
|
||||
gdk_threads_enter();
|
||||
if (app_state->activity_mode)
|
||||
{
|
||||
gtk_progress_bar_pulse
|
||||
(GTK_PROGRESS_BAR(app_state->progress_bar));
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_progress_set_value(GTK_PROGRESS(app_state->progress_bar),
|
||||
app_state->progress_value);
|
||||
}
|
||||
gdk_threads_leave();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean update_progress_text_timeout(gpointer data)
|
||||
{
|
||||
UpdaterAppState *app_state;
|
||||
|
||||
llassert(data != NULL);
|
||||
app_state = (UpdaterAppState *) data;
|
||||
|
||||
if (app_state->activity_mode == TRUE)
|
||||
{
|
||||
// We no longer need this timeout, it will be removed.
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!app_state->progress_value)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
std::string progress_text = llformat((LLTrans::getString("UpdaterProgressBarText")+" (%.0f%%)").c_str(), app_state->progress_value);
|
||||
|
||||
gdk_threads_enter();
|
||||
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(app_state->progress_bar),
|
||||
progress_text.c_str());
|
||||
gdk_threads_leave();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int download_progress_cb(gpointer data,
|
||||
double t,
|
||||
double d,
|
||||
double utotal,
|
||||
double ulnow)
|
||||
{
|
||||
UpdaterAppState *app_state;
|
||||
|
||||
llassert(data != NULL);
|
||||
app_state = (UpdaterAppState *) data;
|
||||
|
||||
if (t <= 0.0)
|
||||
{
|
||||
app_state->progress_value = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
app_state->progress_value = d * 100.0 / t;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL spawn_viewer(UpdaterAppState *app_state)
|
||||
{
|
||||
llassert(app_state != NULL);
|
||||
|
||||
std::string cmd = app_state->dest_dir + "/secondlife";
|
||||
GError *error = NULL;
|
||||
|
||||
// We want to spawn the Viewer on the same display as the updater app
|
||||
gboolean success = gdk_spawn_command_line_on_screen
|
||||
(gtk_widget_get_screen(app_state->window), cmd.c_str(), &error);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
llwarns << "Failed to launch viewer: " << error->message
|
||||
<< llendl;
|
||||
}
|
||||
|
||||
if (error) g_error_free(error);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
void show_usage_and_exit()
|
||||
{
|
||||
std::cout << "Usage: linux-updater <--url URL | --file FILE> --name NAME --dest PATH --stringsdir PATH1,PATH2 --stringsfile FILE"
|
||||
<< "[--image-dir PATH]"
|
||||
<< std::endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if ((!strcmp(argv[i], "--url")) && (++i < argc))
|
||||
{
|
||||
app_state->url = argv[i];
|
||||
}
|
||||
else if ((!strcmp(argv[i], "--file")) && (++i < argc))
|
||||
{
|
||||
app_state->file = argv[i];
|
||||
}
|
||||
else if ((!strcmp(argv[i], "--name")) && (++i < argc))
|
||||
{
|
||||
app_state->app_name = argv[i];
|
||||
}
|
||||
else if ((!strcmp(argv[i], "--image-dir")) && (++i < argc))
|
||||
{
|
||||
app_state->image_dir = argv[i];
|
||||
app_state->image_dir_iter = new LLDirIterator(argv[i], "*.jpg");
|
||||
}
|
||||
else if ((!strcmp(argv[i], "--dest")) && (++i < argc))
|
||||
{
|
||||
app_state->dest_dir = argv[i];
|
||||
}
|
||||
else if ((!strcmp(argv[i], "--stringsdir")) && (++i < argc))
|
||||
{
|
||||
app_state->strings_dirs = argv[i];
|
||||
}
|
||||
else if ((!strcmp(argv[i], "--stringsfile")) && (++i < argc))
|
||||
{
|
||||
app_state->strings_file = argv[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
// show usage, an invalid option was given.
|
||||
show_usage_and_exit();
|
||||
}
|
||||
}
|
||||
|
||||
if (app_state->app_name.empty()
|
||||
|| (app_state->url.empty() && app_state->file.empty())
|
||||
|| app_state->dest_dir.empty())
|
||||
{
|
||||
show_usage_and_exit();
|
||||
}
|
||||
|
||||
app_state->progress_value = 0.0;
|
||||
app_state->activity_mode = FALSE;
|
||||
app_state->failure = FALSE;
|
||||
|
||||
translate_init(app_state->strings_dirs, app_state->strings_file);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
UpdaterAppState* app_state = new UpdaterAppState;
|
||||
GThread *worker_thread;
|
||||
|
||||
parse_args_and_init(argc, argv, app_state);
|
||||
|
||||
// Initialize logger, and rename old log file
|
||||
gDirUtilp->initAppDirs("SecondLife");
|
||||
LLError::initForApplication
|
||||
(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
|
||||
std::string old_log_file = gDirUtilp->getExpandedFilename
|
||||
(LL_PATH_LOGS, "updater.log.old");
|
||||
std::string log_file =
|
||||
gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log");
|
||||
LLFile::rename(log_file, old_log_file);
|
||||
LLError::logToFile(log_file);
|
||||
|
||||
// initialize gthreads and gtk+
|
||||
if (!g_thread_supported())
|
||||
{
|
||||
g_thread_init(NULL);
|
||||
gdk_threads_init();
|
||||
}
|
||||
|
||||
gtk_init(&argc, &argv);
|
||||
|
||||
// create UI
|
||||
updater_app_ui_init(app_state);
|
||||
|
||||
//llinfos << "SAMPLE TRANSLATION IS: " << LLTrans::getString("LoginInProgress") << llendl;
|
||||
|
||||
// create download thread
|
||||
worker_thread = g_thread_create
|
||||
(GThreadFunc(worker_thread_cb), app_state, FALSE, NULL);
|
||||
|
||||
gdk_threads_enter();
|
||||
gtk_main();
|
||||
gdk_threads_leave();
|
||||
|
||||
// Delete the file only if created from url download.
|
||||
if(!app_state->url.empty() && !app_state->file.empty())
|
||||
{
|
||||
if (gDirUtilp->fileExists(app_state->file))
|
||||
{
|
||||
LLFile::remove(app_state->file);
|
||||
}
|
||||
}
|
||||
|
||||
bool success = !app_state->failure;
|
||||
delete app_state->image_dir_iter;
|
||||
delete app_state;
|
||||
return success ? 0 : 1;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Dummy LLTrans implementation (IQA-490)
|
||||
*****************************************************************************/
|
||||
static LLTrans sStaticStrings;
|
||||
|
||||
// lookup
|
||||
std::string LLTrans::_getString(const std::string& key) const
|
||||
{
|
||||
MessageMap::const_iterator found = mMessages.find(key);
|
||||
if (found != mMessages.end())
|
||||
{
|
||||
return found->second;
|
||||
}
|
||||
LL_WARNS("linux_updater") << "No message for key '" << key
|
||||
<< "' -- add to LLTrans::LLTrans() in linux_updater.cpp"
|
||||
<< LL_ENDL;
|
||||
return key;
|
||||
}
|
||||
|
||||
// static lookup
|
||||
std::string LLTrans::getString(const std::string& key)
|
||||
{
|
||||
return sLLTransInstance._getString(key);
|
||||
}
|
||||
|
||||
// initialization
|
||||
LLTrans::LLTrans()
|
||||
{
|
||||
typedef std::pair<const char*, const char*> Pair;
|
||||
static const Pair data[] =
|
||||
{
|
||||
Pair("UpdaterFailDownloadTitle",
|
||||
"Failed to download update"),
|
||||
Pair("UpdaterFailInstallTitle",
|
||||
"Failed to install update"),
|
||||
Pair("UpdaterFailStartTitle",
|
||||
"Failed to start viewer"),
|
||||
Pair("UpdaterFailUpdateDescriptive",
|
||||
"An error occurred while updating Second Life. "
|
||||
"Please download the latest version from www.secondlife.com."),
|
||||
Pair("UpdaterNowInstalling",
|
||||
"Installing Second Life..."),
|
||||
Pair("UpdaterNowUpdating",
|
||||
"Now updating Second Life..."),
|
||||
Pair("UpdaterProgressBarText",
|
||||
"Downloading update"),
|
||||
Pair("UpdaterProgressBarTextWithEllipses",
|
||||
"Downloading update..."),
|
||||
Pair("UpdaterUpdatingDescriptive",
|
||||
"Your Second Life Viewer is being updated to the latest release. "
|
||||
"This may take some time, so please be patient."),
|
||||
Pair("UpdaterWindowTitle",
|
||||
"Second Life Update")
|
||||
};
|
||||
|
||||
BOOST_FOREACH(Pair pair, data)
|
||||
{
|
||||
mMessages[pair.first] = pair.second;
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef LL_LLBVHCONSTS_H
|
||||
#define LL_LLBVHCONSTS_H
|
||||
|
||||
const F32 MAX_ANIM_DURATION = 30.f;
|
||||
const F32 MAX_ANIM_DURATION = 60.f;
|
||||
|
||||
typedef enum e_constraint_type
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llmemtype.h"
|
||||
|
||||
#include "llmotioncontroller.h"
|
||||
#include "llkeyframemotion.h"
|
||||
#include "llmath.h"
|
||||
|
|
@ -44,6 +42,7 @@ const U32 MAX_MOTION_INSTANCES = 32;
|
|||
//-----------------------------------------------------------------------------
|
||||
// Constants and statics
|
||||
//-----------------------------------------------------------------------------
|
||||
F32 LLMotionController::sCurrentTimeFactor = 1.f;
|
||||
LLMotionRegistry LLMotionController::sRegistry;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -127,7 +126,7 @@ LLMotion *LLMotionRegistry::createMotion( const LLUUID &id )
|
|||
// Class Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
LLMotionController::LLMotionController()
|
||||
: mTimeFactor(1.f),
|
||||
: mTimeFactor(sCurrentTimeFactor),
|
||||
mCharacter(NULL),
|
||||
mAnimTime(0.f),
|
||||
mPrevTimerElapsed(0.f),
|
||||
|
|
@ -335,7 +334,6 @@ void LLMotionController::removeMotionInstance(LLMotion* motionp)
|
|||
//-----------------------------------------------------------------------------
|
||||
LLMotion* LLMotionController::createMotion( const LLUUID &id )
|
||||
{
|
||||
LLMemType mt(LLMemType::MTYPE_ANIMATION);
|
||||
// do we have an instance of this motion for this character?
|
||||
LLMotion *motion = findMotion(id);
|
||||
|
||||
|
|
|
|||
|
|
@ -168,6 +168,9 @@ public:
|
|||
|
||||
const LLFrameTimer& getFrameTimer() { return mTimer; }
|
||||
|
||||
static F32 getCurrentTimeFactor() { return sCurrentTimeFactor; };
|
||||
static void setCurrentTimeFactor(F32 factor) { sCurrentTimeFactor = factor; };
|
||||
|
||||
protected:
|
||||
// internal operations act on motion instances directly
|
||||
// as there can be duplicate motions per id during blending overlap
|
||||
|
|
@ -187,7 +190,8 @@ protected:
|
|||
void deactivateStoppedMotions();
|
||||
|
||||
protected:
|
||||
F32 mTimeFactor;
|
||||
F32 mTimeFactor; // 1.f for normal speed
|
||||
static F32 sCurrentTimeFactor; // Value to use for initialization
|
||||
static LLMotionRegistry sRegistry;
|
||||
LLPoseBlender mPoseBlender;
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ protected:
|
|||
// An interface class for a generalized parametric modification of the avatar mesh
|
||||
// Contains data that is specific to each Avatar
|
||||
//-----------------------------------------------------------------------------
|
||||
LL_ALIGN_PREFIX(16)
|
||||
class LLVisualParam
|
||||
{
|
||||
public:
|
||||
|
|
@ -160,6 +161,6 @@ protected:
|
|||
|
||||
S32 mID; // id for storing weight/morphtarget compares compactly
|
||||
LLVisualParamInfo *mInfo;
|
||||
};
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
#endif // LL_LLVisualParam_H
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ set(llcommon_SOURCE_FILES
|
|||
lleventfilter.cpp
|
||||
llevents.cpp
|
||||
lleventtimer.cpp
|
||||
llfasttimer_class.cpp
|
||||
llfasttimer.cpp
|
||||
llfile.cpp
|
||||
llfindlocale.cpp
|
||||
llfixedbuffer.cpp
|
||||
|
|
@ -71,7 +71,6 @@ set(llcommon_SOURCE_FILES
|
|||
llmd5.cpp
|
||||
llmemory.cpp
|
||||
llmemorystream.cpp
|
||||
llmemtype.cpp
|
||||
llmetrics.cpp
|
||||
llmetricperformancetester.cpp
|
||||
llmortician.cpp
|
||||
|
|
@ -168,7 +167,6 @@ set(llcommon_HEADER_FILES
|
|||
lleventemitter.h
|
||||
llextendedstatus.h
|
||||
llfasttimer.h
|
||||
llfasttimer_class.h
|
||||
llfile.h
|
||||
llfindlocale.h
|
||||
llfixedbuffer.h
|
||||
|
|
@ -197,7 +195,6 @@ set(llcommon_HEADER_FILES
|
|||
llmd5.h
|
||||
llmemory.h
|
||||
llmemorystream.h
|
||||
llmemtype.h
|
||||
llmetrics.h
|
||||
llmetricperformancetester.h
|
||||
llmortician.h
|
||||
|
|
|
|||
|
|
@ -35,28 +35,6 @@
|
|||
DECLARE_bool(heap_profile_use_stack_trace);
|
||||
//DECLARE_double(tcmalloc_release_rate);
|
||||
|
||||
// static
|
||||
void LLAllocator::pushMemType(S32 type)
|
||||
{
|
||||
if(isProfiling())
|
||||
{
|
||||
PushMemType(type);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
S32 LLAllocator::popMemType()
|
||||
{
|
||||
if (isProfiling())
|
||||
{
|
||||
return PopMemType();
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void LLAllocator::setProfilingEnabled(bool should_enable)
|
||||
{
|
||||
// NULL disables dumping to disk
|
||||
|
|
@ -94,17 +72,6 @@ std::string LLAllocator::getRawProfile()
|
|||
// stub implementations for when tcmalloc is disabled
|
||||
//
|
||||
|
||||
// static
|
||||
void LLAllocator::pushMemType(S32 type)
|
||||
{
|
||||
}
|
||||
|
||||
// static
|
||||
S32 LLAllocator::popMemType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void LLAllocator::setProfilingEnabled(bool should_enable)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,16 +29,10 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "llmemtype.h"
|
||||
#include "llallocator_heap_profile.h"
|
||||
|
||||
class LL_COMMON_API LLAllocator {
|
||||
friend class LLMemoryView;
|
||||
friend class LLMemType;
|
||||
|
||||
private:
|
||||
static void pushMemType(S32 type);
|
||||
static S32 popMemType();
|
||||
|
||||
public:
|
||||
void setProfilingEnabled(bool should_enable);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file llfasttimer_class.cpp
|
||||
* @file llfasttimer.cpp
|
||||
* @brief Implementation of the fast timer.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
|
|
@ -64,19 +64,12 @@ BOOL LLFastTimer::sMetricLog = FALSE;
|
|||
LLMutex* LLFastTimer::sLogLock = NULL;
|
||||
std::queue<LLSD> LLFastTimer::sLogQueue;
|
||||
|
||||
#define USE_RDTSC 0
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
U64 LLFastTimer::sClockResolution = 1000000000; // Nanosecond resolution
|
||||
#else
|
||||
U64 LLFastTimer::sClockResolution = 1000000; // Microsecond resolution
|
||||
#endif
|
||||
|
||||
std::vector<LLFastTimer::FrameState>* LLFastTimer::sTimerInfos = NULL;
|
||||
U64 LLFastTimer::sTimerCycles = 0;
|
||||
U32 LLFastTimer::sTimerCalls = 0;
|
||||
|
||||
|
||||
// FIXME: move these declarations to the relevant modules
|
||||
|
||||
// helper functions
|
||||
|
|
@ -109,52 +102,35 @@ static timer_tree_dfs_iterator_t end_timer_tree()
|
|||
return timer_tree_dfs_iterator_t();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// factory class that creates NamedTimers via static DeclareTimer objects
|
||||
class NamedTimerFactory : public LLSingleton<NamedTimerFactory>
|
||||
{
|
||||
public:
|
||||
NamedTimerFactory()
|
||||
: mActiveTimerRoot(NULL),
|
||||
mTimerRoot(NULL),
|
||||
mAppTimer(NULL),
|
||||
mRootFrameState(NULL)
|
||||
: mTimerRoot(NULL)
|
||||
{}
|
||||
|
||||
/*virtual */ void initSingleton()
|
||||
{
|
||||
mTimerRoot = new LLFastTimer::NamedTimer("root");
|
||||
|
||||
mActiveTimerRoot = new LLFastTimer::NamedTimer("Frame");
|
||||
mActiveTimerRoot->setCollapsed(false);
|
||||
|
||||
mRootFrameState = new LLFastTimer::FrameState(mActiveTimerRoot);
|
||||
mRootFrameState->mParent = &mTimerRoot->getFrameState();
|
||||
mActiveTimerRoot->setParent(mTimerRoot);
|
||||
|
||||
mAppTimer = new LLFastTimer(mRootFrameState);
|
||||
mRootFrameState.setNamedTimer(mTimerRoot);
|
||||
mTimerRoot->setFrameState(&mRootFrameState);
|
||||
mTimerRoot->mParent = mTimerRoot;
|
||||
mTimerRoot->setCollapsed(false);
|
||||
mRootFrameState.mParent = &mRootFrameState;
|
||||
}
|
||||
|
||||
~NamedTimerFactory()
|
||||
{
|
||||
std::for_each(mTimers.begin(), mTimers.end(), DeletePairedPointer());
|
||||
|
||||
delete mAppTimer;
|
||||
delete mActiveTimerRoot;
|
||||
delete mTimerRoot;
|
||||
delete mRootFrameState;
|
||||
}
|
||||
|
||||
LLFastTimer::NamedTimer& createNamedTimer(const std::string& name)
|
||||
LLFastTimer::NamedTimer& createNamedTimer(const std::string& name, LLFastTimer::FrameState* state)
|
||||
{
|
||||
timer_map_t::iterator found_it = mTimers.find(name);
|
||||
if (found_it != mTimers.end())
|
||||
{
|
||||
return *found_it->second;
|
||||
}
|
||||
|
||||
LLFastTimer::NamedTimer* timer = new LLFastTimer::NamedTimer(name);
|
||||
timer->setFrameState(state);
|
||||
timer->setParent(mTimerRoot);
|
||||
mTimers.insert(std::make_pair(name, timer));
|
||||
|
||||
|
|
@ -171,12 +147,9 @@ public:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
LLFastTimer::NamedTimer* getActiveRootTimer() { return mActiveTimerRoot; }
|
||||
LLFastTimer::NamedTimer* getRootTimer() { return mTimerRoot; }
|
||||
const LLFastTimer* getAppTimer() { return mAppTimer; }
|
||||
LLFastTimer::FrameState& getRootFrameState() { return *mRootFrameState; }
|
||||
|
||||
typedef std::map<std::string, LLFastTimer::NamedTimer*> timer_map_t;
|
||||
typedef std::multimap<std::string, LLFastTimer::NamedTimer*> timer_map_t;
|
||||
timer_map_t::iterator beginTimers() { return mTimers.begin(); }
|
||||
timer_map_t::iterator endTimers() { return mTimers.end(); }
|
||||
S32 timerCount() { return mTimers.size(); }
|
||||
|
|
@ -184,55 +157,19 @@ public:
|
|||
private:
|
||||
timer_map_t mTimers;
|
||||
|
||||
LLFastTimer::NamedTimer* mActiveTimerRoot;
|
||||
LLFastTimer::NamedTimer* mTimerRoot;
|
||||
LLFastTimer* mAppTimer;
|
||||
LLFastTimer::FrameState* mRootFrameState;
|
||||
LLFastTimer::FrameState mRootFrameState;
|
||||
};
|
||||
|
||||
void update_cached_pointers_if_changed()
|
||||
{
|
||||
// detect when elements have moved and update cached pointers
|
||||
static LLFastTimer::FrameState* sFirstTimerAddress = NULL;
|
||||
if (&*(LLFastTimer::getFrameStateList().begin()) != sFirstTimerAddress)
|
||||
{
|
||||
LLFastTimer::DeclareTimer::updateCachedPointers();
|
||||
}
|
||||
sFirstTimerAddress = &*(LLFastTimer::getFrameStateList().begin());
|
||||
}
|
||||
|
||||
LLFastTimer::DeclareTimer::DeclareTimer(const std::string& name, bool open )
|
||||
: mTimer(NamedTimerFactory::instance().createNamedTimer(name))
|
||||
: mTimer(NamedTimerFactory::instance().createNamedTimer(name, &mFrameState))
|
||||
{
|
||||
mTimer.setCollapsed(!open);
|
||||
mFrameState = &mTimer.getFrameState();
|
||||
update_cached_pointers_if_changed();
|
||||
}
|
||||
|
||||
LLFastTimer::DeclareTimer::DeclareTimer(const std::string& name)
|
||||
: mTimer(NamedTimerFactory::instance().createNamedTimer(name))
|
||||
: mTimer(NamedTimerFactory::instance().createNamedTimer(name, &mFrameState))
|
||||
{
|
||||
mFrameState = &mTimer.getFrameState();
|
||||
update_cached_pointers_if_changed();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFastTimer::DeclareTimer::updateCachedPointers()
|
||||
{
|
||||
// propagate frame state pointers to timer declarations
|
||||
for (instance_iter it = beginInstances(); it != endInstances(); ++it)
|
||||
{
|
||||
// update cached pointer
|
||||
it->mFrameState = &it->mTimer.getFrameState();
|
||||
}
|
||||
|
||||
// also update frame states of timers on stack
|
||||
LLFastTimer* cur_timerp = LLFastTimer::sCurTimerData.mCurTimer;
|
||||
while(cur_timerp->mLastTimerData.mCurTimer != cur_timerp)
|
||||
{
|
||||
cur_timerp->mFrameState = &cur_timerp->mFrameState->mTimer->getFrameState();
|
||||
cur_timerp = cur_timerp->mLastTimerData.mCurTimer;
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
|
|
@ -244,7 +181,7 @@ U64 LLFastTimer::countsPerSecond() // counts per second for the *32-bit* timer
|
|||
#else // windows or x86-mac or x86-linux or x86-solaris
|
||||
U64 LLFastTimer::countsPerSecond() // counts per second for the *32-bit* timer
|
||||
{
|
||||
#if USE_RDTSC || !LL_WINDOWS
|
||||
#if LL_FASTTIMER_USE_RDTSC || !LL_WINDOWS
|
||||
//getCPUFrequency returns MHz and sCPUClockFrequency wants to be in Hz
|
||||
static U64 sCPUClockFrequency = U64(LLProcessorInfo().getCPUFrequency()*1000000.0);
|
||||
|
||||
|
|
@ -265,14 +202,13 @@ U64 LLFastTimer::countsPerSecond() // counts per second for the *32-bit* timer
|
|||
}
|
||||
#endif
|
||||
|
||||
LLFastTimer::FrameState::FrameState(LLFastTimer::NamedTimer* timerp)
|
||||
LLFastTimer::FrameState::FrameState()
|
||||
: mActiveCount(0),
|
||||
mCalls(0),
|
||||
mSelfTimeCounter(0),
|
||||
mParent(NULL),
|
||||
mLastCaller(NULL),
|
||||
mMoveUpTree(false),
|
||||
mTimer(timerp)
|
||||
mMoveUpTree(false)
|
||||
{}
|
||||
|
||||
|
||||
|
|
@ -283,12 +219,9 @@ LLFastTimer::NamedTimer::NamedTimer(const std::string& name)
|
|||
mTotalTimeCounter(0),
|
||||
mCountAverage(0),
|
||||
mCallAverage(0),
|
||||
mNeedsSorting(false)
|
||||
mNeedsSorting(false),
|
||||
mFrameState(NULL)
|
||||
{
|
||||
info_list_t& frame_state_list = getFrameStateList();
|
||||
mFrameStateIndex = frame_state_list.size();
|
||||
getFrameStateList().push_back(FrameState(this));
|
||||
|
||||
mCountHistory = new U32[HISTORY_NUM];
|
||||
memset(mCountHistory, 0, sizeof(U32) * HISTORY_NUM);
|
||||
mCallHistory = new U32[HISTORY_NUM];
|
||||
|
|
@ -355,6 +288,7 @@ S32 LLFastTimer::NamedTimer::getDepth()
|
|||
while(timerp)
|
||||
{
|
||||
depth++;
|
||||
if (timerp->getParent() == timerp) break;
|
||||
timerp = timerp->mParent;
|
||||
}
|
||||
return depth;
|
||||
|
|
@ -369,15 +303,6 @@ void LLFastTimer::NamedTimer::processTimes()
|
|||
accumulateTimings();
|
||||
}
|
||||
|
||||
// sort timer info structs by depth first traversal order
|
||||
struct SortTimersDFS
|
||||
{
|
||||
bool operator()(const LLFastTimer::FrameState& i1, const LLFastTimer::FrameState& i2)
|
||||
{
|
||||
return i1.mTimer->getFrameStateIndex() < i2.mTimer->getFrameStateIndex();
|
||||
}
|
||||
};
|
||||
|
||||
// sort child timers by name
|
||||
struct SortTimerByName
|
||||
{
|
||||
|
|
@ -425,8 +350,8 @@ void LLFastTimer::NamedTimer::buildHierarchy()
|
|||
{
|
||||
// since ancestors have already been visited, reparenting won't affect tree traversal
|
||||
//step up tree, bringing our descendants with us
|
||||
//llinfos << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() <<
|
||||
// " to child of " << timerp->getParent()->getParent()->getName() << llendl;
|
||||
LL_DEBUGS("FastTimers") << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() <<
|
||||
" to child of " << timerp->getParent()->getParent()->getName() << LL_ENDL;
|
||||
timerp->setParent(timerp->getParent()->getParent());
|
||||
timerp->getFrameState().mMoveUpTree = false;
|
||||
|
||||
|
|
@ -458,7 +383,7 @@ void LLFastTimer::NamedTimer::accumulateTimings()
|
|||
LLFastTimer* cur_timer = sCurTimerData.mCurTimer;
|
||||
// root defined by parent pointing to self
|
||||
CurTimerData* cur_data = &sCurTimerData;
|
||||
while(cur_timer->mLastTimerData.mCurTimer != cur_timer)
|
||||
while(cur_timer && cur_timer->mLastTimerData.mCurTimer != cur_timer)
|
||||
{
|
||||
U32 cumulative_time_delta = cur_time - cur_timer->mStartTime;
|
||||
U32 self_time_delta = cumulative_time_delta - cur_data->mChildTime;
|
||||
|
|
@ -473,7 +398,7 @@ void LLFastTimer::NamedTimer::accumulateTimings()
|
|||
}
|
||||
|
||||
// traverse tree in DFS post order, or bottom up
|
||||
for(timer_tree_bottom_up_iterator_t it = begin_timer_tree_bottom_up(*NamedTimerFactory::instance().getActiveRootTimer());
|
||||
for(timer_tree_bottom_up_iterator_t it = begin_timer_tree_bottom_up(*NamedTimerFactory::instance().getRootTimer());
|
||||
it != end_timer_tree_bottom_up();
|
||||
++it)
|
||||
{
|
||||
|
|
@ -507,12 +432,12 @@ void LLFastTimer::NamedTimer::resetFrame()
|
|||
static S32 call_count = 0;
|
||||
if (call_count % 100 == 0)
|
||||
{
|
||||
llinfos << "countsPerSecond (32 bit): " << countsPerSecond() << llendl;
|
||||
llinfos << "get_clock_count (64 bit): " << get_clock_count() << llendl;
|
||||
llinfos << "LLProcessorInfo().getCPUFrequency() " << LLProcessorInfo().getCPUFrequency() << llendl;
|
||||
llinfos << "getCPUClockCount32() " << getCPUClockCount32() << llendl;
|
||||
llinfos << "getCPUClockCount64() " << getCPUClockCount64() << llendl;
|
||||
llinfos << "elapsed sec " << ((F64)getCPUClockCount64())/((F64)LLProcessorInfo().getCPUFrequency()*1000000.0) << llendl;
|
||||
LL_DEBUGS("FastTimers") << "countsPerSecond (32 bit): " << countsPerSecond() << LL_ENDL;
|
||||
LL_DEBUGS("FastTimers") << "get_clock_count (64 bit): " << get_clock_count() << llendl;
|
||||
LL_DEBUGS("FastTimers") << "LLProcessorInfo().getCPUFrequency() " << LLProcessorInfo().getCPUFrequency() << LL_ENDL;
|
||||
LL_DEBUGS("FastTimers") << "getCPUClockCount32() " << getCPUClockCount32() << LL_ENDL;
|
||||
LL_DEBUGS("FastTimers") << "getCPUClockCount64() " << getCPUClockCount64() << LL_ENDL;
|
||||
LL_DEBUGS("FastTimers") << "elapsed sec " << ((F64)getCPUClockCount64())/((F64)LLProcessorInfo().getCPUFrequency()*1000000.0) << LL_ENDL;
|
||||
}
|
||||
call_count++;
|
||||
|
||||
|
|
@ -544,48 +469,22 @@ void LLFastTimer::NamedTimer::resetFrame()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// tag timers by position in depth first traversal of tree
|
||||
S32 index = 0;
|
||||
for(timer_tree_dfs_iterator_t it = begin_timer_tree(*NamedTimerFactory::instance().getRootTimer());
|
||||
it != end_timer_tree();
|
||||
++it)
|
||||
{
|
||||
NamedTimer* timerp = (*it);
|
||||
|
||||
timerp->mFrameStateIndex = index;
|
||||
index++;
|
||||
|
||||
llassert_always(timerp->mFrameStateIndex < (S32)getFrameStateList().size());
|
||||
}
|
||||
|
||||
// sort timers by DFS traversal order to improve cache coherency
|
||||
std::sort(getFrameStateList().begin(), getFrameStateList().end(), SortTimersDFS());
|
||||
|
||||
// update pointers into framestatelist now that we've sorted it
|
||||
DeclareTimer::updateCachedPointers();
|
||||
|
||||
// reset for next frame
|
||||
for (instance_iter it = beginInstances(); it != endInstances(); ++it)
|
||||
{
|
||||
for (instance_iter it = beginInstances(); it != endInstances(); ++it)
|
||||
{
|
||||
NamedTimer& timer = *it;
|
||||
NamedTimer& timer = *it;
|
||||
|
||||
FrameState& info = timer.getFrameState();
|
||||
info.mSelfTimeCounter = 0;
|
||||
info.mCalls = 0;
|
||||
info.mLastCaller = NULL;
|
||||
info.mMoveUpTree = false;
|
||||
// update parent pointer in timer state struct
|
||||
if (timer.mParent)
|
||||
{
|
||||
info.mParent = &timer.mParent->getFrameState();
|
||||
}
|
||||
FrameState& info = timer.getFrameState();
|
||||
info.mSelfTimeCounter = 0;
|
||||
info.mCalls = 0;
|
||||
info.mLastCaller = NULL;
|
||||
info.mMoveUpTree = false;
|
||||
// update parent pointer in timer state struct
|
||||
if (timer.mParent)
|
||||
{
|
||||
info.mParent = &timer.mParent->getFrameState();
|
||||
}
|
||||
}
|
||||
|
||||
//sTimerCycles = 0;
|
||||
//sTimerCalls = 0;
|
||||
}
|
||||
|
||||
//static
|
||||
|
|
@ -600,7 +499,7 @@ void LLFastTimer::NamedTimer::reset()
|
|||
// root defined by parent pointing to self
|
||||
CurTimerData* cur_data = &sCurTimerData;
|
||||
LLFastTimer* cur_timer = cur_data->mCurTimer;
|
||||
while(cur_timer->mLastTimerData.mCurTimer != cur_timer)
|
||||
while(cur_timer && cur_timer->mLastTimerData.mCurTimer != cur_timer)
|
||||
{
|
||||
cur_timer->mStartTime = cur_time;
|
||||
cur_data->mChildTime = 0;
|
||||
|
|
@ -630,17 +529,6 @@ void LLFastTimer::NamedTimer::reset()
|
|||
sCurFrameIndex = 0;
|
||||
}
|
||||
|
||||
//static
|
||||
LLFastTimer::info_list_t& LLFastTimer::getFrameStateList()
|
||||
{
|
||||
if (!sTimerInfos)
|
||||
{
|
||||
sTimerInfos = new info_list_t();
|
||||
}
|
||||
return *sTimerInfos;
|
||||
}
|
||||
|
||||
|
||||
U32 LLFastTimer::NamedTimer::getHistoricalCount(S32 history_index) const
|
||||
{
|
||||
S32 history_idx = (getLastFrameIndex() + history_index) % LLFastTimer::NamedTimer::HISTORY_NUM;
|
||||
|
|
@ -655,18 +543,7 @@ U32 LLFastTimer::NamedTimer::getHistoricalCalls(S32 history_index ) const
|
|||
|
||||
LLFastTimer::FrameState& LLFastTimer::NamedTimer::getFrameState() const
|
||||
{
|
||||
llassert_always(mFrameStateIndex >= 0);
|
||||
if (this == NamedTimerFactory::instance().getActiveRootTimer())
|
||||
{
|
||||
return NamedTimerFactory::instance().getRootFrameState();
|
||||
}
|
||||
return getFrameStateList()[mFrameStateIndex];
|
||||
}
|
||||
|
||||
// static
|
||||
LLFastTimer::NamedTimer& LLFastTimer::NamedTimer::getRootNamedTimer()
|
||||
{
|
||||
return *NamedTimerFactory::instance().getActiveRootTimer();
|
||||
return *mFrameState;
|
||||
}
|
||||
|
||||
std::vector<LLFastTimer::NamedTimer*>::const_iterator LLFastTimer::NamedTimer::beginChildren()
|
||||
|
|
@ -777,145 +654,3 @@ LLFastTimer::LLFastTimer(LLFastTimer::FrameState* state)
|
|||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Important note: These implementations must be FAST!
|
||||
//
|
||||
|
||||
|
||||
#if LL_WINDOWS
|
||||
//
|
||||
// Windows implementation of CPU clock
|
||||
//
|
||||
|
||||
//
|
||||
// NOTE: put back in when we aren't using platform sdk anymore
|
||||
//
|
||||
// because MS has different signatures for these functions in winnt.h
|
||||
// need to rename them to avoid conflicts
|
||||
//#define _interlockedbittestandset _renamed_interlockedbittestandset
|
||||
//#define _interlockedbittestandreset _renamed_interlockedbittestandreset
|
||||
//#include <intrin.h>
|
||||
//#undef _interlockedbittestandset
|
||||
//#undef _interlockedbittestandreset
|
||||
|
||||
//inline U32 LLFastTimer::getCPUClockCount32()
|
||||
//{
|
||||
// U64 time_stamp = __rdtsc();
|
||||
// return (U32)(time_stamp >> 8);
|
||||
//}
|
||||
//
|
||||
//// return full timer value, *not* shifted by 8 bits
|
||||
//inline U64 LLFastTimer::getCPUClockCount64()
|
||||
//{
|
||||
// return __rdtsc();
|
||||
//}
|
||||
|
||||
// shift off lower 8 bits for lower resolution but longer term timing
|
||||
// on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing
|
||||
#if USE_RDTSC
|
||||
U32 LLFastTimer::getCPUClockCount32()
|
||||
{
|
||||
U32 ret_val;
|
||||
__asm
|
||||
{
|
||||
_emit 0x0f
|
||||
_emit 0x31
|
||||
shr eax,8
|
||||
shl edx,24
|
||||
or eax, edx
|
||||
mov dword ptr [ret_val], eax
|
||||
}
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
// return full timer value, *not* shifted by 8 bits
|
||||
U64 LLFastTimer::getCPUClockCount64()
|
||||
{
|
||||
U64 ret_val;
|
||||
__asm
|
||||
{
|
||||
_emit 0x0f
|
||||
_emit 0x31
|
||||
mov eax,eax
|
||||
mov edx,edx
|
||||
mov dword ptr [ret_val+4], edx
|
||||
mov dword ptr [ret_val], eax
|
||||
}
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
std::string LLFastTimer::sClockType = "rdtsc";
|
||||
|
||||
#else
|
||||
//LL_COMMON_API U64 get_clock_count(); // in lltimer.cpp
|
||||
// These use QueryPerformanceCounter, which is arguably fine and also works on AMD architectures.
|
||||
U32 LLFastTimer::getCPUClockCount32()
|
||||
{
|
||||
return (U32)(get_clock_count()>>8);
|
||||
}
|
||||
|
||||
U64 LLFastTimer::getCPUClockCount64()
|
||||
{
|
||||
return get_clock_count();
|
||||
}
|
||||
|
||||
std::string LLFastTimer::sClockType = "QueryPerformanceCounter";
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if (LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__))
|
||||
//
|
||||
// Linux and Solaris implementation of CPU clock - non-x86.
|
||||
// This is accurate but SLOW! Only use out of desperation.
|
||||
//
|
||||
// Try to use the MONOTONIC clock if available, this is a constant time counter
|
||||
// with nanosecond resolution (but not necessarily accuracy) and attempts are
|
||||
// made to synchronize this value between cores at kernel start. It should not
|
||||
// be affected by CPU frequency. If not available use the REALTIME clock, but
|
||||
// this may be affected by NTP adjustments or other user activity affecting
|
||||
// the system time.
|
||||
U64 LLFastTimer::getCPUClockCount64()
|
||||
{
|
||||
struct timespec tp;
|
||||
|
||||
#ifdef CLOCK_MONOTONIC // MONOTONIC supported at build-time?
|
||||
if (-1 == clock_gettime(CLOCK_MONOTONIC,&tp)) // if MONOTONIC isn't supported at runtime then ouch, try REALTIME
|
||||
#endif
|
||||
clock_gettime(CLOCK_REALTIME,&tp);
|
||||
|
||||
return (tp.tv_sec*LLFastTimer::sClockResolution)+tp.tv_nsec;
|
||||
}
|
||||
|
||||
U32 LLFastTimer::getCPUClockCount32()
|
||||
{
|
||||
return (U32)(LLFastTimer::getCPUClockCount64() >> 8);
|
||||
}
|
||||
|
||||
std::string LLFastTimer::sClockType = "clock_gettime";
|
||||
|
||||
#endif // (LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__))
|
||||
|
||||
|
||||
#if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__))
|
||||
//
|
||||
// Mac+Linux+Solaris FAST x86 implementation of CPU clock
|
||||
U32 LLFastTimer::getCPUClockCount32()
|
||||
{
|
||||
U64 x;
|
||||
__asm__ volatile (".byte 0x0f, 0x31": "=A"(x));
|
||||
return (U32)(x >> 8);
|
||||
}
|
||||
|
||||
U64 LLFastTimer::getCPUClockCount64()
|
||||
{
|
||||
U64 x;
|
||||
__asm__ volatile (".byte 0x0f, 0x31": "=A"(x));
|
||||
return x;
|
||||
}
|
||||
|
||||
std::string LLFastTimer::sClockType = "rdtsc";
|
||||
#endif
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* @file llfasttimer.h
|
||||
* @brief Inline implementations of fast timers.
|
||||
* @brief Declaration of a fast timer.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
|
|
@ -27,9 +27,363 @@
|
|||
#ifndef LL_FASTTIMER_H
|
||||
#define LL_FASTTIMER_H
|
||||
|
||||
// Implementation of getCPUClockCount32() and getCPUClockCount64 are now in llfastertimer_class.cpp.
|
||||
#include "llinstancetracker.h"
|
||||
|
||||
// pull in the actual class definition
|
||||
#include "llfasttimer_class.h"
|
||||
#define FAST_TIMER_ON 1
|
||||
#define DEBUG_FAST_TIMER_THREADS 1
|
||||
|
||||
class LLMutex;
|
||||
|
||||
#include <queue>
|
||||
#include "llsd.h"
|
||||
|
||||
#define LL_FASTTIMER_USE_RDTSC 1
|
||||
|
||||
|
||||
LL_COMMON_API void assert_main_thread();
|
||||
|
||||
class LL_COMMON_API LLFastTimer
|
||||
{
|
||||
public:
|
||||
class NamedTimer;
|
||||
|
||||
struct LL_COMMON_API FrameState
|
||||
{
|
||||
FrameState();
|
||||
void setNamedTimer(NamedTimer* timerp) { mTimer = timerp; }
|
||||
|
||||
U32 mSelfTimeCounter;
|
||||
U32 mCalls;
|
||||
FrameState* mParent; // info for caller timer
|
||||
FrameState* mLastCaller; // used to bootstrap tree construction
|
||||
NamedTimer* mTimer;
|
||||
U16 mActiveCount; // number of timers with this ID active on stack
|
||||
bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame
|
||||
};
|
||||
|
||||
// stores a "named" timer instance to be reused via multiple LLFastTimer stack instances
|
||||
class LL_COMMON_API NamedTimer
|
||||
: public LLInstanceTracker<NamedTimer>
|
||||
{
|
||||
friend class DeclareTimer;
|
||||
public:
|
||||
~NamedTimer();
|
||||
|
||||
enum { HISTORY_NUM = 300 };
|
||||
|
||||
const std::string& getName() const { return mName; }
|
||||
NamedTimer* getParent() const { return mParent; }
|
||||
void setParent(NamedTimer* parent);
|
||||
S32 getDepth();
|
||||
std::string getToolTip(S32 history_index = -1);
|
||||
|
||||
typedef std::vector<NamedTimer*>::const_iterator child_const_iter;
|
||||
child_const_iter beginChildren();
|
||||
child_const_iter endChildren();
|
||||
std::vector<NamedTimer*>& getChildren();
|
||||
|
||||
void setCollapsed(bool collapsed) { mCollapsed = collapsed; }
|
||||
bool getCollapsed() const { return mCollapsed; }
|
||||
|
||||
U32 getCountAverage() const { return mCountAverage; }
|
||||
U32 getCallAverage() const { return mCallAverage; }
|
||||
|
||||
U32 getHistoricalCount(S32 history_index = 0) const;
|
||||
U32 getHistoricalCalls(S32 history_index = 0) const;
|
||||
|
||||
void setFrameState(FrameState* state) { mFrameState = state; state->setNamedTimer(this); }
|
||||
FrameState& getFrameState() const;
|
||||
|
||||
private:
|
||||
friend class LLFastTimer;
|
||||
friend class NamedTimerFactory;
|
||||
|
||||
//
|
||||
// methods
|
||||
//
|
||||
NamedTimer(const std::string& name);
|
||||
// recursive call to gather total time from children
|
||||
static void accumulateTimings();
|
||||
|
||||
// updates cumulative times and hierarchy,
|
||||
// can be called multiple times in a frame, at any point
|
||||
static void processTimes();
|
||||
|
||||
static void buildHierarchy();
|
||||
static void resetFrame();
|
||||
static void reset();
|
||||
|
||||
//
|
||||
// members
|
||||
//
|
||||
FrameState* mFrameState;
|
||||
|
||||
std::string mName;
|
||||
|
||||
U32 mTotalTimeCounter;
|
||||
|
||||
U32 mCountAverage;
|
||||
U32 mCallAverage;
|
||||
|
||||
U32* mCountHistory;
|
||||
U32* mCallHistory;
|
||||
|
||||
// tree structure
|
||||
NamedTimer* mParent; // NamedTimer of caller(parent)
|
||||
std::vector<NamedTimer*> mChildren;
|
||||
bool mCollapsed; // don't show children
|
||||
bool mNeedsSorting; // sort children whenever child added
|
||||
};
|
||||
|
||||
// used to statically declare a new named timer
|
||||
class LL_COMMON_API DeclareTimer
|
||||
: public LLInstanceTracker<DeclareTimer>
|
||||
{
|
||||
friend class LLFastTimer;
|
||||
public:
|
||||
DeclareTimer(const std::string& name, bool open);
|
||||
DeclareTimer(const std::string& name);
|
||||
|
||||
NamedTimer& getNamedTimer() { return mTimer; }
|
||||
|
||||
private:
|
||||
FrameState mFrameState;
|
||||
NamedTimer& mTimer;
|
||||
};
|
||||
|
||||
public:
|
||||
LLFastTimer(LLFastTimer::FrameState* state);
|
||||
|
||||
LL_FORCE_INLINE LLFastTimer(LLFastTimer::DeclareTimer& timer)
|
||||
: mFrameState(&timer.mFrameState)
|
||||
{
|
||||
#if FAST_TIMER_ON
|
||||
LLFastTimer::FrameState* frame_state = mFrameState;
|
||||
mStartTime = getCPUClockCount32();
|
||||
|
||||
frame_state->mActiveCount++;
|
||||
frame_state->mCalls++;
|
||||
// keep current parent as long as it is active when we are
|
||||
frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0);
|
||||
|
||||
LLFastTimer::CurTimerData* cur_timer_data = &LLFastTimer::sCurTimerData;
|
||||
mLastTimerData = *cur_timer_data;
|
||||
cur_timer_data->mCurTimer = this;
|
||||
cur_timer_data->mFrameState = frame_state;
|
||||
cur_timer_data->mChildTime = 0;
|
||||
#endif
|
||||
#if DEBUG_FAST_TIMER_THREADS
|
||||
#if !LL_RELEASE
|
||||
assert_main_thread();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
LL_FORCE_INLINE ~LLFastTimer()
|
||||
{
|
||||
#if FAST_TIMER_ON
|
||||
LLFastTimer::FrameState* frame_state = mFrameState;
|
||||
U32 total_time = getCPUClockCount32() - mStartTime;
|
||||
|
||||
frame_state->mSelfTimeCounter += total_time - LLFastTimer::sCurTimerData.mChildTime;
|
||||
frame_state->mActiveCount--;
|
||||
|
||||
// store last caller to bootstrap tree creation
|
||||
// do this in the destructor in case of recursion to get topmost caller
|
||||
frame_state->mLastCaller = mLastTimerData.mFrameState;
|
||||
|
||||
// we are only tracking self time, so subtract our total time delta from parents
|
||||
mLastTimerData.mChildTime += total_time;
|
||||
|
||||
LLFastTimer::sCurTimerData = mLastTimerData;
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
static LLMutex* sLogLock;
|
||||
static std::queue<LLSD> sLogQueue;
|
||||
static BOOL sLog;
|
||||
static BOOL sMetricLog;
|
||||
static std::string sLogName;
|
||||
static bool sPauseHistory;
|
||||
static bool sResetHistory;
|
||||
|
||||
// call this once a frame to reset timers
|
||||
static void nextFrame();
|
||||
|
||||
// dumps current cumulative frame stats to log
|
||||
// call nextFrame() to reset timers
|
||||
static void dumpCurTimes();
|
||||
|
||||
// call this to reset timer hierarchy, averages, etc.
|
||||
static void reset();
|
||||
|
||||
static U64 countsPerSecond();
|
||||
static S32 getLastFrameIndex() { return sLastFrameIndex; }
|
||||
static S32 getCurFrameIndex() { return sCurFrameIndex; }
|
||||
|
||||
static void writeLog(std::ostream& os);
|
||||
static const NamedTimer* getTimerByName(const std::string& name);
|
||||
|
||||
struct CurTimerData
|
||||
{
|
||||
LLFastTimer* mCurTimer;
|
||||
FrameState* mFrameState;
|
||||
U32 mChildTime;
|
||||
};
|
||||
static CurTimerData sCurTimerData;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Important note: These implementations must be FAST!
|
||||
//
|
||||
|
||||
|
||||
#if LL_WINDOWS
|
||||
//
|
||||
// Windows implementation of CPU clock
|
||||
//
|
||||
|
||||
//
|
||||
// NOTE: put back in when we aren't using platform sdk anymore
|
||||
//
|
||||
// because MS has different signatures for these functions in winnt.h
|
||||
// need to rename them to avoid conflicts
|
||||
//#define _interlockedbittestandset _renamed_interlockedbittestandset
|
||||
//#define _interlockedbittestandreset _renamed_interlockedbittestandreset
|
||||
//#include <intrin.h>
|
||||
//#undef _interlockedbittestandset
|
||||
//#undef _interlockedbittestandreset
|
||||
|
||||
//inline U32 LLFastTimer::getCPUClockCount32()
|
||||
//{
|
||||
// U64 time_stamp = __rdtsc();
|
||||
// return (U32)(time_stamp >> 8);
|
||||
//}
|
||||
//
|
||||
//// return full timer value, *not* shifted by 8 bits
|
||||
//inline U64 LLFastTimer::getCPUClockCount64()
|
||||
//{
|
||||
// return __rdtsc();
|
||||
//}
|
||||
|
||||
// shift off lower 8 bits for lower resolution but longer term timing
|
||||
// on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing
|
||||
#if LL_FASTTIMER_USE_RDTSC
|
||||
static U32 getCPUClockCount32()
|
||||
{
|
||||
U32 ret_val;
|
||||
__asm
|
||||
{
|
||||
_emit 0x0f
|
||||
_emit 0x31
|
||||
shr eax,8
|
||||
shl edx,24
|
||||
or eax, edx
|
||||
mov dword ptr [ret_val], eax
|
||||
}
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
// return full timer value, *not* shifted by 8 bits
|
||||
static U64 getCPUClockCount64()
|
||||
{
|
||||
U64 ret_val;
|
||||
__asm
|
||||
{
|
||||
_emit 0x0f
|
||||
_emit 0x31
|
||||
mov eax,eax
|
||||
mov edx,edx
|
||||
mov dword ptr [ret_val+4], edx
|
||||
mov dword ptr [ret_val], eax
|
||||
}
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
#else
|
||||
//LL_COMMON_API U64 get_clock_count(); // in lltimer.cpp
|
||||
// These use QueryPerformanceCounter, which is arguably fine and also works on AMD architectures.
|
||||
static U32 getCPUClockCount32()
|
||||
{
|
||||
return (U32)(get_clock_count()>>8);
|
||||
}
|
||||
|
||||
static U64 getCPUClockCount64()
|
||||
{
|
||||
return get_clock_count();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if (LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__))
|
||||
//
|
||||
// Linux and Solaris implementation of CPU clock - non-x86.
|
||||
// This is accurate but SLOW! Only use out of desperation.
|
||||
//
|
||||
// Try to use the MONOTONIC clock if available, this is a constant time counter
|
||||
// with nanosecond resolution (but not necessarily accuracy) and attempts are
|
||||
// made to synchronize this value between cores at kernel start. It should not
|
||||
// be affected by CPU frequency. If not available use the REALTIME clock, but
|
||||
// this may be affected by NTP adjustments or other user activity affecting
|
||||
// the system time.
|
||||
static U64 getCPUClockCount64()
|
||||
{
|
||||
struct timespec tp;
|
||||
|
||||
#ifdef CLOCK_MONOTONIC // MONOTONIC supported at build-time?
|
||||
if (-1 == clock_gettime(CLOCK_MONOTONIC,&tp)) // if MONOTONIC isn't supported at runtime then ouch, try REALTIME
|
||||
#endif
|
||||
clock_gettime(CLOCK_REALTIME,&tp);
|
||||
|
||||
return (tp.tv_sec*sClockResolution)+tp.tv_nsec;
|
||||
}
|
||||
|
||||
static U32 getCPUClockCount32()
|
||||
{
|
||||
return (U32)(getCPUClockCount64() >> 8);
|
||||
}
|
||||
|
||||
#endif // (LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__))
|
||||
|
||||
|
||||
#if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__))
|
||||
//
|
||||
// Mac+Linux+Solaris FAST x86 implementation of CPU clock
|
||||
static U32 getCPUClockCount32()
|
||||
{
|
||||
U64 x;
|
||||
__asm__ volatile (".byte 0x0f, 0x31": "=A"(x));
|
||||
return (U32)(x >> 8);
|
||||
}
|
||||
|
||||
static U64 getCPUClockCount64()
|
||||
{
|
||||
U64 x;
|
||||
__asm__ volatile (".byte 0x0f, 0x31": "=A"(x));
|
||||
return x;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static U64 sClockResolution;
|
||||
|
||||
static S32 sCurFrameIndex;
|
||||
static S32 sLastFrameIndex;
|
||||
static U64 sLastFrameTime;
|
||||
|
||||
U32 mStartTime;
|
||||
LLFastTimer::FrameState* mFrameState;
|
||||
LLFastTimer::CurTimerData mLastTimerData;
|
||||
|
||||
};
|
||||
|
||||
typedef class LLFastTimer LLFastTimer;
|
||||
|
||||
#endif // LL_LLFASTTIMER_H
|
||||
|
|
|
|||
|
|
@ -1,276 +0,0 @@
|
|||
/**
|
||||
* @file llfasttimer_class.h
|
||||
* @brief Declaration of a fast timer.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_FASTTIMER_CLASS_H
|
||||
#define LL_FASTTIMER_CLASS_H
|
||||
|
||||
#include "llinstancetracker.h"
|
||||
|
||||
#define FAST_TIMER_ON 1
|
||||
#define TIME_FAST_TIMERS 0
|
||||
#define DEBUG_FAST_TIMER_THREADS 1
|
||||
|
||||
class LLMutex;
|
||||
|
||||
#include <queue>
|
||||
#include "llsd.h"
|
||||
|
||||
LL_COMMON_API void assert_main_thread();
|
||||
|
||||
class LL_COMMON_API LLFastTimer
|
||||
{
|
||||
public:
|
||||
class NamedTimer;
|
||||
|
||||
struct LL_COMMON_API FrameState
|
||||
{
|
||||
FrameState(NamedTimer* timerp);
|
||||
|
||||
U32 mSelfTimeCounter;
|
||||
U32 mCalls;
|
||||
FrameState* mParent; // info for caller timer
|
||||
FrameState* mLastCaller; // used to bootstrap tree construction
|
||||
NamedTimer* mTimer;
|
||||
U16 mActiveCount; // number of timers with this ID active on stack
|
||||
bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame
|
||||
};
|
||||
|
||||
// stores a "named" timer instance to be reused via multiple LLFastTimer stack instances
|
||||
class LL_COMMON_API NamedTimer
|
||||
: public LLInstanceTracker<NamedTimer>
|
||||
{
|
||||
friend class DeclareTimer;
|
||||
public:
|
||||
~NamedTimer();
|
||||
|
||||
enum { HISTORY_NUM = 300 };
|
||||
|
||||
const std::string& getName() const { return mName; }
|
||||
NamedTimer* getParent() const { return mParent; }
|
||||
void setParent(NamedTimer* parent);
|
||||
S32 getDepth();
|
||||
std::string getToolTip(S32 history_index = -1);
|
||||
|
||||
typedef std::vector<NamedTimer*>::const_iterator child_const_iter;
|
||||
child_const_iter beginChildren();
|
||||
child_const_iter endChildren();
|
||||
std::vector<NamedTimer*>& getChildren();
|
||||
|
||||
void setCollapsed(bool collapsed) { mCollapsed = collapsed; }
|
||||
bool getCollapsed() const { return mCollapsed; }
|
||||
|
||||
U32 getCountAverage() const { return mCountAverage; }
|
||||
U32 getCallAverage() const { return mCallAverage; }
|
||||
|
||||
U32 getHistoricalCount(S32 history_index = 0) const;
|
||||
U32 getHistoricalCalls(S32 history_index = 0) const;
|
||||
|
||||
static NamedTimer& getRootNamedTimer();
|
||||
|
||||
S32 getFrameStateIndex() const { return mFrameStateIndex; }
|
||||
|
||||
FrameState& getFrameState() const;
|
||||
|
||||
private:
|
||||
friend class LLFastTimer;
|
||||
friend class NamedTimerFactory;
|
||||
|
||||
//
|
||||
// methods
|
||||
//
|
||||
NamedTimer(const std::string& name);
|
||||
// recursive call to gather total time from children
|
||||
static void accumulateTimings();
|
||||
|
||||
// updates cumulative times and hierarchy,
|
||||
// can be called multiple times in a frame, at any point
|
||||
static void processTimes();
|
||||
|
||||
static void buildHierarchy();
|
||||
static void resetFrame();
|
||||
static void reset();
|
||||
|
||||
//
|
||||
// members
|
||||
//
|
||||
S32 mFrameStateIndex;
|
||||
|
||||
std::string mName;
|
||||
|
||||
U32 mTotalTimeCounter;
|
||||
|
||||
U32 mCountAverage;
|
||||
U32 mCallAverage;
|
||||
|
||||
U32* mCountHistory;
|
||||
U32* mCallHistory;
|
||||
|
||||
// tree structure
|
||||
NamedTimer* mParent; // NamedTimer of caller(parent)
|
||||
std::vector<NamedTimer*> mChildren;
|
||||
bool mCollapsed; // don't show children
|
||||
bool mNeedsSorting; // sort children whenever child added
|
||||
};
|
||||
|
||||
// used to statically declare a new named timer
|
||||
class LL_COMMON_API DeclareTimer
|
||||
: public LLInstanceTracker<DeclareTimer>
|
||||
{
|
||||
friend class LLFastTimer;
|
||||
public:
|
||||
DeclareTimer(const std::string& name, bool open);
|
||||
DeclareTimer(const std::string& name);
|
||||
|
||||
static void updateCachedPointers();
|
||||
|
||||
private:
|
||||
NamedTimer& mTimer;
|
||||
FrameState* mFrameState;
|
||||
};
|
||||
|
||||
public:
|
||||
LLFastTimer(LLFastTimer::FrameState* state);
|
||||
|
||||
LL_FORCE_INLINE LLFastTimer(LLFastTimer::DeclareTimer& timer)
|
||||
: mFrameState(timer.mFrameState)
|
||||
{
|
||||
#if TIME_FAST_TIMERS
|
||||
U64 timer_start = getCPUClockCount64();
|
||||
#endif
|
||||
#if FAST_TIMER_ON
|
||||
LLFastTimer::FrameState* frame_state = mFrameState;
|
||||
mStartTime = getCPUClockCount32();
|
||||
|
||||
frame_state->mActiveCount++;
|
||||
frame_state->mCalls++;
|
||||
// keep current parent as long as it is active when we are
|
||||
frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0);
|
||||
|
||||
LLFastTimer::CurTimerData* cur_timer_data = &LLFastTimer::sCurTimerData;
|
||||
mLastTimerData = *cur_timer_data;
|
||||
cur_timer_data->mCurTimer = this;
|
||||
cur_timer_data->mFrameState = frame_state;
|
||||
cur_timer_data->mChildTime = 0;
|
||||
#endif
|
||||
#if TIME_FAST_TIMERS
|
||||
U64 timer_end = getCPUClockCount64();
|
||||
sTimerCycles += timer_end - timer_start;
|
||||
#endif
|
||||
#if DEBUG_FAST_TIMER_THREADS
|
||||
#if !LL_RELEASE
|
||||
assert_main_thread();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
LL_FORCE_INLINE ~LLFastTimer()
|
||||
{
|
||||
#if TIME_FAST_TIMERS
|
||||
U64 timer_start = getCPUClockCount64();
|
||||
#endif
|
||||
#if FAST_TIMER_ON
|
||||
LLFastTimer::FrameState* frame_state = mFrameState;
|
||||
U32 total_time = getCPUClockCount32() - mStartTime;
|
||||
|
||||
frame_state->mSelfTimeCounter += total_time - LLFastTimer::sCurTimerData.mChildTime;
|
||||
frame_state->mActiveCount--;
|
||||
|
||||
// store last caller to bootstrap tree creation
|
||||
// do this in the destructor in case of recursion to get topmost caller
|
||||
frame_state->mLastCaller = mLastTimerData.mFrameState;
|
||||
|
||||
// we are only tracking self time, so subtract our total time delta from parents
|
||||
mLastTimerData.mChildTime += total_time;
|
||||
|
||||
LLFastTimer::sCurTimerData = mLastTimerData;
|
||||
#endif
|
||||
#if TIME_FAST_TIMERS
|
||||
U64 timer_end = getCPUClockCount64();
|
||||
sTimerCycles += timer_end - timer_start;
|
||||
sTimerCalls++;
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
static LLMutex* sLogLock;
|
||||
static std::queue<LLSD> sLogQueue;
|
||||
static BOOL sLog;
|
||||
static BOOL sMetricLog;
|
||||
static std::string sLogName;
|
||||
static bool sPauseHistory;
|
||||
static bool sResetHistory;
|
||||
static U64 sTimerCycles;
|
||||
static U32 sTimerCalls;
|
||||
|
||||
typedef std::vector<FrameState> info_list_t;
|
||||
static info_list_t& getFrameStateList();
|
||||
|
||||
|
||||
// call this once a frame to reset timers
|
||||
static void nextFrame();
|
||||
|
||||
// dumps current cumulative frame stats to log
|
||||
// call nextFrame() to reset timers
|
||||
static void dumpCurTimes();
|
||||
|
||||
// call this to reset timer hierarchy, averages, etc.
|
||||
static void reset();
|
||||
|
||||
static U64 countsPerSecond();
|
||||
static S32 getLastFrameIndex() { return sLastFrameIndex; }
|
||||
static S32 getCurFrameIndex() { return sCurFrameIndex; }
|
||||
|
||||
static void writeLog(std::ostream& os);
|
||||
static const NamedTimer* getTimerByName(const std::string& name);
|
||||
|
||||
struct CurTimerData
|
||||
{
|
||||
LLFastTimer* mCurTimer;
|
||||
FrameState* mFrameState;
|
||||
U32 mChildTime;
|
||||
};
|
||||
static CurTimerData sCurTimerData;
|
||||
static std::string sClockType;
|
||||
|
||||
private:
|
||||
static U32 getCPUClockCount32();
|
||||
static U64 getCPUClockCount64();
|
||||
static U64 sClockResolution;
|
||||
|
||||
static S32 sCurFrameIndex;
|
||||
static S32 sLastFrameIndex;
|
||||
static U64 sLastFrameTime;
|
||||
static info_list_t* sTimerInfos;
|
||||
|
||||
U32 mStartTime;
|
||||
LLFastTimer::FrameState* mFrameState;
|
||||
LLFastTimer::CurTimerData mLastTimerData;
|
||||
|
||||
};
|
||||
|
||||
typedef class LLFastTimer LLFastTimer;
|
||||
|
||||
#endif // LL_LLFASTTIMER_CLASS_H
|
||||
|
|
@ -31,6 +31,7 @@
|
|||
#include <vector>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/is_enum.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
|
@ -209,9 +210,7 @@ namespace LLInitParam
|
|||
class LL_COMMON_API Parser
|
||||
{
|
||||
LOG_CLASS(Parser);
|
||||
|
||||
public:
|
||||
|
||||
typedef std::vector<std::pair<std::string, bool> > name_stack_t;
|
||||
typedef std::pair<name_stack_t::iterator, name_stack_t::iterator> name_stack_range_t;
|
||||
typedef std::vector<std::string> possible_values_t;
|
||||
|
|
@ -224,32 +223,81 @@ namespace LLInitParam
|
|||
typedef std::map<const std::type_info*, parser_write_func_t> parser_write_func_map_t;
|
||||
typedef std::map<const std::type_info*, parser_inspect_func_t> parser_inspect_func_map_t;
|
||||
|
||||
private:
|
||||
template<typename T, bool is_enum = boost::is_enum<T>::value>
|
||||
struct ReaderWriter
|
||||
{
|
||||
static bool read(T& param, Parser* parser)
|
||||
{
|
||||
parser_read_func_map_t::iterator found_it = parser->mParserReadFuncs->find(&typeid(T));
|
||||
if (found_it != parser->mParserReadFuncs->end())
|
||||
{
|
||||
return found_it->second(*parser, (void*)¶m);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool write(const T& param, Parser* parser, name_stack_t& name_stack)
|
||||
{
|
||||
parser_write_func_map_t::iterator found_it = parser->mParserWriteFuncs->find(&typeid(T));
|
||||
if (found_it != parser->mParserWriteFuncs->end())
|
||||
{
|
||||
return found_it->second(*parser, (const void*)¶m, name_stack);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// read enums as ints
|
||||
template<typename T>
|
||||
struct ReaderWriter<T, true>
|
||||
{
|
||||
static bool read(T& param, Parser* parser)
|
||||
{
|
||||
// read all enums as ints
|
||||
parser_read_func_map_t::iterator found_it = parser->mParserReadFuncs->find(&typeid(S32));
|
||||
if (found_it != parser->mParserReadFuncs->end())
|
||||
{
|
||||
S32 value;
|
||||
if (found_it->second(*parser, (void*)&value))
|
||||
{
|
||||
param = (T)value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool write(const T& param, Parser* parser, name_stack_t& name_stack)
|
||||
{
|
||||
parser_write_func_map_t::iterator found_it = parser->mParserWriteFuncs->find(&typeid(S32));
|
||||
if (found_it != parser->mParserWriteFuncs->end())
|
||||
{
|
||||
return found_it->second(*parser, (const void*)¶m, name_stack);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
Parser(parser_read_func_map_t& read_map, parser_write_func_map_t& write_map, parser_inspect_func_map_t& inspect_map)
|
||||
: mParseSilently(false),
|
||||
mParserReadFuncs(&read_map),
|
||||
mParserWriteFuncs(&write_map),
|
||||
mParserInspectFuncs(&inspect_map)
|
||||
{}
|
||||
|
||||
virtual ~Parser();
|
||||
|
||||
template <typename T> bool readValue(T& param)
|
||||
{
|
||||
parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T));
|
||||
if (found_it != mParserReadFuncs->end())
|
||||
{
|
||||
return found_it->second(*this, (void*)¶m);
|
||||
}
|
||||
return false;
|
||||
return ReaderWriter<T>::read(param, this);
|
||||
}
|
||||
|
||||
template <typename T> bool writeValue(const T& param, name_stack_t& name_stack)
|
||||
{
|
||||
parser_write_func_map_t::iterator found_it = mParserWriteFuncs->find(&typeid(T));
|
||||
if (found_it != mParserWriteFuncs->end())
|
||||
{
|
||||
return found_it->second(*this, (const void*)¶m, name_stack);
|
||||
}
|
||||
return false;
|
||||
return ReaderWriter<T>::write(param, this, name_stack);
|
||||
}
|
||||
|
||||
// dispatch inspection to registered inspection functions, for each parameter in a param block
|
||||
|
|
@ -841,31 +889,25 @@ namespace LLInitParam
|
|||
self_t& typed_param = static_cast<self_t&>(param);
|
||||
// no further names in stack, attempt to parse value now
|
||||
if (name_stack_range.first == name_stack_range.second)
|
||||
{
|
||||
if (parser.readValue(typed_param.getValue()))
|
||||
{
|
||||
std::string name;
|
||||
|
||||
// try to parse a known named value
|
||||
if(name_value_lookup_t::valueNamesExist()
|
||||
&& parser.readValue(name)
|
||||
&& name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
|
||||
{
|
||||
typed_param.setValueName(name);
|
||||
typed_param.setProvided();
|
||||
return true;
|
||||
}
|
||||
// try to read value directly
|
||||
else if (parser.readValue(typed_param.getValue()))
|
||||
{
|
||||
typed_param.clearValueName();
|
||||
typed_param.setProvided();
|
||||
return true;
|
||||
}
|
||||
|
||||
// try to parse a known named value
|
||||
if(name_value_lookup_t::valueNamesExist())
|
||||
{
|
||||
// try to parse a known named value
|
||||
std::string name;
|
||||
if (parser.readValue(name))
|
||||
{
|
||||
// try to parse a per type named value
|
||||
if (name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
|
||||
{
|
||||
typed_param.setValueName(name);
|
||||
typed_param.setProvided();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -987,30 +1029,29 @@ namespace LLInitParam
|
|||
static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack_range, bool new_name)
|
||||
{
|
||||
self_t& typed_param = static_cast<self_t&>(param);
|
||||
// attempt to parse block...
|
||||
|
||||
if (name_stack_range.first == name_stack_range.second)
|
||||
{ // try to parse a known named value
|
||||
std::string name;
|
||||
|
||||
if(name_value_lookup_t::valueNamesExist()
|
||||
&& parser.readValue(name)
|
||||
&& name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
|
||||
{
|
||||
typed_param.setValueName(name);
|
||||
typed_param.setProvided();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(typed_param.deserializeBlock(parser, name_stack_range, new_name))
|
||||
{
|
||||
{ // attempt to parse block...
|
||||
typed_param.clearValueName();
|
||||
typed_param.setProvided();
|
||||
return true;
|
||||
}
|
||||
|
||||
if(name_value_lookup_t::valueNamesExist())
|
||||
{
|
||||
// try to parse a known named value
|
||||
std::string name;
|
||||
if (parser.readValue(name))
|
||||
{
|
||||
// try to parse a per type named value
|
||||
if (name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
|
||||
{
|
||||
typed_param.setValueName(name);
|
||||
typed_param.setProvided();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1160,31 +1201,23 @@ namespace LLInitParam
|
|||
value_t value;
|
||||
// no further names in stack, attempt to parse value now
|
||||
if (name_stack_range.first == name_stack_range.second)
|
||||
{
|
||||
// attempt to read value directly
|
||||
if (parser.readValue(value))
|
||||
{
|
||||
std::string name;
|
||||
|
||||
// try to parse a known named value
|
||||
if(name_value_lookup_t::valueNamesExist()
|
||||
&& parser.readValue(name)
|
||||
&& name_value_lookup_t::getValueFromName(name, value))
|
||||
{
|
||||
typed_param.add(value);
|
||||
typed_param.mValues.back().setValueName(name);
|
||||
return true;
|
||||
}
|
||||
else if (parser.readValue(value)) // attempt to read value directly
|
||||
{
|
||||
typed_param.add(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
// try to parse a known named value
|
||||
if(name_value_lookup_t::valueNamesExist())
|
||||
{
|
||||
// try to parse a known named value
|
||||
std::string name;
|
||||
if (parser.readValue(name))
|
||||
{
|
||||
// try to parse a per type named value
|
||||
if (name_value_lookup_t::getValueFromName(name, value))
|
||||
{
|
||||
typed_param.add(value);
|
||||
typed_param.mValues.back().setValueName(name);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1362,28 +1395,27 @@ namespace LLInitParam
|
|||
|
||||
param_value_t& value = typed_param.mValues.back();
|
||||
|
||||
if (name_stack_range.first == name_stack_range.second)
|
||||
{ // try to parse a known named value
|
||||
std::string name;
|
||||
|
||||
if(name_value_lookup_t::valueNamesExist()
|
||||
&& parser.readValue(name)
|
||||
&& name_value_lookup_t::getValueFromName(name, value.getValue()))
|
||||
{
|
||||
typed_param.mValues.back().setValueName(name);
|
||||
typed_param.setProvided();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// attempt to parse block...
|
||||
if(value.deserializeBlock(parser, name_stack_range, new_name))
|
||||
{
|
||||
typed_param.setProvided();
|
||||
return true;
|
||||
}
|
||||
else if(name_value_lookup_t::valueNamesExist())
|
||||
{
|
||||
// try to parse a known named value
|
||||
std::string name;
|
||||
if (parser.readValue(name))
|
||||
{
|
||||
// try to parse a per type named value
|
||||
if (name_value_lookup_t::getValueFromName(name, value.getValue()))
|
||||
{
|
||||
typed_param.mValues.back().setValueName(name);
|
||||
typed_param.setProvided();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (new_value)
|
||||
{ // failed to parse new value, pop it off
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@
|
|||
#ifndef LLMEMORY_H
|
||||
#define LLMEMORY_H
|
||||
|
||||
#include "llmemtype.h"
|
||||
#include "linden_common.h"
|
||||
|
||||
class LLMutex ;
|
||||
|
||||
#if LL_WINDOWS && LL_DEBUG
|
||||
#define LL_CHECK_MEMORY llassert(_CrtCheckMemory());
|
||||
|
|
|
|||
|
|
@ -1,232 +0,0 @@
|
|||
/**
|
||||
* @file llmemtype.cpp
|
||||
* @brief Simple memory allocation/deallocation tracking stuff here
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llmemtype.h"
|
||||
#include "llallocator.h"
|
||||
|
||||
std::vector<char const *> LLMemType::DeclareMemType::mNameList;
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INIT("Init");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_STARTUP("Startup");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_MAIN("Main");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_FRAME("Frame");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_GATHER_INPUT("GatherInput");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_JOY_KEY("JoyKey");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IDLE("Idle");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_PUMP("IdlePump");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_NETWORK("IdleNetwork");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_UPDATE_REGIONS("IdleUpdateRegions");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_UPDATE_VIEWER_REGION("IdleUpdateViewerRegion");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_UPDATE_SURFACE("IdleUpdateSurface");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_UPDATE_PARCEL_OVERLAY("IdleUpdateParcelOverlay");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IDLE_AUDIO("IdleAudio");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_CACHE_PROCESS_PENDING("CacheProcessPending");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_CACHE_PROCESS_PENDING_ASKS("CacheProcessPendingAsks");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_CACHE_PROCESS_PENDING_REPLIES("CacheProcessPendingReplies");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_MESSAGE_CHECK_ALL("MessageCheckAll");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_MESSAGE_PROCESS_ACKS("MessageProcessAcks");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_RENDER("Render");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_SLEEP("Sleep");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_NETWORK("Network");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PHYSICS("Physics");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INTERESTLIST("InterestList");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IMAGEBASE("ImageBase");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IMAGERAW("ImageRaw");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IMAGEFORMATTED("ImageFormatted");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_APPFMTIMAGE("AppFmtImage");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_APPRAWIMAGE("AppRawImage");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_APPAUXRAWIMAGE("AppAuxRawImage");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DRAWABLE("Drawable");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_OBJECT("Object");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_OBJECT_PROCESS_UPDATE("ObjectProcessUpdate");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_OBJECT_PROCESS_UPDATE_CORE("ObjectProcessUpdateCore");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY("Display");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_UPDATE("DisplayUpdate");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_UPDATE_CAMERA("DisplayUpdateCam");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_UPDATE_GEOM("DisplayUpdateGeom");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_SWAP("DisplaySwap");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_UPDATE_HUD("DisplayUpdateHud");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_GEN_REFLECTION("DisplayGenRefl");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_IMAGE_UPDATE("DisplayImageUpdate");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_STATE_SORT("DisplayStateSort");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_SKY("DisplaySky");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_RENDER_GEOM("DisplayRenderGeom");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_RENDER_FLUSH("DisplayRenderFlush");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_RENDER_UI("DisplayRenderUI");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DISPLAY_RENDER_ATTACHMENTS("DisplayRenderAttach");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_DATA("VertexData");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_CONSTRUCTOR("VertexConstr");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_DESTRUCTOR("VertexDestr");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_CREATE_VERTICES("VertexCreateVerts");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_CREATE_INDICES("VertexCreateIndices");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_DESTROY_BUFFER("VertexDestroyBuff");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_DESTROY_INDICES("VertexDestroyIndices");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_UPDATE_VERTS("VertexUpdateVerts");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_UPDATE_INDICES("VertexUpdateIndices");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_ALLOCATE_BUFFER("VertexAllocateBuffer");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_RESIZE_BUFFER("VertexResizeBuffer");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_MAP_BUFFER("VertexMapBuffer");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_MAP_BUFFER_VERTICES("VertexMapBufferVerts");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_MAP_BUFFER_INDICES("VertexMapBufferIndices");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_UNMAP_BUFFER("VertexUnmapBuffer");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_SET_STRIDE("VertexSetStride");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_SET_BUFFER("VertexSetBuffer");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_SETUP_VERTEX_BUFFER("VertexSetupVertBuff");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VERTEX_CLEANUP_CLASS("VertexCleanupClass");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_SPACE_PARTITION("SpacePartition");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE("Pipeline");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_INIT("PipelineInit");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_CREATE_BUFFERS("PipelineCreateBuffs");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RESTORE_GL("PipelineRestroGL");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_UNLOAD_SHADERS("PipelineUnloadShaders");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_LIGHTING_DETAIL("PipelineLightingDetail");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_GET_POOL_TYPE("PipelineGetPoolType");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_ADD_POOL("PipelineAddPool");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_ALLOCATE_DRAWABLE("PipelineAllocDrawable");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_ADD_OBJECT("PipelineAddObj");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_CREATE_OBJECTS("PipelineCreateObjs");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_UPDATE_MOVE("PipelineUpdateMove");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_UPDATE_GEOM("PipelineUpdateGeom");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_MARK_VISIBLE("PipelineMarkVisible");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_MARK_MOVED("PipelineMarkMoved");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_MARK_SHIFT("PipelineMarkShift");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_SHIFT_OBJECTS("PipelineShiftObjs");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_MARK_TEXTURED("PipelineMarkTextured");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_MARK_REBUILD("PipelineMarkRebuild");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_UPDATE_CULL("PipelineUpdateCull");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_STATE_SORT("PipelineStateSort");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_POST_SORT("PipelinePostSort");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_HUD_ELS("PipelineHudEls");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_HL("PipelineRenderHL");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_GEOM("PipelineRenderGeom");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_GEOM_DEFFERRED("PipelineRenderGeomDef");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_GEOM_POST_DEF("PipelineRenderGeomPostDef");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_GEOM_SHADOW("PipelineRenderGeomShadow");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_SELECT("PipelineRenderSelect");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_REBUILD_POOLS("PipelineRebuildPools");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_QUICK_LOOKUP("PipelineQuickLookup");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_OBJECTS("PipelineRenderObjs");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_GENERATE_IMPOSTOR("PipelineGenImpostors");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PIPELINE_RENDER_BLOOM("PipelineRenderBloom");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_UPKEEP_POOLS("UpkeepPools");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_AVATAR("Avatar");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_AVATAR_MESH("AvatarMesh");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PARTICLES("Particles");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_REGIONS("Regions");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY("Inventory");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_DRAW("InventoryDraw");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_BUILD_NEW_VIEWS("InventoryBuildNewViews");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_DO_FOLDER("InventoryDoFolder");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_POST_BUILD("InventoryPostBuild");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_FROM_XML("InventoryFromXML");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_CREATE_NEW_ITEM("InventoryCreateNewItem");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_VIEW_INIT("InventoryViewInit");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_VIEW_SHOW("InventoryViewShow");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_INVENTORY_VIEW_TOGGLE("InventoryViewToggle");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_ANIMATION("Animation");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_VOLUME("Volume");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_PRIMITIVE("Primitive");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_SCRIPT("Script");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_SCRIPT_RUN("ScriptRun");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_SCRIPT_BYTECODE("ScriptByteCode");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IO_PUMP("IoPump");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IO_TCP("IoTCP");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IO_BUFFER("IoBuffer");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IO_HTTP_SERVER("IoHttpServer");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IO_SD_SERVER("IoSDServer");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IO_SD_CLIENT("IoSDClient");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_IO_URL_REQUEST("IOUrlRequest");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_DIRECTX_INIT("DirectXInit");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_TEMP1("Temp1");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_TEMP2("Temp2");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_TEMP3("Temp3");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_TEMP4("Temp4");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_TEMP5("Temp5");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_TEMP6("Temp6");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_TEMP7("Temp7");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_TEMP8("Temp8");
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_TEMP9("Temp9");
|
||||
|
||||
LLMemType::DeclareMemType LLMemType::MTYPE_OTHER("Other");
|
||||
|
||||
|
||||
LLMemType::DeclareMemType::DeclareMemType(char const * st)
|
||||
{
|
||||
mID = (S32)mNameList.size();
|
||||
mName = st;
|
||||
|
||||
mNameList.push_back(mName);
|
||||
}
|
||||
|
||||
LLMemType::DeclareMemType::~DeclareMemType()
|
||||
{
|
||||
}
|
||||
|
||||
LLMemType::LLMemType(LLMemType::DeclareMemType& dt)
|
||||
{
|
||||
mTypeIndex = dt.mID;
|
||||
LLAllocator::pushMemType(dt.mID);
|
||||
}
|
||||
|
||||
LLMemType::~LLMemType()
|
||||
{
|
||||
LLAllocator::popMemType();
|
||||
}
|
||||
|
||||
char const * LLMemType::getNameFromID(S32 id)
|
||||
{
|
||||
if (id < 0 || id >= (S32)DeclareMemType::mNameList.size())
|
||||
{
|
||||
return "INVALID";
|
||||
}
|
||||
|
||||
return DeclareMemType::mNameList[id];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
|
@ -1,242 +0,0 @@
|
|||
/**
|
||||
* @file llmemtype.h
|
||||
* @brief Runtime memory usage debugging utilities.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_MEMTYPE_H
|
||||
#define LL_MEMTYPE_H
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#include "linden_common.h"
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// WARNING: Never commit with MEM_TRACK_MEM == 1
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
#define MEM_TRACK_MEM (0 && LL_WINDOWS)
|
||||
|
||||
#include <vector>
|
||||
|
||||
#define MEM_TYPE_NEW(T)
|
||||
|
||||
class LL_COMMON_API LLMemType
|
||||
{
|
||||
public:
|
||||
|
||||
// class we'll initialize all instances of as
|
||||
// static members of MemType. Then use
|
||||
// to construct any new mem type.
|
||||
class LL_COMMON_API DeclareMemType
|
||||
{
|
||||
public:
|
||||
DeclareMemType(char const * st);
|
||||
~DeclareMemType();
|
||||
|
||||
S32 mID;
|
||||
char const * mName;
|
||||
|
||||
// array so we can map an index ID to Name
|
||||
static std::vector<char const *> mNameList;
|
||||
};
|
||||
|
||||
LLMemType(DeclareMemType& dt);
|
||||
~LLMemType();
|
||||
|
||||
static char const * getNameFromID(S32 id);
|
||||
|
||||
static DeclareMemType MTYPE_INIT;
|
||||
static DeclareMemType MTYPE_STARTUP;
|
||||
static DeclareMemType MTYPE_MAIN;
|
||||
static DeclareMemType MTYPE_FRAME;
|
||||
|
||||
static DeclareMemType MTYPE_GATHER_INPUT;
|
||||
static DeclareMemType MTYPE_JOY_KEY;
|
||||
|
||||
static DeclareMemType MTYPE_IDLE;
|
||||
static DeclareMemType MTYPE_IDLE_PUMP;
|
||||
static DeclareMemType MTYPE_IDLE_NETWORK;
|
||||
static DeclareMemType MTYPE_IDLE_UPDATE_REGIONS;
|
||||
static DeclareMemType MTYPE_IDLE_UPDATE_VIEWER_REGION;
|
||||
static DeclareMemType MTYPE_IDLE_UPDATE_SURFACE;
|
||||
static DeclareMemType MTYPE_IDLE_UPDATE_PARCEL_OVERLAY;
|
||||
static DeclareMemType MTYPE_IDLE_AUDIO;
|
||||
|
||||
static DeclareMemType MTYPE_CACHE_PROCESS_PENDING;
|
||||
static DeclareMemType MTYPE_CACHE_PROCESS_PENDING_ASKS;
|
||||
static DeclareMemType MTYPE_CACHE_PROCESS_PENDING_REPLIES;
|
||||
|
||||
static DeclareMemType MTYPE_MESSAGE_CHECK_ALL;
|
||||
static DeclareMemType MTYPE_MESSAGE_PROCESS_ACKS;
|
||||
|
||||
static DeclareMemType MTYPE_RENDER;
|
||||
static DeclareMemType MTYPE_SLEEP;
|
||||
|
||||
static DeclareMemType MTYPE_NETWORK;
|
||||
static DeclareMemType MTYPE_PHYSICS;
|
||||
static DeclareMemType MTYPE_INTERESTLIST;
|
||||
|
||||
static DeclareMemType MTYPE_IMAGEBASE;
|
||||
static DeclareMemType MTYPE_IMAGERAW;
|
||||
static DeclareMemType MTYPE_IMAGEFORMATTED;
|
||||
|
||||
static DeclareMemType MTYPE_APPFMTIMAGE;
|
||||
static DeclareMemType MTYPE_APPRAWIMAGE;
|
||||
static DeclareMemType MTYPE_APPAUXRAWIMAGE;
|
||||
|
||||
static DeclareMemType MTYPE_DRAWABLE;
|
||||
|
||||
static DeclareMemType MTYPE_OBJECT;
|
||||
static DeclareMemType MTYPE_OBJECT_PROCESS_UPDATE;
|
||||
static DeclareMemType MTYPE_OBJECT_PROCESS_UPDATE_CORE;
|
||||
|
||||
static DeclareMemType MTYPE_DISPLAY;
|
||||
static DeclareMemType MTYPE_DISPLAY_UPDATE;
|
||||
static DeclareMemType MTYPE_DISPLAY_UPDATE_CAMERA;
|
||||
static DeclareMemType MTYPE_DISPLAY_UPDATE_GEOM;
|
||||
static DeclareMemType MTYPE_DISPLAY_SWAP;
|
||||
static DeclareMemType MTYPE_DISPLAY_UPDATE_HUD;
|
||||
static DeclareMemType MTYPE_DISPLAY_GEN_REFLECTION;
|
||||
static DeclareMemType MTYPE_DISPLAY_IMAGE_UPDATE;
|
||||
static DeclareMemType MTYPE_DISPLAY_STATE_SORT;
|
||||
static DeclareMemType MTYPE_DISPLAY_SKY;
|
||||
static DeclareMemType MTYPE_DISPLAY_RENDER_GEOM;
|
||||
static DeclareMemType MTYPE_DISPLAY_RENDER_FLUSH;
|
||||
static DeclareMemType MTYPE_DISPLAY_RENDER_UI;
|
||||
static DeclareMemType MTYPE_DISPLAY_RENDER_ATTACHMENTS;
|
||||
|
||||
static DeclareMemType MTYPE_VERTEX_DATA;
|
||||
static DeclareMemType MTYPE_VERTEX_CONSTRUCTOR;
|
||||
static DeclareMemType MTYPE_VERTEX_DESTRUCTOR;
|
||||
static DeclareMemType MTYPE_VERTEX_CREATE_VERTICES;
|
||||
static DeclareMemType MTYPE_VERTEX_CREATE_INDICES;
|
||||
static DeclareMemType MTYPE_VERTEX_DESTROY_BUFFER;
|
||||
static DeclareMemType MTYPE_VERTEX_DESTROY_INDICES;
|
||||
static DeclareMemType MTYPE_VERTEX_UPDATE_VERTS;
|
||||
static DeclareMemType MTYPE_VERTEX_UPDATE_INDICES;
|
||||
static DeclareMemType MTYPE_VERTEX_ALLOCATE_BUFFER;
|
||||
static DeclareMemType MTYPE_VERTEX_RESIZE_BUFFER;
|
||||
static DeclareMemType MTYPE_VERTEX_MAP_BUFFER;
|
||||
static DeclareMemType MTYPE_VERTEX_MAP_BUFFER_VERTICES;
|
||||
static DeclareMemType MTYPE_VERTEX_MAP_BUFFER_INDICES;
|
||||
static DeclareMemType MTYPE_VERTEX_UNMAP_BUFFER;
|
||||
static DeclareMemType MTYPE_VERTEX_SET_STRIDE;
|
||||
static DeclareMemType MTYPE_VERTEX_SET_BUFFER;
|
||||
static DeclareMemType MTYPE_VERTEX_SETUP_VERTEX_BUFFER;
|
||||
static DeclareMemType MTYPE_VERTEX_CLEANUP_CLASS;
|
||||
|
||||
static DeclareMemType MTYPE_SPACE_PARTITION;
|
||||
|
||||
static DeclareMemType MTYPE_PIPELINE;
|
||||
static DeclareMemType MTYPE_PIPELINE_INIT;
|
||||
static DeclareMemType MTYPE_PIPELINE_CREATE_BUFFERS;
|
||||
static DeclareMemType MTYPE_PIPELINE_RESTORE_GL;
|
||||
static DeclareMemType MTYPE_PIPELINE_UNLOAD_SHADERS;
|
||||
static DeclareMemType MTYPE_PIPELINE_LIGHTING_DETAIL;
|
||||
static DeclareMemType MTYPE_PIPELINE_GET_POOL_TYPE;
|
||||
static DeclareMemType MTYPE_PIPELINE_ADD_POOL;
|
||||
static DeclareMemType MTYPE_PIPELINE_ALLOCATE_DRAWABLE;
|
||||
static DeclareMemType MTYPE_PIPELINE_ADD_OBJECT;
|
||||
static DeclareMemType MTYPE_PIPELINE_CREATE_OBJECTS;
|
||||
static DeclareMemType MTYPE_PIPELINE_UPDATE_MOVE;
|
||||
static DeclareMemType MTYPE_PIPELINE_UPDATE_GEOM;
|
||||
static DeclareMemType MTYPE_PIPELINE_MARK_VISIBLE;
|
||||
static DeclareMemType MTYPE_PIPELINE_MARK_MOVED;
|
||||
static DeclareMemType MTYPE_PIPELINE_MARK_SHIFT;
|
||||
static DeclareMemType MTYPE_PIPELINE_SHIFT_OBJECTS;
|
||||
static DeclareMemType MTYPE_PIPELINE_MARK_TEXTURED;
|
||||
static DeclareMemType MTYPE_PIPELINE_MARK_REBUILD;
|
||||
static DeclareMemType MTYPE_PIPELINE_UPDATE_CULL;
|
||||
static DeclareMemType MTYPE_PIPELINE_STATE_SORT;
|
||||
static DeclareMemType MTYPE_PIPELINE_POST_SORT;
|
||||
|
||||
static DeclareMemType MTYPE_PIPELINE_RENDER_HUD_ELS;
|
||||
static DeclareMemType MTYPE_PIPELINE_RENDER_HL;
|
||||
static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM;
|
||||
static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_DEFFERRED;
|
||||
static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_POST_DEF;
|
||||
static DeclareMemType MTYPE_PIPELINE_RENDER_GEOM_SHADOW;
|
||||
static DeclareMemType MTYPE_PIPELINE_RENDER_SELECT;
|
||||
static DeclareMemType MTYPE_PIPELINE_REBUILD_POOLS;
|
||||
static DeclareMemType MTYPE_PIPELINE_QUICK_LOOKUP;
|
||||
static DeclareMemType MTYPE_PIPELINE_RENDER_OBJECTS;
|
||||
static DeclareMemType MTYPE_PIPELINE_GENERATE_IMPOSTOR;
|
||||
static DeclareMemType MTYPE_PIPELINE_RENDER_BLOOM;
|
||||
|
||||
static DeclareMemType MTYPE_UPKEEP_POOLS;
|
||||
|
||||
static DeclareMemType MTYPE_AVATAR;
|
||||
static DeclareMemType MTYPE_AVATAR_MESH;
|
||||
static DeclareMemType MTYPE_PARTICLES;
|
||||
static DeclareMemType MTYPE_REGIONS;
|
||||
|
||||
static DeclareMemType MTYPE_INVENTORY;
|
||||
static DeclareMemType MTYPE_INVENTORY_DRAW;
|
||||
static DeclareMemType MTYPE_INVENTORY_BUILD_NEW_VIEWS;
|
||||
static DeclareMemType MTYPE_INVENTORY_DO_FOLDER;
|
||||
static DeclareMemType MTYPE_INVENTORY_POST_BUILD;
|
||||
static DeclareMemType MTYPE_INVENTORY_FROM_XML;
|
||||
static DeclareMemType MTYPE_INVENTORY_CREATE_NEW_ITEM;
|
||||
static DeclareMemType MTYPE_INVENTORY_VIEW_INIT;
|
||||
static DeclareMemType MTYPE_INVENTORY_VIEW_SHOW;
|
||||
static DeclareMemType MTYPE_INVENTORY_VIEW_TOGGLE;
|
||||
|
||||
static DeclareMemType MTYPE_ANIMATION;
|
||||
static DeclareMemType MTYPE_VOLUME;
|
||||
static DeclareMemType MTYPE_PRIMITIVE;
|
||||
|
||||
static DeclareMemType MTYPE_SCRIPT;
|
||||
static DeclareMemType MTYPE_SCRIPT_RUN;
|
||||
static DeclareMemType MTYPE_SCRIPT_BYTECODE;
|
||||
|
||||
static DeclareMemType MTYPE_IO_PUMP;
|
||||
static DeclareMemType MTYPE_IO_TCP;
|
||||
static DeclareMemType MTYPE_IO_BUFFER;
|
||||
static DeclareMemType MTYPE_IO_HTTP_SERVER;
|
||||
static DeclareMemType MTYPE_IO_SD_SERVER;
|
||||
static DeclareMemType MTYPE_IO_SD_CLIENT;
|
||||
static DeclareMemType MTYPE_IO_URL_REQUEST;
|
||||
|
||||
static DeclareMemType MTYPE_DIRECTX_INIT;
|
||||
|
||||
static DeclareMemType MTYPE_TEMP1;
|
||||
static DeclareMemType MTYPE_TEMP2;
|
||||
static DeclareMemType MTYPE_TEMP3;
|
||||
static DeclareMemType MTYPE_TEMP4;
|
||||
static DeclareMemType MTYPE_TEMP5;
|
||||
static DeclareMemType MTYPE_TEMP6;
|
||||
static DeclareMemType MTYPE_TEMP7;
|
||||
static DeclareMemType MTYPE_TEMP8;
|
||||
static DeclareMemType MTYPE_TEMP9;
|
||||
|
||||
static DeclareMemType MTYPE_OTHER; // Special; used by display code
|
||||
|
||||
S32 mTypeIndex;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -27,294 +27,46 @@
|
|||
#ifndef LL_LLSTAT_H
|
||||
#define LL_LLSTAT_H
|
||||
|
||||
#include <deque>
|
||||
#include <map>
|
||||
|
||||
#include "lltimer.h"
|
||||
#include "llframetimer.h"
|
||||
#include "llfile.h"
|
||||
|
||||
class LLSD;
|
||||
|
||||
// Set this if longer stats are needed
|
||||
#define ENABLE_LONG_TIME_STATS 0
|
||||
|
||||
//
|
||||
// Accumulates statistics for an arbitrary length of time.
|
||||
// Does this by maintaining a chain of accumulators, each one
|
||||
// accumulation the results of the parent. Can scale to arbitrary
|
||||
// amounts of time with very low memory cost.
|
||||
//
|
||||
|
||||
class LL_COMMON_API LLStatAccum
|
||||
{
|
||||
protected:
|
||||
LLStatAccum(bool use_frame_timer);
|
||||
virtual ~LLStatAccum();
|
||||
|
||||
public:
|
||||
enum TimeScale {
|
||||
SCALE_100MS,
|
||||
SCALE_SECOND,
|
||||
SCALE_MINUTE,
|
||||
#if ENABLE_LONG_TIME_STATS
|
||||
SCALE_HOUR,
|
||||
SCALE_DAY,
|
||||
SCALE_WEEK,
|
||||
#endif
|
||||
NUM_SCALES, // Use to size storage arrays
|
||||
SCALE_PER_FRAME // For latest frame information - should be after NUM_SCALES since this doesn't go into the time buckets
|
||||
};
|
||||
|
||||
static U64 sScaleTimes[NUM_SCALES];
|
||||
|
||||
virtual F32 meanValue(TimeScale scale) const;
|
||||
// see the subclasses for the specific meaning of value
|
||||
|
||||
F32 meanValueOverLast100ms() const { return meanValue(SCALE_100MS); }
|
||||
F32 meanValueOverLastSecond() const { return meanValue(SCALE_SECOND); }
|
||||
F32 meanValueOverLastMinute() const { return meanValue(SCALE_MINUTE); }
|
||||
|
||||
void reset(U64 when);
|
||||
|
||||
void sum(F64 value);
|
||||
void sum(F64 value, U64 when);
|
||||
|
||||
U64 getCurrentUsecs() const;
|
||||
// Get current microseconds based on timer type
|
||||
|
||||
BOOL mUseFrameTimer;
|
||||
BOOL mRunning;
|
||||
|
||||
U64 mLastTime;
|
||||
|
||||
struct Bucket
|
||||
{
|
||||
Bucket() :
|
||||
accum(0.0),
|
||||
endTime(0),
|
||||
lastValid(false),
|
||||
lastAccum(0.0)
|
||||
{}
|
||||
|
||||
F64 accum;
|
||||
U64 endTime;
|
||||
|
||||
bool lastValid;
|
||||
F64 lastAccum;
|
||||
};
|
||||
|
||||
Bucket mBuckets[NUM_SCALES];
|
||||
|
||||
BOOL mLastSampleValid;
|
||||
F64 mLastSampleValue;
|
||||
};
|
||||
|
||||
class LL_COMMON_API LLStatMeasure : public LLStatAccum
|
||||
// gathers statistics about things that are measured
|
||||
// ex.: tempature, time dilation
|
||||
{
|
||||
public:
|
||||
LLStatMeasure(bool use_frame_timer = true);
|
||||
|
||||
void sample(F64);
|
||||
void sample(S32 v) { sample((F64)v); }
|
||||
void sample(U32 v) { sample((F64)v); }
|
||||
void sample(S64 v) { sample((F64)v); }
|
||||
void sample(U64 v) { sample((F64)v); }
|
||||
};
|
||||
|
||||
|
||||
class LL_COMMON_API LLStatRate : public LLStatAccum
|
||||
// gathers statistics about things that can be counted over time
|
||||
// ex.: LSL instructions executed, messages sent, simulator frames completed
|
||||
// renders it in terms of rate of thing per second
|
||||
{
|
||||
public:
|
||||
LLStatRate(bool use_frame_timer = true);
|
||||
|
||||
void count(U32);
|
||||
// used to note that n items have occured
|
||||
|
||||
void mark();
|
||||
// used for counting the rate thorugh a point in the code
|
||||
};
|
||||
|
||||
|
||||
class LL_COMMON_API LLStatTime : public LLStatAccum
|
||||
// gathers statistics about time spent in a block of code
|
||||
// measure average duration per second in the block
|
||||
{
|
||||
public:
|
||||
LLStatTime( const std::string & key = "undefined" );
|
||||
|
||||
U32 mFrameNumber; // Current frame number
|
||||
U64 mTotalTimeInFrame; // Total time (microseconds) accumulated during the last frame
|
||||
|
||||
void setKey( const std::string & key ) { mKey = key; };
|
||||
|
||||
virtual F32 meanValue(TimeScale scale) const;
|
||||
|
||||
private:
|
||||
void start(); // Start and stop measuring time block
|
||||
void stop();
|
||||
|
||||
std::string mKey; // Tag representing this time block
|
||||
|
||||
#if LL_DEBUG
|
||||
BOOL mRunning; // TRUE if start() has been called
|
||||
#endif
|
||||
|
||||
friend class LLPerfBlock;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Use this class on the stack to record statistics about an area of code
|
||||
class LL_COMMON_API LLPerfBlock
|
||||
{
|
||||
public:
|
||||
struct StatEntry
|
||||
{
|
||||
StatEntry(const std::string& key) : mStat(LLStatTime(key)), mCount(0) {}
|
||||
LLStatTime mStat;
|
||||
U32 mCount;
|
||||
};
|
||||
typedef std::map<std::string, StatEntry*> stat_map_t;
|
||||
|
||||
// Use this constructor for pre-defined LLStatTime objects
|
||||
LLPerfBlock(LLStatTime* stat);
|
||||
|
||||
// Use this constructor for normal, optional LLPerfBlock time slices
|
||||
LLPerfBlock( const char* key );
|
||||
|
||||
// Use this constructor for dynamically created LLPerfBlock time slices
|
||||
// that are only enabled by specific control flags
|
||||
LLPerfBlock( const char* key1, const char* key2, S32 flags = LLSTATS_BASIC_STATS );
|
||||
|
||||
~LLPerfBlock();
|
||||
|
||||
enum
|
||||
{ // Stats bitfield flags
|
||||
LLSTATS_NO_OPTIONAL_STATS = 0x00, // No optional stats gathering, just pre-defined LLStatTime objects
|
||||
LLSTATS_BASIC_STATS = 0x01, // Gather basic optional runtime stats
|
||||
LLSTATS_SCRIPT_FUNCTIONS = 0x02, // Include LSL function calls
|
||||
};
|
||||
static void setStatsFlags( S32 flags ) { sStatsFlags = flags; };
|
||||
static S32 getStatsFlags() { return sStatsFlags; };
|
||||
|
||||
static void clearDynamicStats(); // Reset maps to clear out dynamic objects
|
||||
static void addStatsToLLSDandReset( LLSD & stats, // Get current information and clear time bin
|
||||
LLStatAccum::TimeScale scale );
|
||||
|
||||
private:
|
||||
// Initialize dynamically created LLStatTime objects
|
||||
void initDynamicStat(const std::string& key);
|
||||
|
||||
std::string mLastPath; // Save sCurrentStatPath when this is called
|
||||
LLStatTime * mPredefinedStat; // LLStatTime object to get data
|
||||
StatEntry * mDynamicStat; // StatEntryobject to get data
|
||||
|
||||
static S32 sStatsFlags; // Control what is being recorded
|
||||
static stat_map_t sStatMap; // Map full path string to LLStatTime objects
|
||||
static std::string sCurrentStatPath; // Something like "frame/physics/physics step"
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class LL_COMMON_API LLPerfStats
|
||||
{
|
||||
public:
|
||||
LLPerfStats(const std::string& process_name = "unknown", S32 process_pid = 0);
|
||||
virtual ~LLPerfStats();
|
||||
|
||||
virtual void init(); // Reset and start all stat timers
|
||||
virtual void updatePerFrameStats();
|
||||
// Override these function to add process-specific information to the performance log header and per-frame logging.
|
||||
virtual void addProcessHeaderInfo(LLSD& info) { /* not implemented */ }
|
||||
virtual void addProcessFrameInfo(LLSD& info, LLStatAccum::TimeScale scale) { /* not implemented */ }
|
||||
|
||||
// High-resolution frame stats
|
||||
BOOL frameStatsIsRunning() { return (mReportPerformanceStatEnd > 0.); };
|
||||
F32 getReportPerformanceInterval() const { return mReportPerformanceStatInterval; };
|
||||
void setReportPerformanceInterval( F32 interval ) { mReportPerformanceStatInterval = interval; };
|
||||
void setReportPerformanceDuration( F32 seconds, S32 flags = LLPerfBlock::LLSTATS_NO_OPTIONAL_STATS );
|
||||
void setProcessName(const std::string& process_name) { mProcessName = process_name; }
|
||||
void setProcessPID(S32 process_pid) { mProcessPID = process_pid; }
|
||||
|
||||
protected:
|
||||
void openPerfStatsFile(); // Open file for high resolution metrics logging
|
||||
void dumpIntervalPerformanceStats();
|
||||
|
||||
llofstream mFrameStatsFile; // File for per-frame stats
|
||||
BOOL mFrameStatsFileFailure; // Flag to prevent repeat opening attempts
|
||||
BOOL mSkipFirstFrameStats; // Flag to skip one (partial) frame report
|
||||
std::string mProcessName;
|
||||
S32 mProcessPID;
|
||||
|
||||
private:
|
||||
F32 mReportPerformanceStatInterval; // Seconds between performance stats
|
||||
F64 mReportPerformanceStatEnd; // End time (seconds) for performance stats
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
class LL_COMMON_API LLStat
|
||||
{
|
||||
private:
|
||||
typedef std::multimap<std::string, LLStat*> stat_map_t;
|
||||
|
||||
void init();
|
||||
static stat_map_t& getStatList();
|
||||
|
||||
public:
|
||||
LLStat(U32 num_bins = 32, BOOL use_frame_timer = FALSE);
|
||||
LLStat(std::string name, U32 num_bins = 32, BOOL use_frame_timer = FALSE);
|
||||
LLStat(std::string name = std::string(), S32 num_bins = 32, BOOL use_frame_timer = FALSE);
|
||||
~LLStat();
|
||||
|
||||
void reset();
|
||||
|
||||
void start(); // Start the timer for the current "frame", otherwise uses the time tracked from
|
||||
// the last addValue
|
||||
void reset();
|
||||
void addValue(const F32 value = 1.f); // Adds the current value being tracked, and tracks the DT.
|
||||
void addValue(const S32 value) { addValue((F32)value); }
|
||||
void addValue(const U32 value) { addValue((F32)value); }
|
||||
|
||||
void setBeginTime(const F64 time);
|
||||
void addValueTime(const F64 time, const F32 value = 1.f);
|
||||
|
||||
S32 getCurBin() const;
|
||||
S32 getNextBin() const;
|
||||
|
||||
F32 getCurrent() const;
|
||||
F32 getCurrentPerSec() const;
|
||||
F64 getCurrentBeginTime() const;
|
||||
F64 getCurrentTime() const;
|
||||
F32 getCurrentDuration() const;
|
||||
|
||||
F32 getPrev(S32 age) const; // Age is how many "addValues" previously - zero is current
|
||||
F32 getPrevPerSec(S32 age) const; // Age is how many "addValues" previously - zero is current
|
||||
F64 getPrevBeginTime(S32 age) const;
|
||||
F64 getPrevTime(S32 age) const;
|
||||
|
||||
F32 getBin(S32 bin) const;
|
||||
F32 getBinPerSec(S32 bin) const;
|
||||
F64 getBinBeginTime(S32 bin) const;
|
||||
F64 getBinTime(S32 bin) const;
|
||||
|
||||
F32 getMax() const;
|
||||
F32 getMaxPerSec() const;
|
||||
F32 getCurrent() const;
|
||||
F32 getCurrentPerSec() const;
|
||||
|
||||
F32 getMin() const;
|
||||
F32 getMinPerSec() const;
|
||||
F32 getMean() const;
|
||||
F32 getMeanPerSec() const;
|
||||
F32 getMeanDuration() const;
|
||||
|
||||
F32 getMin() const;
|
||||
F32 getMinPerSec() const;
|
||||
F32 getMinDuration() const;
|
||||
|
||||
F32 getSum() const;
|
||||
F32 getSumDuration() const;
|
||||
F32 getMax() const;
|
||||
F32 getMaxPerSec() const;
|
||||
|
||||
U32 getNumValues() const;
|
||||
S32 getNumBins() const;
|
||||
|
|
@ -326,10 +78,21 @@ private:
|
|||
U32 mNumBins;
|
||||
F32 mLastValue;
|
||||
F64 mLastTime;
|
||||
F32 *mBins;
|
||||
F64 *mBeginTime;
|
||||
F64 *mTime;
|
||||
F32 *mDT;
|
||||
|
||||
struct ValueEntry
|
||||
{
|
||||
ValueEntry()
|
||||
: mValue(0.f),
|
||||
mBeginTime(0.0),
|
||||
mTime(0.0),
|
||||
mDT(0.f)
|
||||
{}
|
||||
F32 mValue;
|
||||
F64 mBeginTime;
|
||||
F64 mTime;
|
||||
F32 mDT;
|
||||
};
|
||||
ValueEntry* mBins;
|
||||
S32 mCurBin;
|
||||
S32 mNextBin;
|
||||
|
||||
|
|
|
|||
|
|
@ -44,10 +44,16 @@
|
|||
#include "llmd5.h"
|
||||
#include "llstring.h"
|
||||
#include "lltimer.h"
|
||||
#include "llthread.h"
|
||||
|
||||
const LLUUID LLUUID::null;
|
||||
const LLTransactionID LLTransactionID::tnull;
|
||||
|
||||
// static
|
||||
LLMutex * LLUUID::mMutex = NULL;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
NOT DONE YET!!!
|
||||
|
|
@ -734,6 +740,7 @@ void LLUUID::getCurrentTime(uuid_time_t *timestamp)
|
|||
getSystemTime(&time_last);
|
||||
uuids_this_tick = uuids_per_tick;
|
||||
init = TRUE;
|
||||
mMutex = new LLMutex(NULL);
|
||||
}
|
||||
|
||||
uuid_time_t time_now = {0,0};
|
||||
|
|
@ -785,6 +792,7 @@ void LLUUID::generate()
|
|||
#endif
|
||||
if (!has_init)
|
||||
{
|
||||
has_init = 1;
|
||||
if (getNodeID(node_id) <= 0)
|
||||
{
|
||||
get_random_bytes(node_id, 6);
|
||||
|
|
@ -806,18 +814,24 @@ void LLUUID::generate()
|
|||
#else
|
||||
clock_seq = (U16)ll_rand(65536);
|
||||
#endif
|
||||
has_init = 1;
|
||||
}
|
||||
|
||||
// get current time
|
||||
getCurrentTime(×tamp);
|
||||
U16 our_clock_seq = clock_seq;
|
||||
|
||||
// if clock went backward change clockseq
|
||||
if (cmpTime(×tamp, &time_last) == -1) {
|
||||
// if clock hasn't changed or went backward, change clockseq
|
||||
if (cmpTime(×tamp, &time_last) != 1)
|
||||
{
|
||||
LLMutexLock lock(mMutex);
|
||||
clock_seq = (clock_seq + 1) & 0x3FFF;
|
||||
if (clock_seq == 0) clock_seq++;
|
||||
if (clock_seq == 0)
|
||||
clock_seq++;
|
||||
our_clock_seq = clock_seq; // Ensure we're using a different clock_seq value from previous time
|
||||
}
|
||||
|
||||
time_last = timestamp;
|
||||
|
||||
memcpy(mData+10, node_id, 6); /* Flawfinder: ignore */
|
||||
U32 tmp;
|
||||
tmp = timestamp.low;
|
||||
|
|
@ -839,7 +853,8 @@ void LLUUID::generate()
|
|||
tmp >>= 8;
|
||||
mData[6] = (unsigned char) tmp;
|
||||
|
||||
tmp = clock_seq;
|
||||
tmp = our_clock_seq;
|
||||
|
||||
mData[9] = (unsigned char) tmp;
|
||||
tmp >>= 8;
|
||||
mData[8] = (unsigned char) tmp;
|
||||
|
|
@ -849,8 +864,6 @@ void LLUUID::generate()
|
|||
md5_uuid.update(mData,16);
|
||||
md5_uuid.finalize();
|
||||
md5_uuid.raw_digest(mData);
|
||||
|
||||
time_last = timestamp;
|
||||
}
|
||||
|
||||
void LLUUID::generate(const std::string& hash_string)
|
||||
|
|
@ -864,8 +877,14 @@ U32 LLUUID::getRandomSeed()
|
|||
static unsigned char seed[16]; /* Flawfinder: ignore */
|
||||
|
||||
getNodeID(&seed[0]);
|
||||
seed[6]='\0';
|
||||
seed[7]='\0';
|
||||
|
||||
// Incorporate the pid into the seed to prevent
|
||||
// processes that start on the same host at the same
|
||||
// time from generating the same seed.
|
||||
pid_t pid = LLApp::getPid();
|
||||
|
||||
seed[6]=(unsigned char)(pid >> 8);
|
||||
seed[7]=(unsigned char)(pid);
|
||||
getSystemTime((uuid_time_t *)(&seed[8]));
|
||||
|
||||
LLMD5 md5_seed;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@
|
|||
#include "stdtypes.h"
|
||||
#include "llpreprocessor.h"
|
||||
|
||||
class LLMutex;
|
||||
|
||||
const S32 UUID_BYTES = 16;
|
||||
const S32 UUID_WORDS = 4;
|
||||
const S32 UUID_STR_LENGTH = 37; // actually wrong, should be 36 and use size below
|
||||
|
|
@ -118,6 +120,7 @@ public:
|
|||
static BOOL validate(const std::string& in_string); // Validate that the UUID string is legal.
|
||||
|
||||
static const LLUUID null;
|
||||
static LLMutex * mMutex;
|
||||
|
||||
static U32 getRandomSeed();
|
||||
static S32 getNodeID(unsigned char * node_id);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
const S32 LL_VERSION_MAJOR = 3;
|
||||
const S32 LL_VERSION_MINOR = 4;
|
||||
const S32 LL_VERSION_PATCH = 4;
|
||||
const S32 LL_VERSION_PATCH = 5;
|
||||
const S32 LL_VERSION_BUILD = 0;
|
||||
|
||||
const char * const LL_CHANNEL = "Second Life Developer";
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "llmath.h"
|
||||
#include "v4coloru.h"
|
||||
#include "llmemtype.h"
|
||||
|
||||
#include "llimagebmp.h"
|
||||
#include "llimagetga.h"
|
||||
|
|
@ -96,8 +95,7 @@ LLImageBase::LLImageBase()
|
|||
mHeight(0),
|
||||
mComponents(0),
|
||||
mBadBufferAllocation(false),
|
||||
mAllowOverSize(false),
|
||||
mMemType(LLMemType::MTYPE_IMAGEBASE)
|
||||
mAllowOverSize(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -167,8 +165,6 @@ void LLImageBase::deleteData()
|
|||
// virtual
|
||||
U8* LLImageBase::allocateData(S32 size)
|
||||
{
|
||||
LLMemType mt1(mMemType);
|
||||
|
||||
if (size < 0)
|
||||
{
|
||||
size = mWidth * mHeight * mComponents;
|
||||
|
|
@ -213,7 +209,6 @@ U8* LLImageBase::allocateData(S32 size)
|
|||
// virtual
|
||||
U8* LLImageBase::reallocateData(S32 size)
|
||||
{
|
||||
LLMemType mt1(mMemType);
|
||||
U8 *new_datap = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
|
||||
if (!new_datap)
|
||||
{
|
||||
|
|
@ -279,14 +274,12 @@ S32 LLImageRaw::sRawImageCount = 0;
|
|||
LLImageRaw::LLImageRaw()
|
||||
: LLImageBase()
|
||||
{
|
||||
mMemType = LLMemType::MTYPE_IMAGERAW;
|
||||
++sRawImageCount;
|
||||
}
|
||||
|
||||
LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components)
|
||||
: LLImageBase()
|
||||
{
|
||||
mMemType = LLMemType::MTYPE_IMAGERAW;
|
||||
//llassert( S32(width) * S32(height) * S32(components) <= MAX_IMAGE_DATA_SIZE );
|
||||
allocateDataSize(width, height, components);
|
||||
++sRawImageCount;
|
||||
|
|
@ -295,7 +288,6 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components)
|
|||
LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_copy)
|
||||
: LLImageBase()
|
||||
{
|
||||
mMemType = LLMemType::MTYPE_IMAGERAW;
|
||||
|
||||
if(no_copy)
|
||||
{
|
||||
|
|
@ -375,29 +367,6 @@ BOOL LLImageRaw::resize(U16 width, U16 height, S8 components)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
U8 * LLImageRaw::getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const
|
||||
{
|
||||
LLMemType mt1(mMemType);
|
||||
U8 *data = new U8[width*height*getComponents()];
|
||||
|
||||
// Should do some simple bounds checking
|
||||
if (!data)
|
||||
{
|
||||
llerrs << "Out of memory in LLImageRaw::getSubImage" << llendl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
U32 i;
|
||||
for (i = y_pos; i < y_pos+height; i++)
|
||||
{
|
||||
memcpy(data + i*width*getComponents(), /* Flawfinder: ignore */
|
||||
getData() + ((y_pos + i)*getWidth() + x_pos)*getComponents(), getComponents()*width);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL LLImageRaw::setSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height,
|
||||
const U8 *data, U32 stride, BOOL reverse_y)
|
||||
{
|
||||
|
|
@ -462,7 +431,6 @@ void LLImageRaw::clear(U8 r, U8 g, U8 b, U8 a)
|
|||
// Reverses the order of the rows in the image
|
||||
void LLImageRaw::verticalFlip()
|
||||
{
|
||||
LLMemType mt1(mMemType);
|
||||
S32 row_bytes = getWidth() * getComponents();
|
||||
llassert(row_bytes > 0);
|
||||
std::vector<U8> line_buffer(row_bytes);
|
||||
|
|
@ -595,7 +563,6 @@ void LLImageRaw::composite( LLImageRaw* src )
|
|||
// Src and dst can be any size. Src has 4 components. Dst has 3 components.
|
||||
void LLImageRaw::compositeScaled4onto3(LLImageRaw* src)
|
||||
{
|
||||
LLMemType mt1(mMemType);
|
||||
llinfos << "compositeScaled4onto3" << llendl;
|
||||
|
||||
LLImageRaw* dst = this; // Just for clarity.
|
||||
|
|
@ -837,7 +804,6 @@ void LLImageRaw::copyUnscaled3onto4( LLImageRaw* src )
|
|||
// Src and dst can be any size. Src and dst have same number of components.
|
||||
void LLImageRaw::copyScaled( LLImageRaw* src )
|
||||
{
|
||||
LLMemType mt1(mMemType);
|
||||
LLImageRaw* dst = this; // Just for clarity.
|
||||
|
||||
llassert_always( (1 == src->getComponents()) || (3 == src->getComponents()) || (4 == src->getComponents()) );
|
||||
|
|
@ -866,57 +832,9 @@ void LLImageRaw::copyScaled( LLImageRaw* src )
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
//scale down image by not blending a pixel with its neighbors.
|
||||
BOOL LLImageRaw::scaleDownWithoutBlending( S32 new_width, S32 new_height)
|
||||
{
|
||||
LLMemType mt1(mMemType);
|
||||
|
||||
S8 c = getComponents() ;
|
||||
llassert((1 == c) || (3 == c) || (4 == c) );
|
||||
|
||||
S32 old_width = getWidth();
|
||||
S32 old_height = getHeight();
|
||||
|
||||
S32 new_data_size = old_width * new_height * c ;
|
||||
llassert_always(new_data_size > 0);
|
||||
|
||||
F32 ratio_x = (F32)old_width / new_width ;
|
||||
F32 ratio_y = (F32)old_height / new_height ;
|
||||
if( ratio_x < 1.0f || ratio_y < 1.0f )
|
||||
{
|
||||
return TRUE; // Nothing to do.
|
||||
}
|
||||
ratio_x -= 1.0f ;
|
||||
ratio_y -= 1.0f ;
|
||||
|
||||
U8* new_data = allocateMemory(new_data_size) ;
|
||||
llassert_always(new_data != NULL) ;
|
||||
|
||||
U8* old_data = getData() ;
|
||||
S32 i, j, k, s, t;
|
||||
for(i = 0, s = 0, t = 0 ; i < new_height ; i++)
|
||||
{
|
||||
for(j = 0 ; j < new_width ; j++)
|
||||
{
|
||||
for(k = 0 ; k < c ; k++)
|
||||
{
|
||||
new_data[s++] = old_data[t++] ;
|
||||
}
|
||||
t += (S32)(ratio_x * c + 0.1f) ;
|
||||
}
|
||||
t += (S32)(ratio_y * old_width * c + 0.1f) ;
|
||||
}
|
||||
|
||||
setDataAndSize(new_data, new_width, new_height, c) ;
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )
|
||||
{
|
||||
LLMemType mt1(mMemType);
|
||||
llassert((1 == getComponents()) || (3 == getComponents()) || (4 == getComponents()) );
|
||||
|
||||
S32 old_width = getWidth();
|
||||
|
|
@ -1346,7 +1264,6 @@ LLImageFormatted::LLImageFormatted(S8 codec)
|
|||
mDiscardLevel(-1),
|
||||
mLevels(0)
|
||||
{
|
||||
mMemType = LLMemType::MTYPE_IMAGEFORMATTED;
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include "lluuid.h"
|
||||
#include "llstring.h"
|
||||
#include "llthread.h"
|
||||
#include "llmemtype.h"
|
||||
|
||||
const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2
|
||||
const S32 MAX_IMAGE_MIP = 11; // 2048x2048
|
||||
|
|
@ -176,8 +175,6 @@ private:
|
|||
bool mAllowOverSize ;
|
||||
|
||||
static LLPrivateMemoryPool* sPrivatePoolp ;
|
||||
public:
|
||||
LLMemType::DeclareMemType& mMemType; // debug
|
||||
};
|
||||
|
||||
// Raw representation of an image (used for textures, and other uncompressed formats
|
||||
|
|
@ -211,8 +208,7 @@ public:
|
|||
void contractToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE, BOOL scale_image = TRUE);
|
||||
void biasedScaleToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE);
|
||||
BOOL scale( S32 new_width, S32 new_height, BOOL scale_image = TRUE );
|
||||
//BOOL scaleDownWithoutBlending( S32 new_width, S32 new_height) ;
|
||||
|
||||
|
||||
// Fill the buffer with a constant color
|
||||
void fill( const LLColor4U& color );
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "lldir.h"
|
||||
#include "llimagej2c.h"
|
||||
#include "llmemtype.h"
|
||||
#include "lltimer.h"
|
||||
#include "llmath.h"
|
||||
#include "llmemory.h"
|
||||
|
|
@ -161,7 +160,6 @@ BOOL LLImageJ2C::decode(LLImageRaw *raw_imagep, F32 decode_time)
|
|||
BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count )
|
||||
{
|
||||
LLTimer elapsed;
|
||||
LLMemType mt1(mMemType);
|
||||
|
||||
BOOL res = TRUE;
|
||||
|
||||
|
|
@ -227,7 +225,6 @@ BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, F32 encode_time)
|
|||
BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, const char* comment_text, F32 encode_time)
|
||||
{
|
||||
LLTimer elapsed;
|
||||
LLMemType mt1(mMemType);
|
||||
resetLastError();
|
||||
BOOL res = mImpl->encodeImpl(*this, *raw_imagep, comment_text, encode_time, mReversible);
|
||||
if (!mLastError.empty())
|
||||
|
|
@ -404,7 +401,6 @@ BOOL LLImageJ2C::loadAndValidate(const std::string &filename)
|
|||
|
||||
BOOL LLImageJ2C::validate(U8 *data, U32 file_size)
|
||||
{
|
||||
LLMemType mt1(mMemType);
|
||||
|
||||
resetLastError();
|
||||
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ mWidth(0),
|
|||
mHeight(0),
|
||||
mComponents(0),
|
||||
mBadBufferAllocation(false),
|
||||
mAllowOverSize(false),
|
||||
mMemType(LLMemType::MTYPE_IMAGEBASE)
|
||||
mAllowOverSize(false)
|
||||
{
|
||||
}
|
||||
LLImageBase::~LLImageBase() {}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include "lldarray.h"
|
||||
#include "llfoldertype.h"
|
||||
#include "llinventorytype.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llpermissions.h"
|
||||
#include "llrefcount.h"
|
||||
#include "llsaleinfo.h"
|
||||
|
|
@ -54,7 +53,6 @@ public:
|
|||
// Initialization
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
MEM_TYPE_NEW(LLMemType::MTYPE_INVENTORY);
|
||||
LLInventoryObject();
|
||||
LLInventoryObject(const LLUUID& uuid,
|
||||
const LLUUID& parent_uuid,
|
||||
|
|
@ -129,7 +127,6 @@ public:
|
|||
// Initialization
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
MEM_TYPE_NEW(LLMemType::MTYPE_INVENTORY);
|
||||
LLInventoryItem(const LLUUID& uuid,
|
||||
const LLUUID& parent_uuid,
|
||||
const LLPermissions& permissions,
|
||||
|
|
@ -242,7 +239,6 @@ public:
|
|||
// Initialization
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
MEM_TYPE_NEW(LLMemType::MTYPE_INVENTORY);
|
||||
LLInventoryCategory(const LLUUID& uuid, const LLUUID& parent_uuid,
|
||||
LLFolderType::EType preferred_type,
|
||||
const std::string& name);
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ void LLParcel::init(const LLUUID &owner_id,
|
|||
mAABBMin.setVec(SOME_BIG_NUMBER, SOME_BIG_NUMBER, SOME_BIG_NUMBER);
|
||||
mAABBMax.setVec(SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER);
|
||||
|
||||
mLocalID = 0;
|
||||
mLocalID = INVALID_PARCEL_ID;
|
||||
|
||||
//mSimWidePrimCorrection = 0;
|
||||
setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS)));
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ const U32 RT_OTHER = 0x1 << 3;
|
|||
const U32 RT_LIST = 0x1 << 4;
|
||||
const U32 RT_SELL = 0x1 << 5;
|
||||
|
||||
const S32 INVALID_PARCEL_ID = -1;
|
||||
|
||||
// Timeouts for parcels
|
||||
// default is 21 days * 24h/d * 60m/h * 60s/m *1000000 usec/s = 1814400000000
|
||||
|
|
|
|||
|
|
@ -58,8 +58,7 @@ mWidth(0),
|
|||
mHeight(0),
|
||||
mComponents(0),
|
||||
mBadBufferAllocation(false),
|
||||
mAllowOverSize(false),
|
||||
mMemType(LLMemType::MTYPE_IMAGEBASE)
|
||||
mAllowOverSize(false)
|
||||
{ }
|
||||
LLImageBase::~LLImageBase() { }
|
||||
U8* LLImageBase::allocateData(S32 ) { return NULL; }
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public:
|
|||
|
||||
typedef LLOctreeTraveler<T> oct_traveler;
|
||||
typedef LLTreeTraveler<T> tree_traveler;
|
||||
typedef std::vector<LLPointer<T> > element_list;
|
||||
typedef std::vector< LLPointer<T> > element_list; // note: don't remove the whitespace between "> >"
|
||||
typedef LLPointer<T>* element_iter;
|
||||
typedef const LLPointer<T>* const_element_iter;
|
||||
typedef typename std::vector<LLTreeListener<T>*>::iterator tree_listener_iter;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <cmath>
|
||||
|
||||
#include "llerror.h"
|
||||
#include "llmemtype.h"
|
||||
|
||||
#include "llvolumemgr.h"
|
||||
#include "v2math.h"
|
||||
|
|
@ -378,8 +377,6 @@ public:
|
|||
|
||||
LLProfile::Face* LLProfile::addCap(S16 faceID)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
Face *face = vector_append(mFaces, 1);
|
||||
|
||||
face->mIndex = 0;
|
||||
|
|
@ -392,8 +389,6 @@ LLProfile::Face* LLProfile::addCap(S16 faceID)
|
|||
|
||||
LLProfile::Face* LLProfile::addFace(S32 i, S32 count, F32 scaleU, S16 faceID, BOOL flat)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
Face *face = vector_append(mFaces, 1);
|
||||
|
||||
face->mIndex = i;
|
||||
|
|
@ -409,7 +404,6 @@ LLProfile::Face* LLProfile::addFace(S32 i, S32 count, F32 scaleU, S16 faceID, BO
|
|||
//static
|
||||
S32 LLProfile::getNumNGonPoints(const LLProfileParams& params, S32 sides, F32 offset, F32 bevel, F32 ang_scale, S32 split)
|
||||
{ // this is basically LLProfile::genNGon stripped down to only the operations that influence the number of points
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
S32 np = 0;
|
||||
|
||||
// Generate an n-sided "circular" path.
|
||||
|
|
@ -475,8 +469,6 @@ S32 LLProfile::getNumNGonPoints(const LLProfileParams& params, S32 sides, F32 of
|
|||
// filleted and chamfered corners
|
||||
void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F32 bevel, F32 ang_scale, S32 split)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
// Generate an n-sided "circular" path.
|
||||
// 0 is (1,0), and we go counter-clockwise along a circular path from there.
|
||||
const F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f };
|
||||
|
|
@ -730,8 +722,6 @@ LLProfile::Face* LLProfile::addHole(const LLProfileParams& params, BOOL flat, F3
|
|||
S32 LLProfile::getNumPoints(const LLProfileParams& params, BOOL path_open,F32 detail, S32 split,
|
||||
BOOL is_sculpted, S32 sculpt_size)
|
||||
{ // this is basically LLProfile::generate stripped down to only operations that influence the number of points
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
if (detail < MIN_LOD)
|
||||
{
|
||||
detail = MIN_LOD;
|
||||
|
|
@ -842,8 +832,6 @@ S32 LLProfile::getNumPoints(const LLProfileParams& params, BOOL path_open,F32 de
|
|||
BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detail, S32 split,
|
||||
BOOL is_sculpted, S32 sculpt_size)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
if ((!mDirty) && (!is_sculpted))
|
||||
{
|
||||
return FALSE;
|
||||
|
|
@ -1116,8 +1104,6 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai
|
|||
|
||||
BOOL LLProfileParams::importFile(LLFILE *fp)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
const S32 BUFSIZE = 16384;
|
||||
char buffer[BUFSIZE]; /* Flawfinder: ignore */
|
||||
// *NOTE: changing the size or type of these buffers will require
|
||||
|
|
@ -1193,8 +1179,6 @@ BOOL LLProfileParams::exportFile(LLFILE *fp) const
|
|||
|
||||
BOOL LLProfileParams::importLegacyStream(std::istream& input_stream)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
const S32 BUFSIZE = 16384;
|
||||
char buffer[BUFSIZE]; /* Flawfinder: ignore */
|
||||
// *NOTE: changing the size or type of these buffers will require
|
||||
|
|
@ -1286,7 +1270,6 @@ bool LLProfileParams::fromLLSD(LLSD& sd)
|
|||
|
||||
void LLProfileParams::copyParams(const LLProfileParams ¶ms)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
setCurveType(params.getCurveType());
|
||||
setBegin(params.getBegin());
|
||||
setEnd(params.getEnd());
|
||||
|
|
@ -1503,8 +1486,6 @@ const LLVector2 LLPathParams::getEndScale() const
|
|||
|
||||
S32 LLPath::getNumPoints(const LLPathParams& params, F32 detail)
|
||||
{ // this is basically LLPath::generate stripped down to only the operations that influence the number of points
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
if (detail < MIN_LOD)
|
||||
{
|
||||
detail = MIN_LOD;
|
||||
|
|
@ -1554,8 +1535,6 @@ S32 LLPath::getNumPoints(const LLPathParams& params, F32 detail)
|
|||
BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
|
||||
BOOL is_sculpted, S32 sculpt_size)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
if ((!mDirty) && (!is_sculpted))
|
||||
{
|
||||
return FALSE;
|
||||
|
|
@ -1683,8 +1662,6 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
|
|||
BOOL LLDynamicPath::generate(const LLPathParams& params, F32 detail, S32 split,
|
||||
BOOL is_sculpted, S32 sculpt_size)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
mOpen = TRUE; // Draw end caps
|
||||
if (getPathLength() == 0)
|
||||
{
|
||||
|
|
@ -1706,8 +1683,6 @@ BOOL LLDynamicPath::generate(const LLPathParams& params, F32 detail, S32 split,
|
|||
|
||||
BOOL LLPathParams::importFile(LLFILE *fp)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
const S32 BUFSIZE = 16384;
|
||||
char buffer[BUFSIZE]; /* Flawfinder: ignore */
|
||||
// *NOTE: changing the size or type of these buffers will require
|
||||
|
|
@ -1852,8 +1827,6 @@ BOOL LLPathParams::exportFile(LLFILE *fp) const
|
|||
|
||||
BOOL LLPathParams::importLegacyStream(std::istream& input_stream)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
const S32 BUFSIZE = 16384;
|
||||
char buffer[BUFSIZE]; /* Flawfinder: ignore */
|
||||
// *NOTE: changing the size or type of these buffers will require
|
||||
|
|
@ -2061,8 +2034,6 @@ S32 LLVolume::sNumMeshPoints = 0;
|
|||
LLVolume::LLVolume(const LLVolumeParams ¶ms, const F32 detail, const BOOL generate_single_face, const BOOL is_unique)
|
||||
: mParams(params)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
mUnique = is_unique;
|
||||
mFaceMask = 0x0;
|
||||
mDetail = detail;
|
||||
|
|
@ -2134,7 +2105,6 @@ LLVolume::~LLVolume()
|
|||
|
||||
BOOL LLVolume::generate()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
llassert_always(mProfilep);
|
||||
|
||||
//Added 10.03.05 Dave Parks
|
||||
|
|
@ -2730,8 +2700,6 @@ S32 LLVolume::getNumFaces() const
|
|||
|
||||
void LLVolume::createVolumeFaces()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
if (mGenerateSingleFace)
|
||||
{
|
||||
// do nothing
|
||||
|
|
@ -2903,8 +2871,6 @@ F32 LLVolume::sculptGetSurfaceArea()
|
|||
// create placeholder shape
|
||||
void LLVolume::sculptGeneratePlaceholder()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
S32 sizeS = mPathp->mPath.size();
|
||||
S32 sizeT = mProfilep->mProfile.size();
|
||||
|
||||
|
|
@ -2941,9 +2907,6 @@ void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8
|
|||
BOOL sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR;
|
||||
BOOL reverse_horizontal = (sculpt_invert ? !sculpt_mirror : sculpt_mirror); // XOR
|
||||
|
||||
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
S32 sizeS = mPathp->mPath.size();
|
||||
S32 sizeT = mProfilep->mProfile.size();
|
||||
|
||||
|
|
@ -3092,7 +3055,6 @@ void sculpt_calc_mesh_resolution(U16 width, U16 height, U8 type, F32 detail, S32
|
|||
// sculpt replaces generate() for sculpted surfaces
|
||||
void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
U8 sculpt_type = mParams.getSculptType();
|
||||
|
||||
BOOL data_is_empty = FALSE;
|
||||
|
|
@ -3229,7 +3191,6 @@ bool LLVolumeParams::operator<(const LLVolumeParams ¶ms) const
|
|||
|
||||
void LLVolumeParams::copyParams(const LLVolumeParams ¶ms)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
mProfileParams.copyParams(params.mProfileParams);
|
||||
mPathParams.copyParams(params.mPathParams);
|
||||
mSculptID = params.getSculptID();
|
||||
|
|
@ -3601,8 +3562,6 @@ bool LLVolumeParams::validate(U8 prof_curve, F32 prof_begin, F32 prof_end, F32 h
|
|||
|
||||
S32 *LLVolume::getTriangleIndices(U32 &num_indices) const
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
S32 expected_num_triangle_indices = getNumTriangleIndices();
|
||||
if (expected_num_triangle_indices > MAX_VOLUME_TRIANGLE_INDICES)
|
||||
{
|
||||
|
|
@ -4330,8 +4289,6 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices,
|
|||
const LLMatrix3& norm_mat_in,
|
||||
S32 face_mask)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
LLMatrix4a mat;
|
||||
mat.loadu(mat_in);
|
||||
|
||||
|
|
@ -4793,241 +4750,8 @@ BOOL equalTriangle(const S32 *a, const S32 *b)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL LLVolume::cleanupTriangleData( const S32 num_input_vertices,
|
||||
const std::vector<Point>& input_vertices,
|
||||
const S32 num_input_triangles,
|
||||
S32 *input_triangles,
|
||||
S32 &num_output_vertices,
|
||||
LLVector3 **output_vertices,
|
||||
S32 &num_output_triangles,
|
||||
S32 **output_triangles)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
/* Testing: avoid any cleanup
|
||||
static BOOL skip_cleanup = TRUE;
|
||||
if ( skip_cleanup )
|
||||
{
|
||||
num_output_vertices = num_input_vertices;
|
||||
num_output_triangles = num_input_triangles;
|
||||
|
||||
*output_vertices = new LLVector3[num_input_vertices];
|
||||
for (S32 index = 0; index < num_input_vertices; index++)
|
||||
{
|
||||
(*output_vertices)[index] = input_vertices[index].mPos;
|
||||
}
|
||||
|
||||
*output_triangles = new S32[num_input_triangles*3];
|
||||
memcpy(*output_triangles, input_triangles, 3*num_input_triangles*sizeof(S32)); // Flawfinder: ignore
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
|
||||
// Here's how we do this:
|
||||
// Create a structure which contains the original vertex index and the
|
||||
// LLVector3 data.
|
||||
// "Sort" the data by the vectors
|
||||
// Create an array the size of the old vertex list, with a mapping of
|
||||
// old indices to new indices.
|
||||
// Go through triangles, shift so the lowest index is first
|
||||
// Sort triangles by first index
|
||||
// Remove duplicate triangles
|
||||
// Allocate and pack new triangle data.
|
||||
|
||||
//LLTimer cleanupTimer;
|
||||
//llinfos << "In vertices: " << num_input_vertices << llendl;
|
||||
//llinfos << "In triangles: " << num_input_triangles << llendl;
|
||||
|
||||
S32 i;
|
||||
typedef std::multiset<LLVertexIndexPair*, lessVertex> vertex_set_t;
|
||||
vertex_set_t vertex_list;
|
||||
|
||||
LLVertexIndexPair *pairp = NULL;
|
||||
for (i = 0; i < num_input_vertices; i++)
|
||||
{
|
||||
LLVertexIndexPair *new_pairp = new LLVertexIndexPair(input_vertices[i].mPos, i);
|
||||
vertex_list.insert(new_pairp);
|
||||
}
|
||||
|
||||
// Generate the vertex mapping and the list of vertices without
|
||||
// duplicates. This will crash if there are no vertices.
|
||||
llassert(num_input_vertices > 0); // check for no vertices!
|
||||
S32 *vertex_mapping = new S32[num_input_vertices];
|
||||
LLVector3 *new_vertices = new LLVector3[num_input_vertices];
|
||||
LLVertexIndexPair *prev_pairp = NULL;
|
||||
|
||||
S32 new_num_vertices;
|
||||
|
||||
new_num_vertices = 0;
|
||||
for (vertex_set_t::iterator iter = vertex_list.begin(),
|
||||
end = vertex_list.end();
|
||||
iter != end; iter++)
|
||||
{
|
||||
pairp = *iter;
|
||||
if (!prev_pairp || ((pairp->mVertex - prev_pairp->mVertex).magVecSquared() >= VERTEX_SLOP_SQRD))
|
||||
{
|
||||
new_vertices[new_num_vertices] = pairp->mVertex;
|
||||
//llinfos << "Added vertex " << new_num_vertices << " : " << pairp->mVertex << llendl;
|
||||
new_num_vertices++;
|
||||
// Update the previous
|
||||
prev_pairp = pairp;
|
||||
}
|
||||
else
|
||||
{
|
||||
//llinfos << "Removed duplicate vertex " << pairp->mVertex << ", distance magVecSquared() is " << (pairp->mVertex - prev_pairp->mVertex).magVecSquared() << llendl;
|
||||
}
|
||||
vertex_mapping[pairp->mIndex] = new_num_vertices - 1;
|
||||
}
|
||||
|
||||
// Iterate through triangles and remove degenerates, re-ordering vertices
|
||||
// along the way.
|
||||
S32 *new_triangles = new S32[num_input_triangles * 3];
|
||||
S32 new_num_triangles = 0;
|
||||
|
||||
for (i = 0; i < num_input_triangles; i++)
|
||||
{
|
||||
S32 v1 = i*3;
|
||||
S32 v2 = v1 + 1;
|
||||
S32 v3 = v1 + 2;
|
||||
|
||||
//llinfos << "Checking triangle " << input_triangles[v1] << ":" << input_triangles[v2] << ":" << input_triangles[v3] << llendl;
|
||||
input_triangles[v1] = vertex_mapping[input_triangles[v1]];
|
||||
input_triangles[v2] = vertex_mapping[input_triangles[v2]];
|
||||
input_triangles[v3] = vertex_mapping[input_triangles[v3]];
|
||||
|
||||
if ((input_triangles[v1] == input_triangles[v2])
|
||||
|| (input_triangles[v1] == input_triangles[v3])
|
||||
|| (input_triangles[v2] == input_triangles[v3]))
|
||||
{
|
||||
//llinfos << "Removing degenerate triangle " << input_triangles[v1] << ":" << input_triangles[v2] << ":" << input_triangles[v3] << llendl;
|
||||
// Degenerate triangle, skip
|
||||
continue;
|
||||
}
|
||||
|
||||
if (input_triangles[v1] < input_triangles[v2])
|
||||
{
|
||||
if (input_triangles[v1] < input_triangles[v3])
|
||||
{
|
||||
// (0 < 1) && (0 < 2)
|
||||
new_triangles[new_num_triangles*3] = input_triangles[v1];
|
||||
new_triangles[new_num_triangles*3+1] = input_triangles[v2];
|
||||
new_triangles[new_num_triangles*3+2] = input_triangles[v3];
|
||||
}
|
||||
else
|
||||
{
|
||||
// (0 < 1) && (2 < 0)
|
||||
new_triangles[new_num_triangles*3] = input_triangles[v3];
|
||||
new_triangles[new_num_triangles*3+1] = input_triangles[v1];
|
||||
new_triangles[new_num_triangles*3+2] = input_triangles[v2];
|
||||
}
|
||||
}
|
||||
else if (input_triangles[v2] < input_triangles[v3])
|
||||
{
|
||||
// (1 < 0) && (1 < 2)
|
||||
new_triangles[new_num_triangles*3] = input_triangles[v2];
|
||||
new_triangles[new_num_triangles*3+1] = input_triangles[v3];
|
||||
new_triangles[new_num_triangles*3+2] = input_triangles[v1];
|
||||
}
|
||||
else
|
||||
{
|
||||
// (1 < 0) && (2 < 1)
|
||||
new_triangles[new_num_triangles*3] = input_triangles[v3];
|
||||
new_triangles[new_num_triangles*3+1] = input_triangles[v1];
|
||||
new_triangles[new_num_triangles*3+2] = input_triangles[v2];
|
||||
}
|
||||
new_num_triangles++;
|
||||
}
|
||||
|
||||
if (new_num_triangles == 0)
|
||||
{
|
||||
llwarns << "Created volume object with 0 faces." << llendl;
|
||||
delete[] new_triangles;
|
||||
delete[] vertex_mapping;
|
||||
delete[] new_vertices;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
typedef std::set<S32*, lessTriangle> triangle_set_t;
|
||||
triangle_set_t triangle_list;
|
||||
|
||||
for (i = 0; i < new_num_triangles; i++)
|
||||
{
|
||||
triangle_list.insert(&new_triangles[i*3]);
|
||||
}
|
||||
|
||||
// Sort through the triangle list, and delete duplicates
|
||||
|
||||
S32 *prevp = NULL;
|
||||
S32 *curp = NULL;
|
||||
|
||||
S32 *sorted_tris = new S32[new_num_triangles*3];
|
||||
S32 cur_tri = 0;
|
||||
for (triangle_set_t::iterator iter = triangle_list.begin(),
|
||||
end = triangle_list.end();
|
||||
iter != end; iter++)
|
||||
{
|
||||
curp = *iter;
|
||||
if (!prevp || !equalTriangle(prevp, curp))
|
||||
{
|
||||
//llinfos << "Added triangle " << *curp << ":" << *(curp+1) << ":" << *(curp+2) << llendl;
|
||||
sorted_tris[cur_tri*3] = *curp;
|
||||
sorted_tris[cur_tri*3+1] = *(curp+1);
|
||||
sorted_tris[cur_tri*3+2] = *(curp+2);
|
||||
cur_tri++;
|
||||
prevp = curp;
|
||||
}
|
||||
else
|
||||
{
|
||||
//llinfos << "Skipped triangle " << *curp << ":" << *(curp+1) << ":" << *(curp+2) << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
*output_vertices = new LLVector3[new_num_vertices];
|
||||
num_output_vertices = new_num_vertices;
|
||||
for (i = 0; i < new_num_vertices; i++)
|
||||
{
|
||||
(*output_vertices)[i] = new_vertices[i];
|
||||
}
|
||||
|
||||
*output_triangles = new S32[cur_tri*3];
|
||||
num_output_triangles = cur_tri;
|
||||
memcpy(*output_triangles, sorted_tris, 3*cur_tri*sizeof(S32)); /* Flawfinder: ignore */
|
||||
|
||||
/*
|
||||
llinfos << "Out vertices: " << num_output_vertices << llendl;
|
||||
llinfos << "Out triangles: " << num_output_triangles << llendl;
|
||||
for (i = 0; i < num_output_vertices; i++)
|
||||
{
|
||||
llinfos << i << ":" << (*output_vertices)[i] << llendl;
|
||||
}
|
||||
for (i = 0; i < num_output_triangles; i++)
|
||||
{
|
||||
llinfos << i << ":" << (*output_triangles)[i*3] << ":" << (*output_triangles)[i*3+1] << ":" << (*output_triangles)[i*3+2] << llendl;
|
||||
}
|
||||
*/
|
||||
|
||||
//llinfos << "Out vertices: " << num_output_vertices << llendl;
|
||||
//llinfos << "Out triangles: " << num_output_triangles << llendl;
|
||||
delete[] vertex_mapping;
|
||||
vertex_mapping = NULL;
|
||||
delete[] new_vertices;
|
||||
new_vertices = NULL;
|
||||
delete[] new_triangles;
|
||||
new_triangles = NULL;
|
||||
delete[] sorted_tris;
|
||||
sorted_tris = NULL;
|
||||
triangle_list.clear();
|
||||
std::for_each(vertex_list.begin(), vertex_list.end(), DeletePointer());
|
||||
vertex_list.clear();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL LLVolumeParams::importFile(LLFILE *fp)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
//llinfos << "importing volume" << llendl;
|
||||
const S32 BUFSIZE = 16384;
|
||||
char buffer[BUFSIZE]; /* Flawfinder: ignore */
|
||||
|
|
@ -5082,8 +4806,6 @@ BOOL LLVolumeParams::exportFile(LLFILE *fp) const
|
|||
|
||||
BOOL LLVolumeParams::importLegacyStream(std::istream& input_stream)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
//llinfos << "importing volume" << llendl;
|
||||
const S32 BUFSIZE = 16384;
|
||||
// *NOTE: changing the size or type of this buffer will require
|
||||
|
|
@ -5123,8 +4845,6 @@ BOOL LLVolumeParams::importLegacyStream(std::istream& input_stream)
|
|||
|
||||
BOOL LLVolumeParams::exportLegacyStream(std::ostream& output_stream) const
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
output_stream <<"\tshape 0\n";
|
||||
output_stream <<"\t{\n";
|
||||
mPathParams.exportLegacyStream(output_stream);
|
||||
|
|
@ -6340,8 +6060,6 @@ void LerpPlanarVertex(LLVolumeFace::VertexData& v0,
|
|||
|
||||
BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
const std::vector<LLVolume::Point>& mesh = volume->getMesh();
|
||||
const std::vector<LLVector3>& profile = volume->getProfile().mProfile;
|
||||
S32 max_s = volume->getProfile().getTotal();
|
||||
|
|
@ -6492,8 +6210,6 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build)
|
|||
|
||||
BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
if (!(mTypeMask & HOLLOW_MASK) &&
|
||||
!(mTypeMask & OPEN_MASK) &&
|
||||
((volume->getParams().getPathParams().getBegin()==0.0f)&&
|
||||
|
|
@ -6880,8 +6596,6 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build)
|
|||
|
||||
void LLVolumeFace::createBinormals()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
if (!mBinormals)
|
||||
{
|
||||
allocateBinormals(mNumVertices);
|
||||
|
|
@ -7153,8 +6867,6 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat
|
|||
|
||||
BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
|
||||
BOOL flat = mTypeMask & FLAT_MASK;
|
||||
|
||||
U8 sculpt_type = volume->getParams().getSculptType();
|
||||
|
|
|
|||
|
|
@ -1023,17 +1023,6 @@ public:
|
|||
LLVector3* normal = NULL,
|
||||
LLVector3* bi_normal = NULL);
|
||||
|
||||
// The following cleans up vertices and triangles,
|
||||
// getting rid of degenerate triangles and duplicate vertices,
|
||||
// and allocates new arrays with the clean data.
|
||||
static BOOL cleanupTriangleData( const S32 num_input_vertices,
|
||||
const std::vector<Point> &input_vertices,
|
||||
const S32 num_input_triangles,
|
||||
S32 *input_triangles,
|
||||
S32 &num_output_vertices,
|
||||
LLVector3 **output_vertices,
|
||||
S32 &num_output_triangles,
|
||||
S32 **output_triangles);
|
||||
LLFaceID generateFaceMask();
|
||||
|
||||
BOOL isFaceMaskValid(LLFaceID face_mask);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
#include "linden_common.h"
|
||||
|
||||
#include "llvolumemgr.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llvolume.h"
|
||||
|
||||
|
||||
|
|
@ -182,7 +181,6 @@ void LLVolumeMgr::insertGroup(LLVolumeLODGroup* volgroup)
|
|||
// protected
|
||||
LLVolumeLODGroup* LLVolumeMgr::createNewGroup(const LLVolumeParams& volume_params)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
LLVolumeLODGroup* volgroup = new LLVolumeLODGroup(volume_params);
|
||||
insertGroup(volgroup);
|
||||
return volgroup;
|
||||
|
|
@ -297,7 +295,6 @@ LLVolume* LLVolumeLODGroup::refLOD(const S32 detail)
|
|||
mRefs++;
|
||||
if (mVolumeLODs[detail].isNull())
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
mVolumeLODs[detail] = new LLVolume(mVolumeParams, mDetailScales[detail]);
|
||||
}
|
||||
mLODRefs[detail]++;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ template<> template<>
|
|||
void alignment_test_object_t::test<1>()
|
||||
{
|
||||
# ifdef LL_DEBUG
|
||||
skip("This test fails on Windows when compiled in debug mode.");
|
||||
// skip("This test fails on Windows when compiled in debug mode.");
|
||||
# endif
|
||||
|
||||
const int num_tests = 7;
|
||||
|
|
@ -116,7 +116,7 @@ template<> template<>
|
|||
void alignment_test_object_t::test<3>()
|
||||
{
|
||||
# ifdef LL_DEBUG
|
||||
skip("This test fails on Windows when compiled in debug mode.");
|
||||
// skip("This test fails on Windows when compiled in debug mode.");
|
||||
# endif
|
||||
|
||||
const int ARR_SIZE = 7;
|
||||
|
|
@ -128,12 +128,14 @@ void alignment_test_object_t::test<3>()
|
|||
}
|
||||
|
||||
MyVector4a *veca = new MyVector4a[ARR_SIZE];
|
||||
//std::cout << "veca base is " << (S32) veca << std::endl;
|
||||
ensure("LLAligment veca base", is_aligned(veca,16));
|
||||
for(int i=0; i<ARR_SIZE; i++)
|
||||
{
|
||||
std::cout << "veca[" << i << "]" << std::endl;
|
||||
ensure("LLAlignment veca member unaligned", is_aligned(&veca[i],16));
|
||||
}
|
||||
delete [] veca;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include "llbuffer.h"
|
||||
|
||||
#include "llmath.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llstl.h"
|
||||
#include "llthread.h"
|
||||
|
||||
|
|
@ -44,7 +43,6 @@ LLSegment::LLSegment() :
|
|||
mData(NULL),
|
||||
mSize(0)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
}
|
||||
|
||||
LLSegment::LLSegment(S32 channel, U8* data, S32 data_len) :
|
||||
|
|
@ -52,12 +50,10 @@ LLSegment::LLSegment(S32 channel, U8* data, S32 data_len) :
|
|||
mData(data),
|
||||
mSize(data_len)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
}
|
||||
|
||||
LLSegment::~LLSegment()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
}
|
||||
|
||||
bool LLSegment::isOnChannel(S32 channel) const
|
||||
|
|
@ -104,7 +100,6 @@ LLHeapBuffer::LLHeapBuffer() :
|
|||
mNextFree(NULL),
|
||||
mReclaimedBytes(0)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
const S32 DEFAULT_HEAP_BUFFER_SIZE = 16384;
|
||||
allocate(DEFAULT_HEAP_BUFFER_SIZE);
|
||||
}
|
||||
|
|
@ -115,7 +110,6 @@ LLHeapBuffer::LLHeapBuffer(S32 size) :
|
|||
mNextFree(NULL),
|
||||
mReclaimedBytes(0)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
allocate(size);
|
||||
}
|
||||
|
||||
|
|
@ -125,7 +119,6 @@ LLHeapBuffer::LLHeapBuffer(const U8* src, S32 len) :
|
|||
mNextFree(NULL),
|
||||
mReclaimedBytes(0)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
if((len > 0) && src)
|
||||
{
|
||||
allocate(len);
|
||||
|
|
@ -139,7 +132,6 @@ LLHeapBuffer::LLHeapBuffer(const U8* src, S32 len) :
|
|||
// virtual
|
||||
LLHeapBuffer::~LLHeapBuffer()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
delete[] mBuffer;
|
||||
mBuffer = NULL;
|
||||
mSize = 0;
|
||||
|
|
@ -157,7 +149,6 @@ bool LLHeapBuffer::createSegment(
|
|||
S32 size,
|
||||
LLSegment& segment)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
// get actual size of the segment.
|
||||
S32 actual_size = llmin(size, (mSize - S32(mNextFree - mBuffer)));
|
||||
|
||||
|
|
@ -212,7 +203,6 @@ bool LLHeapBuffer::containsSegment(const LLSegment& segment) const
|
|||
|
||||
void LLHeapBuffer::allocate(S32 size)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
mReclaimedBytes = 0;
|
||||
mBuffer = new U8[size];
|
||||
if(mBuffer)
|
||||
|
|
@ -230,12 +220,10 @@ LLBufferArray::LLBufferArray() :
|
|||
mNextBaseChannel(0),
|
||||
mMutexp(NULL)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
}
|
||||
|
||||
LLBufferArray::~LLBufferArray()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
std::for_each(mBuffers.begin(), mBuffers.end(), DeletePointer());
|
||||
|
||||
delete mMutexp;
|
||||
|
|
@ -314,7 +302,6 @@ bool LLBufferArray::append(S32 channel, const U8* src, S32 len)
|
|||
{
|
||||
LLMutexLock lock(mMutexp) ;
|
||||
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
std::vector<LLSegment> segments;
|
||||
if(copyIntoBuffers(channel, src, len, segments))
|
||||
{
|
||||
|
|
@ -329,7 +316,6 @@ bool LLBufferArray::prepend(S32 channel, const U8* src, S32 len)
|
|||
{
|
||||
ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
|
||||
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
std::vector<LLSegment> segments;
|
||||
if(copyIntoBuffers(channel, src, len, segments))
|
||||
{
|
||||
|
|
@ -345,7 +331,6 @@ bool LLBufferArray::insertAfter(
|
|||
const U8* src,
|
||||
S32 len)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
std::vector<LLSegment> segments;
|
||||
|
||||
LLMutexLock lock(mMutexp) ;
|
||||
|
|
@ -366,7 +351,6 @@ LLBufferArray::segment_iterator_t LLBufferArray::splitAfter(U8* address)
|
|||
{
|
||||
ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
|
||||
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
segment_iterator_t end = mSegments.end();
|
||||
segment_iterator_t it = getSegment(address);
|
||||
if(it == end)
|
||||
|
|
@ -414,7 +398,6 @@ LLBufferArray::segment_iterator_t LLBufferArray::constructSegmentAfter(
|
|||
LLSegment& segment)
|
||||
{
|
||||
ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
segment_iterator_t rv = mSegments.begin();
|
||||
segment_iterator_t end = mSegments.end();
|
||||
if(!address)
|
||||
|
|
@ -578,7 +561,6 @@ U8* LLBufferArray::readAfter(
|
|||
U8* dest,
|
||||
S32& len) const
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
U8* rv = start;
|
||||
if(!dest || len <= 0)
|
||||
{
|
||||
|
|
@ -642,7 +624,6 @@ U8* LLBufferArray::seek(
|
|||
S32 delta) const
|
||||
{
|
||||
ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
const_segment_iterator_t it;
|
||||
const_segment_iterator_t end = mSegments.end();
|
||||
U8* rv = start;
|
||||
|
|
@ -786,8 +767,6 @@ U8* LLBufferArray::seek(
|
|||
//test use only
|
||||
bool LLBufferArray::takeContents(LLBufferArray& source)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
|
||||
LLMutexLock lock(mMutexp);
|
||||
source.lock();
|
||||
|
||||
|
|
@ -813,7 +792,6 @@ LLBufferArray::segment_iterator_t LLBufferArray::makeSegment(
|
|||
S32 len)
|
||||
{
|
||||
ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
// start at the end of the buffers, because it is the most likely
|
||||
// to have free space.
|
||||
LLSegment segment;
|
||||
|
|
@ -852,7 +830,6 @@ LLBufferArray::segment_iterator_t LLBufferArray::makeSegment(
|
|||
bool LLBufferArray::eraseSegment(const segment_iterator_t& erase_iter)
|
||||
{
|
||||
ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
|
||||
// Find out which buffer contains the segment, and if it is found,
|
||||
// ask it to reclaim the memory.
|
||||
|
|
@ -885,7 +862,6 @@ bool LLBufferArray::copyIntoBuffers(
|
|||
std::vector<LLSegment>& segments)
|
||||
{
|
||||
ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
if(!src || !len) return false;
|
||||
S32 copied = 0;
|
||||
LLSegment segment;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include "llbufferstream.h"
|
||||
|
||||
#include "llbuffer.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llthread.h"
|
||||
|
||||
static const S32 DEFAULT_OUTPUT_SEGMENT_SIZE = 1024 * 4;
|
||||
|
|
@ -44,19 +43,16 @@ LLBufferStreamBuf::LLBufferStreamBuf(
|
|||
mChannels(channels),
|
||||
mBuffer(buffer)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
}
|
||||
|
||||
LLBufferStreamBuf::~LLBufferStreamBuf()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
sync();
|
||||
}
|
||||
|
||||
// virtual
|
||||
int LLBufferStreamBuf::underflow()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
//lldebugs << "LLBufferStreamBuf::underflow()" << llendl;
|
||||
if(!mBuffer)
|
||||
{
|
||||
|
|
@ -129,7 +125,6 @@ int LLBufferStreamBuf::underflow()
|
|||
// virtual
|
||||
int LLBufferStreamBuf::overflow(int c)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
if(!mBuffer)
|
||||
{
|
||||
return EOF;
|
||||
|
|
@ -169,7 +164,6 @@ int LLBufferStreamBuf::overflow(int c)
|
|||
// virtual
|
||||
int LLBufferStreamBuf::sync()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
int return_value = -1;
|
||||
if(!mBuffer)
|
||||
{
|
||||
|
|
@ -251,7 +245,6 @@ streampos LLBufferStreamBuf::seekoff(
|
|||
std::ios::openmode which)
|
||||
#endif
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
if(!mBuffer
|
||||
|| ((way == std::ios::beg) && (off < 0))
|
||||
|| ((way == std::ios::end) && (off > 0)))
|
||||
|
|
@ -343,10 +336,8 @@ LLBufferStream::LLBufferStream(
|
|||
std::iostream(&mStreamBuf),
|
||||
mStreamBuf(channels, buffer)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
}
|
||||
|
||||
LLBufferStream::~LLBufferStream()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
#include "llsdserialize.h"
|
||||
#include "lluuid.h"
|
||||
#include "message.h"
|
||||
#include "llmemtype.h"
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
|
|
@ -663,7 +662,6 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, ol
|
|||
|
||||
void LLCacheName::processPending()
|
||||
{
|
||||
LLMemType mt_pp(LLMemType::MTYPE_CACHE_PROCESS_PENDING);
|
||||
const F32 SECS_BETWEEN_PROCESS = 0.1f;
|
||||
if(!impl.mProcessTimer.checkExpirationAndReset(SECS_BETWEEN_PROCESS))
|
||||
{
|
||||
|
|
@ -769,7 +767,6 @@ std::string LLCacheName::getDefaultLastName()
|
|||
|
||||
void LLCacheName::Impl::processPendingAsks()
|
||||
{
|
||||
LLMemType mt_ppa(LLMemType::MTYPE_CACHE_PROCESS_PENDING_ASKS);
|
||||
sendRequest(_PREHASH_UUIDNameRequest, mAskNameQueue);
|
||||
sendRequest(_PREHASH_UUIDGroupNameRequest, mAskGroupQueue);
|
||||
mAskNameQueue.clear();
|
||||
|
|
@ -778,7 +775,6 @@ void LLCacheName::Impl::processPendingAsks()
|
|||
|
||||
void LLCacheName::Impl::processPendingReplies()
|
||||
{
|
||||
LLMemType mt_ppr(LLMemType::MTYPE_CACHE_PROCESS_PENDING_REPLIES);
|
||||
// First call all the callbacks, because they might send messages.
|
||||
for(ReplyQueue::iterator it = mReplyQueue.begin(); it != mReplyQueue.end(); ++it)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -679,7 +679,6 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)
|
|||
setPacketInID((id + 1) % LL_MAX_OUT_PACKET_ID);
|
||||
|
||||
mLastPacketGap = 0;
|
||||
mOutOfOrderRate.count(0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -775,7 +774,6 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)
|
|||
|
||||
}
|
||||
}
|
||||
mOutOfOrderRate.count(gap);
|
||||
mLastPacketGap = gap;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@
|
|||
#include "llpacketack.h"
|
||||
#include "lluuid.h"
|
||||
#include "llthrottle.h"
|
||||
#include "llstat.h"
|
||||
|
||||
//
|
||||
// Constants
|
||||
|
|
@ -126,8 +125,6 @@ public:
|
|||
S32 getUnackedPacketCount() const { return mUnackedPacketCount; }
|
||||
S32 getUnackedPacketBytes() const { return mUnackedPacketBytes; }
|
||||
F64 getNextPingSendTime() const { return mNextPingSendTime; }
|
||||
F32 getOutOfOrderRate(LLStatAccum::TimeScale scale = LLStatAccum::SCALE_MINUTE)
|
||||
{ return mOutOfOrderRate.meanValue(scale); }
|
||||
U32 getLastPacketGap() const { return mLastPacketGap; }
|
||||
LLHost getHost() const { return mHost; }
|
||||
F64 getLastPacketInTime() const { return mLastPacketInTime; }
|
||||
|
|
@ -275,7 +272,6 @@ protected:
|
|||
LLTimer mExistenceTimer; // initialized when circuit created, used to track bandwidth numbers
|
||||
|
||||
S32 mCurrentResendCount; // Number of resent packets since last spam
|
||||
LLStatRate mOutOfOrderRate; // Rate of out of order packets coming in.
|
||||
U32 mLastPacketGap; // Gap in sequence number of last packet.
|
||||
|
||||
const F32 mHeartbeatInterval;
|
||||
|
|
|
|||
|
|
@ -37,12 +37,10 @@
|
|||
#include "lliopipe.h"
|
||||
#include "lliosocket.h"
|
||||
#include "llioutil.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llmemorystream.h"
|
||||
#include "llpumpio.h"
|
||||
#include "llsd.h"
|
||||
#include "llsdserialize_xml.h"
|
||||
#include "llstat.h"
|
||||
#include "llstl.h"
|
||||
#include "lltimer.h"
|
||||
|
||||
|
|
@ -141,6 +139,11 @@ private:
|
|||
};
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_PIPE("HTTP Pipe");
|
||||
static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_GET("HTTP Get");
|
||||
static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_PUT("HTTP Put");
|
||||
static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_POST("HTTP Post");
|
||||
static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_DELETE("HTTP Delete");
|
||||
|
||||
LLIOPipe::EStatus LLHTTPPipe::process_impl(
|
||||
const LLChannelDescriptors& channels,
|
||||
buffer_ptr_t& buffer,
|
||||
|
|
@ -177,12 +180,12 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
|
|||
std::string verb = context[CONTEXT_REQUEST][CONTEXT_VERB];
|
||||
if(verb == HTTP_VERB_GET)
|
||||
{
|
||||
LLPerfBlock getblock("http_get");
|
||||
LLFastTimer _(FTM_PROCESS_HTTP_GET);
|
||||
mNode.get(LLHTTPNode::ResponsePtr(mResponse), context);
|
||||
}
|
||||
else if(verb == HTTP_VERB_PUT)
|
||||
{
|
||||
LLPerfBlock putblock("http_put");
|
||||
LLFastTimer _(FTM_PROCESS_HTTP_PUT);
|
||||
LLSD input;
|
||||
if (mNode.getContentType() == LLHTTPNode::CONTENT_TYPE_LLSD)
|
||||
{
|
||||
|
|
@ -198,7 +201,7 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
|
|||
}
|
||||
else if(verb == HTTP_VERB_POST)
|
||||
{
|
||||
LLPerfBlock postblock("http_post");
|
||||
LLFastTimer _(FTM_PROCESS_HTTP_POST);
|
||||
LLSD input;
|
||||
if (mNode.getContentType() == LLHTTPNode::CONTENT_TYPE_LLSD)
|
||||
{
|
||||
|
|
@ -214,7 +217,7 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
|
|||
}
|
||||
else if(verb == HTTP_VERB_DELETE)
|
||||
{
|
||||
LLPerfBlock delblock("http_delete");
|
||||
LLFastTimer _(FTM_PROCESS_HTTP_DELETE);
|
||||
mNode.del(LLHTTPNode::ResponsePtr(mResponse), context);
|
||||
}
|
||||
else if(verb == HTTP_VERB_OPTIONS)
|
||||
|
|
@ -443,7 +446,6 @@ LLIOPipe::EStatus LLHTTPResponseHeader::process_impl(
|
|||
{
|
||||
LLFastTimer t(FTM_PROCESS_HTTP_HEADER);
|
||||
PUMP_DEBUG;
|
||||
LLMemType m1(LLMemType::MTYPE_IO_HTTP_SERVER);
|
||||
if(eos)
|
||||
{
|
||||
PUMP_DEBUG;
|
||||
|
|
@ -587,13 +589,11 @@ LLHTTPResponder::LLHTTPResponder(const LLHTTPNode& tree, const LLSD& ctx) :
|
|||
mContentLength(0),
|
||||
mRootNode(tree)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_HTTP_SERVER);
|
||||
}
|
||||
|
||||
// virtual
|
||||
LLHTTPResponder::~LLHTTPResponder()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_HTTP_SERVER);
|
||||
//lldebugs << "destroying LLHTTPResponder" << llendl;
|
||||
}
|
||||
|
||||
|
|
@ -603,7 +603,6 @@ bool LLHTTPResponder::readHeaderLine(
|
|||
U8* dest,
|
||||
S32& len)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_HTTP_SERVER);
|
||||
--len;
|
||||
U8* last = buffer->readAfter(channels.in(), mLastRead, dest, len);
|
||||
dest[len] = '\0';
|
||||
|
|
@ -628,7 +627,6 @@ void LLHTTPResponder::markBad(
|
|||
const LLChannelDescriptors& channels,
|
||||
buffer_ptr_t buffer)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_HTTP_SERVER);
|
||||
mState = STATE_SHORT_CIRCUIT;
|
||||
LLBufferStream out(channels, buffer.get());
|
||||
out << HTTP_VERSION_STR << " 400 Bad Request\r\n\r\n<html>\n"
|
||||
|
|
@ -648,7 +646,6 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
|
|||
{
|
||||
LLFastTimer t(FTM_PROCESS_HTTP_RESPONDER);
|
||||
PUMP_DEBUG;
|
||||
LLMemType m1(LLMemType::MTYPE_IO_HTTP_SERVER);
|
||||
LLIOPipe::EStatus status = STATUS_OK;
|
||||
|
||||
// parsing headers
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
#include "llbuffer.h"
|
||||
#include "llhost.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llpumpio.h"
|
||||
|
||||
//
|
||||
|
|
@ -100,7 +99,6 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock)
|
|||
// static
|
||||
LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
LLSocket::ptr_t rv;
|
||||
apr_socket_t* socket = NULL;
|
||||
apr_pool_t* new_pool = NULL;
|
||||
|
|
@ -198,7 +196,6 @@ LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port)
|
|||
// static
|
||||
LLSocket::ptr_t LLSocket::create(apr_socket_t* socket, apr_pool_t* pool)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
LLSocket::ptr_t rv;
|
||||
if(!socket)
|
||||
{
|
||||
|
|
@ -240,12 +237,10 @@ LLSocket::LLSocket(apr_socket_t* socket, apr_pool_t* pool) :
|
|||
mPort(PORT_INVALID)
|
||||
{
|
||||
ll_debug_socket("Constructing wholely formed socket", mSocket);
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
}
|
||||
|
||||
LLSocket::~LLSocket()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
// *FIX: clean up memory we are holding.
|
||||
if(mSocket)
|
||||
{
|
||||
|
|
@ -265,7 +260,6 @@ LLSocket::~LLSocket()
|
|||
|
||||
void LLSocket::setBlocking(S32 timeout)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
// set up the socket options
|
||||
ll_apr_warn_status(apr_socket_timeout_set(mSocket, timeout));
|
||||
ll_apr_warn_status(apr_socket_opt_set(mSocket, APR_SO_NONBLOCK, 0));
|
||||
|
|
@ -276,7 +270,6 @@ void LLSocket::setBlocking(S32 timeout)
|
|||
|
||||
void LLSocket::setNonBlocking()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
// set up the socket options
|
||||
ll_apr_warn_status(apr_socket_timeout_set(mSocket, 0));
|
||||
ll_apr_warn_status(apr_socket_opt_set(mSocket, APR_SO_NONBLOCK, 1));
|
||||
|
|
@ -293,12 +286,10 @@ LLIOSocketReader::LLIOSocketReader(LLSocket::ptr_t socket) :
|
|||
mSource(socket),
|
||||
mInitialized(false)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
}
|
||||
|
||||
LLIOSocketReader::~LLIOSocketReader()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
//lldebugs << "Destroying LLIOSocketReader" << llendl;
|
||||
}
|
||||
|
||||
|
|
@ -314,7 +305,6 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl(
|
|||
{
|
||||
LLFastTimer t(FTM_PROCESS_SOCKET_READER);
|
||||
PUMP_DEBUG;
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
if(!mSource) return STATUS_PRECONDITION_NOT_MET;
|
||||
if(!mInitialized)
|
||||
{
|
||||
|
|
@ -396,12 +386,10 @@ LLIOSocketWriter::LLIOSocketWriter(LLSocket::ptr_t socket) :
|
|||
mLastWritten(NULL),
|
||||
mInitialized(false)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
}
|
||||
|
||||
LLIOSocketWriter::~LLIOSocketWriter()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
//lldebugs << "Destroying LLIOSocketWriter" << llendl;
|
||||
}
|
||||
|
||||
|
|
@ -416,7 +404,6 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl(
|
|||
{
|
||||
LLFastTimer t(FTM_PROCESS_SOCKET_WRITER);
|
||||
PUMP_DEBUG;
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
if(!mDestination) return STATUS_PRECONDITION_NOT_MET;
|
||||
if(!mInitialized)
|
||||
{
|
||||
|
|
@ -550,12 +537,10 @@ LLIOServerSocket::LLIOServerSocket(
|
|||
mInitialized(false),
|
||||
mResponseTimeout(DEFAULT_CHAIN_EXPIRY_SECS)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
}
|
||||
|
||||
LLIOServerSocket::~LLIOServerSocket()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
//lldebugs << "Destroying LLIOServerSocket" << llendl;
|
||||
}
|
||||
|
||||
|
|
@ -575,7 +560,6 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl(
|
|||
{
|
||||
LLFastTimer t(FTM_PROCESS_SERVER_SOCKET);
|
||||
PUMP_DEBUG;
|
||||
LLMemType m1(LLMemType::MTYPE_IO_TCP);
|
||||
if(!pump)
|
||||
{
|
||||
llwarns << "Need a pump for server socket." << llendl;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include "lldarray.h"
|
||||
#include "message.h" // TODO: babbage: Remove...
|
||||
#include "llstat.h"
|
||||
#include "llstl.h"
|
||||
|
||||
class LLMsgVarData
|
||||
|
|
@ -263,6 +262,7 @@ enum EMsgDeprecation
|
|||
MD_DEPRECATED
|
||||
};
|
||||
|
||||
|
||||
class LLMessageTemplate
|
||||
{
|
||||
public:
|
||||
|
|
@ -364,7 +364,6 @@ public:
|
|||
{
|
||||
if (mHandlerFunc)
|
||||
{
|
||||
LLPerfBlock msg_cb_time("msg_cb", mName);
|
||||
mHandlerFunc(msgsystem, mUserData);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,9 +34,7 @@
|
|||
#include "apr_poll.h"
|
||||
|
||||
#include "llapr.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llstl.h"
|
||||
#include "llstat.h"
|
||||
|
||||
// These should not be enabled in production, but they can be
|
||||
// intensely useful during development for finding certain kinds of
|
||||
|
|
@ -153,7 +151,6 @@ struct ll_delete_apr_pollset_fd_client_data
|
|||
typedef std::pair<LLIOPipe::ptr_t, apr_pollfd_t> pipe_conditional_t;
|
||||
void operator()(const pipe_conditional_t& conditional)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
S32* client_id = (S32*)conditional.second.client_data;
|
||||
delete client_id;
|
||||
}
|
||||
|
|
@ -177,19 +174,16 @@ LLPumpIO::LLPumpIO(apr_pool_t* pool) :
|
|||
{
|
||||
mCurrentChain = mRunningChains.end();
|
||||
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
initialize(pool);
|
||||
}
|
||||
|
||||
LLPumpIO::~LLPumpIO()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
cleanup();
|
||||
}
|
||||
|
||||
bool LLPumpIO::prime(apr_pool_t* pool)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
cleanup();
|
||||
initialize(pool);
|
||||
return ((pool == NULL) ? false : true);
|
||||
|
|
@ -197,7 +191,6 @@ bool LLPumpIO::prime(apr_pool_t* pool)
|
|||
|
||||
bool LLPumpIO::addChain(const chain_t& chain, F32 timeout, bool has_curl_request)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
if(chain.empty()) return false;
|
||||
|
||||
#if LL_THREADS_APR
|
||||
|
|
@ -233,7 +226,6 @@ bool LLPumpIO::addChain(
|
|||
LLSD context,
|
||||
F32 timeout)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
|
||||
// remember that if the caller is providing a full link
|
||||
// description, we need to have that description matched to a
|
||||
|
|
@ -311,7 +303,6 @@ static std::string events_2_string(apr_int16_t events)
|
|||
|
||||
bool LLPumpIO::setConditional(LLIOPipe* pipe, const apr_pollfd_t* poll)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
if(!pipe) return false;
|
||||
ll_debug_poll_fd("Set conditional", poll);
|
||||
|
||||
|
|
@ -423,7 +414,6 @@ bool LLPumpIO::sleepChain(F64 seconds)
|
|||
|
||||
bool LLPumpIO::copyCurrentLinkInfo(links_t& links) const
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
if(mRunningChains.end() == mCurrentChain)
|
||||
{
|
||||
return false;
|
||||
|
|
@ -441,6 +431,7 @@ void LLPumpIO::pump()
|
|||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_PUMP_IO("Pump IO");
|
||||
static LLFastTimer::DeclareTimer FTM_PUMP_POLL("Pump Poll");
|
||||
|
||||
LLPumpIO::current_chain_t LLPumpIO::removeRunningChain(LLPumpIO::current_chain_t& run_chain)
|
||||
{
|
||||
|
|
@ -454,7 +445,6 @@ LLPumpIO::current_chain_t LLPumpIO::removeRunningChain(LLPumpIO::current_chain_t
|
|||
//timeout is in microseconds
|
||||
void LLPumpIO::pump(const S32& poll_timeout)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
LLFastTimer t1(FTM_PUMP_IO);
|
||||
//llinfos << "LLPumpIO::pump()" << llendl;
|
||||
|
||||
|
|
@ -536,7 +526,7 @@ void LLPumpIO::pump(const S32& poll_timeout)
|
|||
S32 count = 0;
|
||||
S32 client_id = 0;
|
||||
{
|
||||
LLPerfBlock polltime("pump_poll");
|
||||
LLFastTimer _(FTM_PUMP_POLL);
|
||||
apr_pollset_poll(mPollset, poll_timeout, &count, &poll_fd);
|
||||
}
|
||||
PUMP_DEBUG;
|
||||
|
|
@ -747,7 +737,6 @@ void LLPumpIO::pump(const S32& poll_timeout)
|
|||
|
||||
bool LLPumpIO::respond(LLIOPipe* pipe)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
if(NULL == pipe) return false;
|
||||
|
||||
#if LL_THREADS_APR
|
||||
|
|
@ -766,7 +755,6 @@ bool LLPumpIO::respond(
|
|||
LLIOPipe::buffer_ptr_t data,
|
||||
LLSD context)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
// if the caller is providing a full link description, we need to
|
||||
// have that description matched to a particular buffer.
|
||||
if(!data) return false;
|
||||
|
|
@ -789,7 +777,6 @@ static LLFastTimer::DeclareTimer FTM_PUMP_CALLBACK_CHAIN("Chain");
|
|||
|
||||
void LLPumpIO::callback()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
//llinfos << "LLPumpIO::callback()" << llendl;
|
||||
if(true)
|
||||
{
|
||||
|
|
@ -840,7 +827,6 @@ void LLPumpIO::control(LLPumpIO::EControl op)
|
|||
|
||||
void LLPumpIO::initialize(apr_pool_t* pool)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
if(!pool) return;
|
||||
#if LL_THREADS_APR
|
||||
// SJB: Windows defaults to NESTED and OSX defaults to UNNESTED, so use UNNESTED explicitly.
|
||||
|
|
@ -852,7 +838,6 @@ void LLPumpIO::initialize(apr_pool_t* pool)
|
|||
|
||||
void LLPumpIO::cleanup()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
#if LL_THREADS_APR
|
||||
if(mChainsMutex) apr_thread_mutex_destroy(mChainsMutex);
|
||||
if(mCallbackMutex) apr_thread_mutex_destroy(mCallbackMutex);
|
||||
|
|
@ -875,7 +860,6 @@ void LLPumpIO::cleanup()
|
|||
|
||||
void LLPumpIO::rebuildPollset()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
// lldebugs << "LLPumpIO::rebuildPollset()" << llendl;
|
||||
if(mPollset)
|
||||
{
|
||||
|
|
@ -928,7 +912,6 @@ void LLPumpIO::rebuildPollset()
|
|||
void LLPumpIO::processChain(LLChainInfo& chain)
|
||||
{
|
||||
PUMP_DEBUG;
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
LLIOPipe::EStatus status = LLIOPipe::STATUS_OK;
|
||||
links_t::iterator it = chain.mHead;
|
||||
links_t::iterator end = chain.mChainLinks.end();
|
||||
|
|
@ -1130,7 +1113,6 @@ bool LLPumpIO::handleChainError(
|
|||
LLChainInfo& chain,
|
||||
LLIOPipe::EStatus error)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
links_t::reverse_iterator rit;
|
||||
if(chain.mHead == chain.mChainLinks.end())
|
||||
{
|
||||
|
|
@ -1194,13 +1176,11 @@ LLPumpIO::LLChainInfo::LLChainInfo() :
|
|||
mEOS(false),
|
||||
mHasCurlRequest(false)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
mTimer.setTimerExpirySec(DEFAULT_CHAIN_EXPIRY_SECS);
|
||||
}
|
||||
|
||||
void LLPumpIO::LLChainInfo::setTimeoutSeconds(F32 timeout)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
if(timeout > 0.0f)
|
||||
{
|
||||
mTimer.start();
|
||||
|
|
@ -1215,7 +1195,6 @@ void LLPumpIO::LLChainInfo::setTimeoutSeconds(F32 timeout)
|
|||
|
||||
void LLPumpIO::LLChainInfo::adjustTimeoutSeconds(F32 delta)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_PUMP);
|
||||
if(mTimer.getStarted())
|
||||
{
|
||||
F64 expiry = mTimer.expiresAt();
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
#include "llbufferstream.h"
|
||||
#include "llfiltersd2xmlrpc.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llpumpio.h"
|
||||
#include "llsd.h"
|
||||
#include "llsdserialize.h"
|
||||
|
|
@ -50,18 +49,15 @@ LLSDRPCResponse::LLSDRPCResponse() :
|
|||
mIsError(false),
|
||||
mIsFault(false)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT);
|
||||
}
|
||||
|
||||
// virtual
|
||||
LLSDRPCResponse::~LLSDRPCResponse()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT);
|
||||
}
|
||||
|
||||
bool LLSDRPCResponse::extractResponse(const LLSD& sd)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT);
|
||||
bool rv = true;
|
||||
if(sd.has(LLSDRPC_RESPONSE_NAME))
|
||||
{
|
||||
|
|
@ -94,7 +90,6 @@ LLIOPipe::EStatus LLSDRPCResponse::process_impl(
|
|||
{
|
||||
LLFastTimer t(FTM_SDRPC_RESPONSE);
|
||||
PUMP_DEBUG;
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT);
|
||||
if(mIsError)
|
||||
{
|
||||
error(pump);
|
||||
|
|
@ -119,13 +114,11 @@ LLSDRPCClient::LLSDRPCClient() :
|
|||
mState(STATE_NONE),
|
||||
mQueue(EPBQ_PROCESS)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT);
|
||||
}
|
||||
|
||||
// virtual
|
||||
LLSDRPCClient::~LLSDRPCClient()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT);
|
||||
}
|
||||
|
||||
bool LLSDRPCClient::call(
|
||||
|
|
@ -135,7 +128,6 @@ bool LLSDRPCClient::call(
|
|||
LLSDRPCResponse* response,
|
||||
EPassBackQueue queue)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT);
|
||||
//llinfos << "RPC: " << uri << "." << method << "(" << *parameter << ")"
|
||||
// << llendl;
|
||||
if(method.empty() || !response)
|
||||
|
|
@ -162,7 +154,6 @@ bool LLSDRPCClient::call(
|
|||
LLSDRPCResponse* response,
|
||||
EPassBackQueue queue)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT);
|
||||
//llinfos << "RPC: " << uri << "." << method << "(" << parameter << ")"
|
||||
// << llendl;
|
||||
if(method.empty() || parameter.empty() || !response)
|
||||
|
|
@ -193,7 +184,6 @@ LLIOPipe::EStatus LLSDRPCClient::process_impl(
|
|||
{
|
||||
LLFastTimer t(FTM_PROCESS_SDRPC_CLIENT);
|
||||
PUMP_DEBUG;
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT);
|
||||
if((STATE_NONE == mState) || (!pump))
|
||||
{
|
||||
// You should have called the call() method already.
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
#include "llbuffer.h"
|
||||
#include "llbufferstream.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llpumpio.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "llstl.h"
|
||||
|
|
@ -58,12 +57,10 @@ LLSDRPCServer::LLSDRPCServer() :
|
|||
mPump(NULL),
|
||||
mLock(0)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
|
||||
}
|
||||
|
||||
LLSDRPCServer::~LLSDRPCServer()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
|
||||
std::for_each(
|
||||
mMethods.begin(),
|
||||
mMethods.end(),
|
||||
|
|
@ -109,7 +106,6 @@ LLIOPipe::EStatus LLSDRPCServer::process_impl(
|
|||
{
|
||||
LLFastTimer t(FTM_PROCESS_SDRPC_SERVER);
|
||||
PUMP_DEBUG;
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
|
||||
// lldebugs << "LLSDRPCServer::process_impl" << llendl;
|
||||
// Once we have all the data, We need to read the sd on
|
||||
// the the in channel, and respond on the out channel
|
||||
|
|
@ -253,7 +249,6 @@ ESDRPCSStatus LLSDRPCServer::callMethod(
|
|||
const LLChannelDescriptors& channels,
|
||||
LLBufferArray* response)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
|
||||
// Try to find the method in the method table.
|
||||
ESDRPCSStatus rv = ESDRPCS_DONE;
|
||||
method_map_t::iterator it = mMethods.find(method);
|
||||
|
|
@ -292,7 +287,6 @@ ESDRPCSStatus LLSDRPCServer::callbackMethod(
|
|||
const LLChannelDescriptors& channels,
|
||||
LLBufferArray* response)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
|
||||
// Try to find the method in the callback method table.
|
||||
ESDRPCSStatus rv = ESDRPCS_DONE;
|
||||
method_map_t::iterator it = mCallbackMethods.find(method);
|
||||
|
|
@ -320,7 +314,6 @@ void LLSDRPCServer::buildFault(
|
|||
S32 code,
|
||||
const std::string& msg)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
|
||||
LLBufferStream ostr(channels, data);
|
||||
ostr << FAULT_PART_1 << code << FAULT_PART_2 << msg << FAULT_PART_3;
|
||||
llinfos << "LLSDRPCServer::buildFault: " << code << ", " << msg << llendl;
|
||||
|
|
@ -332,7 +325,6 @@ void LLSDRPCServer::buildResponse(
|
|||
LLBufferArray* data,
|
||||
const LLSD& response)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
|
||||
LLBufferStream ostr(channels, data);
|
||||
ostr << RESPONSE_PART_1;
|
||||
LLSDSerialize::toNotation(response, ostr);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <openssl/ssl.h>
|
||||
#include "llcurl.h"
|
||||
#include "llioutil.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llproxy.h"
|
||||
#include "llpumpio.h"
|
||||
#include "llsd.h"
|
||||
|
|
@ -81,7 +80,6 @@ LLURLRequestDetail::LLURLRequestDetail() :
|
|||
mIsBodyLimitSet(false),
|
||||
mSSLVerifyCallback(NULL)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
mCurlRequest = new LLCurlEasyRequest();
|
||||
|
||||
if(!mCurlRequest->isValid()) //failed.
|
||||
|
|
@ -93,7 +91,6 @@ LLURLRequestDetail::LLURLRequestDetail() :
|
|||
|
||||
LLURLRequestDetail::~LLURLRequestDetail()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
delete mCurlRequest;
|
||||
mLastRead = NULL;
|
||||
}
|
||||
|
|
@ -156,7 +153,6 @@ std::string LLURLRequest::actionAsVerb(LLURLRequest::ERequestAction action)
|
|||
LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action) :
|
||||
mAction(action)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
initialize();
|
||||
}
|
||||
|
||||
|
|
@ -165,21 +161,18 @@ LLURLRequest::LLURLRequest(
|
|||
const std::string& url) :
|
||||
mAction(action)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
initialize();
|
||||
setURL(url);
|
||||
}
|
||||
|
||||
LLURLRequest::~LLURLRequest()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
delete mDetail;
|
||||
mDetail = NULL ;
|
||||
}
|
||||
|
||||
void LLURLRequest::setURL(const std::string& url)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
mDetail->mURL = url;
|
||||
}
|
||||
|
||||
|
|
@ -190,7 +183,6 @@ std::string LLURLRequest::getURL() const
|
|||
|
||||
void LLURLRequest::addHeader(const char* header)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
mDetail->mCurlRequest->slist_append(header);
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +194,6 @@ void LLURLRequest::setBodyLimit(U32 size)
|
|||
|
||||
void LLURLRequest::setCallback(LLURLRequestComplete* callback)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
mCompletionCallback = callback;
|
||||
mDetail->mCurlRequest->setHeaderCallback(&headerCallback, (void*)callback);
|
||||
}
|
||||
|
|
@ -267,8 +258,6 @@ LLIOPipe::EStatus LLURLRequest::handleError(
|
|||
LLIOPipe::EStatus status,
|
||||
LLPumpIO* pump)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
|
||||
if(!isValid())
|
||||
{
|
||||
return STATUS_EXPIRED ;
|
||||
|
|
@ -302,7 +291,6 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
|
|||
{
|
||||
LLFastTimer t(FTM_PROCESS_URL_REQUEST);
|
||||
PUMP_DEBUG;
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
//llinfos << "LLURLRequest::process_impl()" << llendl;
|
||||
if (!buffer) return STATUS_ERROR;
|
||||
|
||||
|
|
@ -368,7 +356,8 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
|
|||
}
|
||||
}
|
||||
|
||||
while(1)
|
||||
bool keep_looping = true;
|
||||
while(keep_looping)
|
||||
{
|
||||
CURLcode result;
|
||||
|
||||
|
|
@ -420,8 +409,9 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
|
|||
case CURLE_FAILED_INIT:
|
||||
case CURLE_COULDNT_CONNECT:
|
||||
status = STATUS_NO_CONNECTION;
|
||||
keep_looping = false;
|
||||
break;
|
||||
default:
|
||||
default: // CURLE_URL_MALFORMAT
|
||||
llwarns << "URLRequest Error: " << result
|
||||
<< ", "
|
||||
<< LLCurl::strerror(result)
|
||||
|
|
@ -429,6 +419,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
|
|||
<< (mDetail->mURL.empty() ? "<EMPTY URL>" : mDetail->mURL)
|
||||
<< llendl;
|
||||
status = STATUS_ERROR;
|
||||
keep_looping = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -455,7 +446,6 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
|
|||
|
||||
void LLURLRequest::initialize()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
mState = STATE_INITIALIZED;
|
||||
mDetail = new LLURLRequestDetail;
|
||||
|
||||
|
|
@ -476,7 +466,6 @@ bool LLURLRequest::configure()
|
|||
{
|
||||
LLFastTimer t(FTM_URL_REQUEST_CONFIGURE);
|
||||
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
bool rv = false;
|
||||
S32 bytes = mDetail->mResponseBuffer->countAfter(
|
||||
mDetail->mChannels.in(),
|
||||
|
|
@ -556,7 +545,6 @@ size_t LLURLRequest::downCallback(
|
|||
size_t nmemb,
|
||||
void* user)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
LLURLRequest* req = (LLURLRequest*)user;
|
||||
if(STATE_WAITING_FOR_RESPONSE == req->mState)
|
||||
{
|
||||
|
|
@ -592,7 +580,6 @@ size_t LLURLRequest::upCallback(
|
|||
size_t nmemb,
|
||||
void* user)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
LLURLRequest* req = (LLURLRequest*)user;
|
||||
S32 bytes = llmin(
|
||||
(S32)(size * nmemb),
|
||||
|
|
@ -690,7 +677,6 @@ LLIOPipe::EStatus LLContextURLExtractor::process_impl(
|
|||
{
|
||||
LLFastTimer t(FTM_PROCESS_URL_EXTRACTOR);
|
||||
PUMP_DEBUG;
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
// The destination host is in the context.
|
||||
if(context.isUndefined() || !mRequest)
|
||||
{
|
||||
|
|
@ -718,13 +704,11 @@ LLIOPipe::EStatus LLContextURLExtractor::process_impl(
|
|||
LLURLRequestComplete::LLURLRequestComplete() :
|
||||
mRequestStatus(LLIOPipe::STATUS_ERROR)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
}
|
||||
|
||||
// virtual
|
||||
LLURLRequestComplete::~LLURLRequestComplete()
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
}
|
||||
|
||||
//virtual
|
||||
|
|
@ -763,7 +747,6 @@ void LLURLRequestComplete::noResponse()
|
|||
|
||||
void LLURLRequestComplete::responseStatus(LLIOPipe::EStatus status)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
|
||||
mRequestStatus = status;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -886,8 +886,17 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
std::string expanded_filename = gDirUtilp->getExpandedFilename( local_path, local_filename );
|
||||
// If we want to use a special path (e.g. LL_PATH_CACHE), we want to make sure we create the
|
||||
// proper expanded filename.
|
||||
std::string expanded_filename;
|
||||
if (local_path != LL_PATH_NONE)
|
||||
{
|
||||
expanded_filename = gDirUtilp->getExpandedFilename( local_path, local_filename );
|
||||
}
|
||||
else
|
||||
{
|
||||
expanded_filename = local_filename;
|
||||
}
|
||||
llinfos << "starting file transfer: " << expanded_filename << " to " << mesgsys->getSender() << llendl;
|
||||
|
||||
BOOL delete_local_on_completion = FALSE;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@
|
|||
#include "v3math.h"
|
||||
#include "v4math.h"
|
||||
#include "lltransfertargetvfile.h"
|
||||
#include "llmemtype.h"
|
||||
|
||||
// Constants
|
||||
//const char* MESSAGE_LOG_FILENAME = "message.log";
|
||||
|
|
@ -793,7 +792,6 @@ S32 LLMessageSystem::getReceiveBytes() const
|
|||
|
||||
void LLMessageSystem::processAcks()
|
||||
{
|
||||
LLMemType mt_pa(LLMemType::MTYPE_MESSAGE_PROCESS_ACKS);
|
||||
F64 mt_sec = getMessageTimeSeconds();
|
||||
{
|
||||
gTransferManager.updateTransfers();
|
||||
|
|
@ -4020,7 +4018,6 @@ void LLMessageSystem::setTimeDecodesSpamThreshold( F32 seconds )
|
|||
// TODO: babbage: move gServicePump in to LLMessageSystem?
|
||||
bool LLMessageSystem::checkAllMessages(S64 frame_count, LLPumpIO* http_pump)
|
||||
{
|
||||
LLMemType mt_cam(LLMemType::MTYPE_MESSAGE_CHECK_ALL);
|
||||
if(checkMessages(frame_count))
|
||||
{
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
namespace tut
|
||||
{
|
||||
LLSD storage;
|
||||
|
||||
|
||||
class LLSDStorageNode : public LLHTTPNode
|
||||
{
|
||||
public:
|
||||
|
|
@ -82,8 +82,13 @@ namespace tut
|
|||
{
|
||||
public:
|
||||
HTTPClientTestData():
|
||||
local_server(STRINGIZE("http://127.0.0.1:" << getenv("PORT") << "/"))
|
||||
PORT(getenv("PORT")),
|
||||
// Turning NULL PORT into empty string doesn't make things work;
|
||||
// that's just to keep this initializer from blowing up. We test
|
||||
// PORT separately in the constructor body.
|
||||
local_server(STRINGIZE("http://127.0.0.1:" << (PORT? PORT : "") << "/"))
|
||||
{
|
||||
ensure("Set environment variable PORT to local test server port", PORT);
|
||||
apr_pool_create(&mPool, NULL);
|
||||
LLCurl::initClass(false);
|
||||
mServerPump = new LLPumpIO(mPool);
|
||||
|
|
@ -91,7 +96,7 @@ namespace tut
|
|||
|
||||
LLHTTPClient::setPump(*mClientPump);
|
||||
}
|
||||
|
||||
|
||||
~HTTPClientTestData()
|
||||
{
|
||||
delete mServerPump;
|
||||
|
|
@ -107,7 +112,7 @@ namespace tut
|
|||
LLHTTPStandardServices::useServices();
|
||||
LLHTTPRegistrar::buildAllServices(root);
|
||||
}
|
||||
|
||||
|
||||
void runThePump(float timeout = 100.0f)
|
||||
{
|
||||
LLTimer timer;
|
||||
|
|
@ -134,6 +139,7 @@ namespace tut
|
|||
mServerPump = NULL;
|
||||
}
|
||||
|
||||
const char* const PORT;
|
||||
const std::string local_server;
|
||||
|
||||
private:
|
||||
|
|
@ -148,11 +154,11 @@ namespace tut
|
|||
{
|
||||
std::string msg =
|
||||
llformat("error() called when not expected, status %d",
|
||||
mStatus);
|
||||
mStatus);
|
||||
fail(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ensureStatusError()
|
||||
{
|
||||
if (!mSawError)
|
||||
|
|
@ -160,7 +166,7 @@ namespace tut
|
|||
fail("error() wasn't called");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LLSD getResult()
|
||||
{
|
||||
return mResult;
|
||||
|
|
@ -169,7 +175,7 @@ namespace tut
|
|||
{
|
||||
return mHeader;
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
bool mSawError;
|
||||
U32 mStatus;
|
||||
|
|
@ -187,18 +193,18 @@ namespace tut
|
|||
: mClient(client)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
static Result* build(HTTPClientTestData& client)
|
||||
{
|
||||
return new Result(client);
|
||||
}
|
||||
|
||||
|
||||
~Result()
|
||||
{
|
||||
mClient.mResultDeleted = true;
|
||||
}
|
||||
|
||||
|
||||
virtual void error(U32 status, const std::string& reason)
|
||||
{
|
||||
mClient.mSawError = true;
|
||||
|
|
@ -216,7 +222,7 @@ namespace tut
|
|||
const LLSD& content)
|
||||
{
|
||||
LLHTTPClient::Responder::completed(status, reason, content);
|
||||
|
||||
|
||||
mClient.mSawCompleted = true;
|
||||
}
|
||||
|
||||
|
|
@ -244,12 +250,12 @@ namespace tut
|
|||
mResult.clear();
|
||||
mHeader.clear();
|
||||
mResultDeleted = false;
|
||||
|
||||
|
||||
return Result::build(*this);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
typedef test_group<HTTPClientTestData> HTTPClientTestGroup;
|
||||
typedef HTTPClientTestGroup::object HTTPClientTestObject;
|
||||
HTTPClientTestGroup httpClientTestGroup("http_client");
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
#include "linden_common.h"
|
||||
|
||||
#include "material_codes.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llerror.h"
|
||||
#include "message.h"
|
||||
#include "llprimitive.h"
|
||||
|
|
@ -189,7 +188,6 @@ void LLPrimitive::clearTextureList()
|
|||
// static
|
||||
LLPrimitive *LLPrimitive::createPrimitive(LLPCode p_code)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_PRIMITIVE);
|
||||
LLPrimitive *retval = new LLPrimitive();
|
||||
|
||||
if (retval)
|
||||
|
|
@ -207,7 +205,6 @@ LLPrimitive *LLPrimitive::createPrimitive(LLPCode p_code)
|
|||
//===============================================================
|
||||
void LLPrimitive::init_primitive(LLPCode p_code)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_PRIMITIVE);
|
||||
clearTextureList();
|
||||
mPrimitiveCode = p_code;
|
||||
}
|
||||
|
|
@ -705,7 +702,6 @@ S32 face_index_from_id(LLFaceID face_ID, const std::vector<LLProfile::Face>& fac
|
|||
|
||||
BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_VOLUME);
|
||||
LLVolume *volumep;
|
||||
if (unique_volume)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include "llprimtexturelist.h"
|
||||
#include "lltextureentry.h"
|
||||
#include "llmemtype.h"
|
||||
|
||||
// static
|
||||
//int (TMyClass::*pt2Member)(float, char, char) = NULL; // C++
|
||||
|
|
@ -367,7 +366,6 @@ S32 LLPrimTextureList::size() const
|
|||
// sets the size of the mEntryList container
|
||||
void LLPrimTextureList::setSize(S32 new_size)
|
||||
{
|
||||
LLMemType m1(LLMemType::MTYPE_PRIMITIVE);
|
||||
if (new_size < 0)
|
||||
{
|
||||
new_size = 0;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
#include "llmath.h"
|
||||
#include "m4math.h"
|
||||
#include "llstring.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llstacktrace.h"
|
||||
|
||||
#include "llglheaders.h"
|
||||
|
|
@ -2323,7 +2322,6 @@ void LLGLNamePool::release(GLuint name)
|
|||
//static
|
||||
void LLGLNamePool::upkeepPools()
|
||||
{
|
||||
LLMemType mt(LLMemType::MTYPE_UPKEEP_POOLS);
|
||||
for (tracker_t::instance_iter iter = beginInstances(); iter != endInstances(); ++iter)
|
||||
{
|
||||
LLGLNamePool & pool = *iter;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include "llvertexbuffer.h"
|
||||
// #include "llrender.h"
|
||||
#include "llglheaders.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llrender.h"
|
||||
#include "llvector4a.h"
|
||||
#include "llshadermgr.h"
|
||||
|
|
@ -870,7 +869,6 @@ void LLVertexBuffer::unbind()
|
|||
//static
|
||||
void LLVertexBuffer::cleanupClass()
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_CLEANUP_CLASS);
|
||||
unbind();
|
||||
|
||||
sStreamIBOPool.cleanup();
|
||||
|
|
@ -951,8 +949,6 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
|
|||
mMappable(false),
|
||||
mFence(NULL)
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_CONSTRUCTOR);
|
||||
|
||||
mMappable = (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping);
|
||||
|
||||
//zero out offsets
|
||||
|
|
@ -1012,7 +1008,6 @@ S32 LLVertexBuffer::getSize() const
|
|||
//virtual
|
||||
LLVertexBuffer::~LLVertexBuffer()
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTRUCTOR);
|
||||
destroyGLBuffer();
|
||||
destroyGLIndices();
|
||||
|
||||
|
|
@ -1132,8 +1127,6 @@ void LLVertexBuffer::releaseIndices()
|
|||
|
||||
void LLVertexBuffer::createGLBuffer(U32 size)
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_CREATE_VERTICES);
|
||||
|
||||
if (mGLBuffer)
|
||||
{
|
||||
destroyGLBuffer();
|
||||
|
|
@ -1163,8 +1156,6 @@ void LLVertexBuffer::createGLBuffer(U32 size)
|
|||
|
||||
void LLVertexBuffer::createGLIndices(U32 size)
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_CREATE_INDICES);
|
||||
|
||||
if (mGLIndices)
|
||||
{
|
||||
destroyGLIndices();
|
||||
|
|
@ -1199,7 +1190,6 @@ void LLVertexBuffer::createGLIndices(U32 size)
|
|||
|
||||
void LLVertexBuffer::destroyGLBuffer()
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTROY_BUFFER);
|
||||
if (mGLBuffer)
|
||||
{
|
||||
if (mMappedDataUsingVBOs)
|
||||
|
|
@ -1220,7 +1210,6 @@ void LLVertexBuffer::destroyGLBuffer()
|
|||
|
||||
void LLVertexBuffer::destroyGLIndices()
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTROY_INDICES);
|
||||
if (mGLIndices)
|
||||
{
|
||||
if (mMappedIndexDataUsingVBOs)
|
||||
|
|
@ -1241,8 +1230,6 @@ void LLVertexBuffer::destroyGLIndices()
|
|||
|
||||
void LLVertexBuffer::updateNumVerts(S32 nverts)
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_UPDATE_VERTS);
|
||||
|
||||
llassert(nverts >= 0);
|
||||
|
||||
if (nverts > 65536)
|
||||
|
|
@ -1265,8 +1252,6 @@ void LLVertexBuffer::updateNumVerts(S32 nverts)
|
|||
|
||||
void LLVertexBuffer::updateNumIndices(S32 nindices)
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_UPDATE_INDICES);
|
||||
|
||||
llassert(nindices >= 0);
|
||||
|
||||
U32 needed_size = sizeof(U16) * nindices;
|
||||
|
|
@ -1283,8 +1268,6 @@ void LLVertexBuffer::updateNumIndices(S32 nindices)
|
|||
|
||||
void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_ALLOCATE_BUFFER);
|
||||
|
||||
stop_glerror();
|
||||
|
||||
if (nverts < 0 || nindices < 0 ||
|
||||
|
|
@ -1435,8 +1418,6 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
|
|||
llassert(newnverts >= 0);
|
||||
llassert(newnindices >= 0);
|
||||
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_RESIZE_BUFFER);
|
||||
|
||||
updateNumVerts(newnverts);
|
||||
updateNumIndices(newnindices);
|
||||
|
||||
|
|
@ -1484,7 +1465,6 @@ static LLFastTimer::DeclareTimer FTM_VBO_MAP_BUFFER("VBO Map");
|
|||
volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_range)
|
||||
{
|
||||
bindGLBuffer(true);
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_MAP_BUFFER);
|
||||
if (mFinal)
|
||||
{
|
||||
llerrs << "LLVertexBuffer::mapVeretxBuffer() called on a finalized buffer." << llendl;
|
||||
|
|
@ -1533,7 +1513,6 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
|
|||
|
||||
if (!mVertexLocked)
|
||||
{
|
||||
LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_VERTICES);
|
||||
mVertexLocked = true;
|
||||
sMappedCount++;
|
||||
stop_glerror();
|
||||
|
|
@ -1664,7 +1643,6 @@ static LLFastTimer::DeclareTimer FTM_VBO_MAP_INDEX("IBO Map");
|
|||
|
||||
volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_MAP_BUFFER);
|
||||
bindGLIndices(true);
|
||||
if (mFinal)
|
||||
{
|
||||
|
|
@ -1711,8 +1689,6 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
|
|||
|
||||
if (!mIndexLocked)
|
||||
{
|
||||
LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_INDICES);
|
||||
|
||||
mIndexLocked = true;
|
||||
sMappedCount++;
|
||||
stop_glerror();
|
||||
|
|
@ -1835,7 +1811,6 @@ static LLFastTimer::DeclareTimer FTM_IBO_FLUSH_RANGE("Flush IBO Range");
|
|||
|
||||
void LLVertexBuffer::unmapBuffer()
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_UNMAP_BUFFER);
|
||||
if (!useVBOs())
|
||||
{
|
||||
return; //nothing to unmap
|
||||
|
|
@ -2189,7 +2164,6 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||
{
|
||||
flush();
|
||||
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_SET_BUFFER);
|
||||
//set up pointers if the data mask is different ...
|
||||
bool setup = (sLastMask != data_mask);
|
||||
|
||||
|
|
@ -2331,7 +2305,6 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||
// virtual (default)
|
||||
void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_SETUP_VERTEX_BUFFER);
|
||||
stop_glerror();
|
||||
volatile U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
|
||||
|
||||
|
|
|
|||
|
|
@ -1105,17 +1105,26 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user)
|
|||
const LLRect old_rect = getRect();
|
||||
LLView::handleReshape(new_rect, by_user);
|
||||
|
||||
if (by_user && !isMinimized())
|
||||
if (by_user && !getHost())
|
||||
{
|
||||
storeRectControl();
|
||||
mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
|
||||
LLRect screen_rect = calcScreenRect();
|
||||
mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
|
||||
static_cast<LLFloaterView*>(getParent())->adjustToFitScreen(this, !isMinimized());
|
||||
}
|
||||
|
||||
// if not minimized, adjust all snapped dependents to new shape
|
||||
if (!isMinimized())
|
||||
{
|
||||
if (by_user)
|
||||
{
|
||||
if (isDocked())
|
||||
{
|
||||
setDocked( false, false);
|
||||
}
|
||||
storeRectControl();
|
||||
mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
|
||||
LLRect screen_rect = calcScreenRect();
|
||||
mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
|
||||
}
|
||||
|
||||
// gather all snapped dependents
|
||||
for(handle_set_iter_t dependent_it = mDependents.begin();
|
||||
dependent_it != mDependents.end(); ++dependent_it)
|
||||
|
|
@ -1711,56 +1720,10 @@ void LLFloater::onClickHelp( LLFloater* self )
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
LLFloater* LLFloater::getClosableFloaterFromFocus()
|
||||
{
|
||||
LLFloater* focused_floater = NULL;
|
||||
LLInstanceTracker<LLFloater>::instance_iter it = beginInstances();
|
||||
LLInstanceTracker<LLFloater>::instance_iter end_it = endInstances();
|
||||
for (; it != end_it; ++it)
|
||||
{
|
||||
if (it->hasFocus())
|
||||
{
|
||||
LLFloater& floater = *it;
|
||||
focused_floater = &floater;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (it == endInstances())
|
||||
{
|
||||
// nothing found, return
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// The focused floater may not be closable,
|
||||
// Find and close a parental floater that is closeable, if any.
|
||||
LLFloater* prev_floater = NULL;
|
||||
for(LLFloater* floater_to_close = focused_floater;
|
||||
NULL != floater_to_close;
|
||||
floater_to_close = gFloaterView->getParentFloater(floater_to_close))
|
||||
{
|
||||
if(floater_to_close->isCloseable())
|
||||
{
|
||||
return floater_to_close;
|
||||
}
|
||||
|
||||
// If floater has as parent root view
|
||||
// gFloaterView->getParentFloater(floater_to_close) returns
|
||||
// the same floater_to_close, so we need to check this.
|
||||
if (prev_floater == floater_to_close) {
|
||||
break;
|
||||
}
|
||||
prev_floater = floater_to_close;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloater::closeFocusedFloater()
|
||||
void LLFloater::closeFrontmostFloater()
|
||||
{
|
||||
LLFloater* floater_to_close = LLFloater::getClosableFloaterFromFocus();
|
||||
LLFloater* floater_to_close = gFloaterView->getFrontmostClosableFloater();
|
||||
if(floater_to_close)
|
||||
{
|
||||
floater_to_close->closeFloater();
|
||||
|
|
@ -2478,6 +2441,24 @@ void LLFloaterView::highlightFocusedFloater()
|
|||
}
|
||||
}
|
||||
|
||||
LLFloater* LLFloaterView::getFrontmostClosableFloater()
|
||||
{
|
||||
child_list_const_iter_t child_it;
|
||||
LLFloater* frontmost_floater = NULL;
|
||||
|
||||
for ( child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
|
||||
{
|
||||
frontmost_floater = (LLFloater *)(*child_it);
|
||||
|
||||
if (frontmost_floater->isInVisibleChain() && frontmost_floater->isCloseable())
|
||||
{
|
||||
return frontmost_floater;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void LLFloaterView::unhighlightFocusedFloater()
|
||||
{
|
||||
for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
|
||||
|
|
|
|||
|
|
@ -325,12 +325,10 @@ public:
|
|||
|
||||
virtual void setTornOff(bool torn_off) { mTornOff = torn_off; }
|
||||
|
||||
// Return a closeable floater, if any, given the current focus.
|
||||
static LLFloater* getClosableFloaterFromFocus();
|
||||
|
||||
// Close the floater returned by getClosableFloaterFromFocus() and
|
||||
// Close the floater returned by getFrontmostClosableFloater() and
|
||||
// handle refocusing.
|
||||
static void closeFocusedFloater();
|
||||
static void closeFrontmostFloater();
|
||||
|
||||
// LLNotification::Params contextualNotification(const std::string& name)
|
||||
// {
|
||||
|
|
@ -559,6 +557,7 @@ public:
|
|||
S32 getZOrder(LLFloater* child);
|
||||
|
||||
void setFloaterSnapView(LLHandle<LLView> snap_view) {mSnapView = snap_view; }
|
||||
LLFloater* getFrontmostClosableFloater();
|
||||
|
||||
private:
|
||||
void hiddenFloaterClosed(LLFloater* floater);
|
||||
|
|
|
|||
|
|
@ -1764,6 +1764,25 @@ bool LLMenuGL::addChild(LLView* view, S32 tab_group)
|
|||
return false;
|
||||
}
|
||||
|
||||
// Used in LLContextMenu and in LLTogleableMenu
|
||||
// to add an item of context menu branch
|
||||
bool LLMenuGL::addContextChild(LLView* view, S32 tab_group)
|
||||
{
|
||||
LLContextMenu* context = dynamic_cast<LLContextMenu*>(view);
|
||||
if (context)
|
||||
return appendContextSubMenu(context);
|
||||
|
||||
LLMenuItemSeparatorGL* separator = dynamic_cast<LLMenuItemSeparatorGL*>(view);
|
||||
if (separator)
|
||||
return append(separator);
|
||||
|
||||
LLMenuItemGL* item = dynamic_cast<LLMenuItemGL*>(view);
|
||||
if (item)
|
||||
return append(item);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLMenuGL::removeChild( LLView* ctrl)
|
||||
{
|
||||
// previously a dynamic_cast with if statement to check validity
|
||||
|
|
@ -2501,6 +2520,30 @@ BOOL LLMenuGL::appendMenu( LLMenuGL* menu )
|
|||
return success;
|
||||
}
|
||||
|
||||
// add a context menu branch
|
||||
BOOL LLMenuGL::appendContextSubMenu(LLMenuGL *menu)
|
||||
{
|
||||
if (menu == this)
|
||||
{
|
||||
llerrs << "Can't attach a context menu to itself" << llendl;
|
||||
}
|
||||
|
||||
LLContextMenuBranch *item;
|
||||
LLContextMenuBranch::Params p;
|
||||
p.name = menu->getName();
|
||||
p.label = menu->getLabel();
|
||||
p.branch = (LLContextMenu *)menu;
|
||||
p.enabled_color=LLUIColorTable::instance().getColor("MenuItemEnabledColor");
|
||||
p.disabled_color=LLUIColorTable::instance().getColor("MenuItemDisabledColor");
|
||||
p.highlight_bg_color=LLUIColorTable::instance().getColor("MenuItemHighlightBgColor");
|
||||
p.highlight_fg_color=LLUIColorTable::instance().getColor("MenuItemHighlightFgColor");
|
||||
|
||||
item = LLUICtrlFactory::create<LLContextMenuBranch>(p);
|
||||
LLMenuGL::sMenuContainer->addChild(item->getBranch());
|
||||
|
||||
return append( item );
|
||||
}
|
||||
|
||||
void LLMenuGL::setEnabledSubMenus(BOOL enable)
|
||||
{
|
||||
setEnabled(enable);
|
||||
|
|
@ -3725,39 +3768,6 @@ void LLTearOffMenu::closeTearOff()
|
|||
mMenu->setDropShadowed(TRUE);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class LLContextMenuBranch
|
||||
// A branch to another context menu
|
||||
//-----------------------------------------------------------------------------
|
||||
class LLContextMenuBranch : public LLMenuItemGL
|
||||
{
|
||||
public:
|
||||
struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params>
|
||||
{
|
||||
Mandatory<LLContextMenu*> branch;
|
||||
};
|
||||
|
||||
LLContextMenuBranch(const Params&);
|
||||
|
||||
virtual ~LLContextMenuBranch()
|
||||
{}
|
||||
|
||||
// called to rebuild the draw label
|
||||
virtual void buildDrawLabel( void );
|
||||
|
||||
// onCommit() - do the primary funcationality of the menu item.
|
||||
virtual void onCommit( void );
|
||||
|
||||
LLContextMenu* getBranch() { return mBranch.get(); }
|
||||
void setHighlight( BOOL highlight );
|
||||
|
||||
protected:
|
||||
void showSubMenu();
|
||||
|
||||
LLHandle<LLContextMenu> mBranch;
|
||||
};
|
||||
|
||||
LLContextMenuBranch::LLContextMenuBranch(const LLContextMenuBranch::Params& p)
|
||||
: LLMenuItemGL(p),
|
||||
mBranch( p.branch()->getHandle() )
|
||||
|
|
@ -4034,44 +4044,8 @@ void LLContextMenu::draw()
|
|||
LLMenuGL::draw();
|
||||
}
|
||||
|
||||
BOOL LLContextMenu::appendContextSubMenu(LLContextMenu *menu)
|
||||
{
|
||||
|
||||
if (menu == this)
|
||||
{
|
||||
llerrs << "Can't attach a context menu to itself" << llendl;
|
||||
}
|
||||
|
||||
LLContextMenuBranch *item;
|
||||
LLContextMenuBranch::Params p;
|
||||
p.name = menu->getName();
|
||||
p.label = menu->getLabel();
|
||||
p.branch = menu;
|
||||
p.enabled_color=LLUIColorTable::instance().getColor("MenuItemEnabledColor");
|
||||
p.disabled_color=LLUIColorTable::instance().getColor("MenuItemDisabledColor");
|
||||
p.highlight_bg_color=LLUIColorTable::instance().getColor("MenuItemHighlightBgColor");
|
||||
p.highlight_fg_color=LLUIColorTable::instance().getColor("MenuItemHighlightFgColor");
|
||||
|
||||
item = LLUICtrlFactory::create<LLContextMenuBranch>(p);
|
||||
LLMenuGL::sMenuContainer->addChild(item->getBranch());
|
||||
|
||||
return append( item );
|
||||
}
|
||||
|
||||
bool LLContextMenu::addChild(LLView* view, S32 tab_group)
|
||||
{
|
||||
LLContextMenu* context = dynamic_cast<LLContextMenu*>(view);
|
||||
if (context)
|
||||
return appendContextSubMenu(context);
|
||||
|
||||
LLMenuItemSeparatorGL* separator = dynamic_cast<LLMenuItemSeparatorGL*>(view);
|
||||
if (separator)
|
||||
return append(separator);
|
||||
|
||||
LLMenuItemGL* item = dynamic_cast<LLMenuItemGL*>(view);
|
||||
if (item)
|
||||
return append(item);
|
||||
|
||||
return false;
|
||||
return addContextChild(view, tab_group);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -519,6 +519,9 @@ public:
|
|||
void resetScrollPositionOnShow(bool reset_scroll_pos) { mResetScrollPositionOnShow = reset_scroll_pos; }
|
||||
bool isScrollPositionOnShowReset() { return mResetScrollPositionOnShow; }
|
||||
|
||||
// add a context menu branch
|
||||
BOOL appendContextSubMenu(LLMenuGL *menu);
|
||||
|
||||
protected:
|
||||
void createSpilloverBranch();
|
||||
void cleanupSpilloverBranch();
|
||||
|
|
@ -528,6 +531,10 @@ protected:
|
|||
// add a menu - this will create a cascading menu
|
||||
virtual BOOL appendMenu( LLMenuGL* menu );
|
||||
|
||||
// Used in LLContextMenu and in LLTogleableMenu
|
||||
// to add an item of context menu branch
|
||||
bool addContextChild(LLView* view, S32 tab_group);
|
||||
|
||||
// TODO: create accessor methods for these?
|
||||
typedef std::list< LLMenuItemGL* > item_list_t;
|
||||
item_list_t mItems;
|
||||
|
|
@ -679,8 +686,6 @@ public:
|
|||
|
||||
virtual bool addChild (LLView* view, S32 tab_group = 0);
|
||||
|
||||
BOOL appendContextSubMenu(LLContextMenu *menu);
|
||||
|
||||
LLHandle<LLContextMenu> getHandle() { return getDerivedHandle<LLContextMenu>(); }
|
||||
|
||||
LLView* getSpawningView() const { return mSpawningViewHandle.get(); }
|
||||
|
|
@ -694,6 +699,38 @@ protected:
|
|||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// class LLContextMenuBranch
|
||||
// A branch to another context menu
|
||||
//-----------------------------------------------------------------------------
|
||||
class LLContextMenuBranch : public LLMenuItemGL
|
||||
{
|
||||
public:
|
||||
struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params>
|
||||
{
|
||||
Mandatory<LLContextMenu*> branch;
|
||||
};
|
||||
|
||||
LLContextMenuBranch(const Params&);
|
||||
|
||||
virtual ~LLContextMenuBranch()
|
||||
{}
|
||||
|
||||
// called to rebuild the draw label
|
||||
virtual void buildDrawLabel( void );
|
||||
|
||||
// onCommit() - do the primary funcationality of the menu item.
|
||||
virtual void onCommit( void );
|
||||
|
||||
LLContextMenu* getBranch() { return mBranch.get(); }
|
||||
void setHighlight( BOOL highlight );
|
||||
|
||||
protected:
|
||||
void showSubMenu();
|
||||
|
||||
LLHandle<LLContextMenu> mBranch;
|
||||
};
|
||||
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLMenuBarGL
|
||||
|
|
|
|||
|
|
@ -1116,6 +1116,11 @@ bool LLNotificationChannel::isEmpty() const
|
|||
return mItems.empty();
|
||||
}
|
||||
|
||||
S32 LLNotificationChannel::size() const
|
||||
{
|
||||
return mItems.size();
|
||||
}
|
||||
|
||||
LLNotificationChannel::Iterator LLNotificationChannel::begin()
|
||||
{
|
||||
return mItems.begin();
|
||||
|
|
|
|||
|
|
@ -813,6 +813,7 @@ public:
|
|||
std::string getParentChannelName() { return mParent; }
|
||||
|
||||
bool isEmpty() const;
|
||||
S32 size() const;
|
||||
|
||||
Iterator begin();
|
||||
Iterator end();
|
||||
|
|
|
|||
|
|
@ -139,13 +139,6 @@ BOOL LLResizeBar::handleHover(S32 x, S32 y, MASK mask)
|
|||
|
||||
if( valid_rect.localPointInRect( screen_x, screen_y ) && mResizingView )
|
||||
{
|
||||
// undock floater when user resize it
|
||||
LLFloater* parent = dynamic_cast<LLFloater*>( getParent());
|
||||
if (parent && parent->isDocked())
|
||||
{
|
||||
parent->setDocked( false, false);
|
||||
}
|
||||
|
||||
// Resize the parent
|
||||
LLRect orig_rect = mResizingView->getRect();
|
||||
LLRect scaled_rect = orig_rect;
|
||||
|
|
@ -219,20 +212,66 @@ BOOL LLResizeBar::handleHover(S32 x, S32 y, MASK mask)
|
|||
|
||||
// update last valid mouse cursor position based on resized view's actual size
|
||||
LLRect new_rect = mResizingView->getRect();
|
||||
|
||||
switch(mSide)
|
||||
{
|
||||
case LEFT:
|
||||
mDragLastScreenX += new_rect.mLeft - orig_rect.mLeft;
|
||||
{
|
||||
S32 actual_delta_x = new_rect.mLeft - orig_rect.mLeft;
|
||||
if (actual_delta_x != delta_x)
|
||||
{
|
||||
// restore everything by left
|
||||
new_rect.mBottom = orig_rect.mBottom;
|
||||
new_rect.mTop = orig_rect.mTop;
|
||||
new_rect.mRight = orig_rect.mRight;
|
||||
mResizingView->setShape(new_rect, true);
|
||||
}
|
||||
mDragLastScreenX += actual_delta_x;
|
||||
|
||||
break;
|
||||
}
|
||||
case RIGHT:
|
||||
{
|
||||
S32 actual_delta_x = new_rect.mRight - orig_rect.mRight;
|
||||
if (actual_delta_x != delta_x)
|
||||
{
|
||||
// restore everything by left
|
||||
new_rect.mBottom = orig_rect.mBottom;
|
||||
new_rect.mTop = orig_rect.mTop;
|
||||
new_rect.mLeft = orig_rect.mLeft;
|
||||
mResizingView->setShape(new_rect, true);
|
||||
}
|
||||
mDragLastScreenX += new_rect.mRight - orig_rect.mRight;
|
||||
break;
|
||||
}
|
||||
case TOP:
|
||||
{
|
||||
S32 actual_delta_y = new_rect.mTop - orig_rect.mTop;
|
||||
if (actual_delta_y != delta_y)
|
||||
{
|
||||
// restore everything by left
|
||||
new_rect.mBottom = orig_rect.mBottom;
|
||||
new_rect.mLeft = orig_rect.mLeft;
|
||||
new_rect.mRight = orig_rect.mRight;
|
||||
mResizingView->setShape(new_rect, true);
|
||||
}
|
||||
mDragLastScreenY += new_rect.mTop - orig_rect.mTop;
|
||||
break;
|
||||
}
|
||||
case BOTTOM:
|
||||
{
|
||||
S32 actual_delta_y = new_rect.mBottom - orig_rect.mBottom;
|
||||
if (actual_delta_y != delta_y)
|
||||
{
|
||||
// restore everything by left
|
||||
new_rect.mTop = orig_rect.mTop;
|
||||
new_rect.mLeft = orig_rect.mLeft;
|
||||
new_rect.mRight = orig_rect.mRight;
|
||||
mResizingView->setShape(new_rect, true);
|
||||
}
|
||||
mDragLastScreenY += new_rect.mBottom- orig_rect.mBottom;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -257,23 +257,65 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask)
|
|||
|
||||
// update last valid mouse cursor position based on resized view's actual size
|
||||
LLRect new_rect = resizing_view->getRect();
|
||||
S32 actual_delta_x = 0;
|
||||
S32 actual_delta_y = 0;
|
||||
switch(mCorner)
|
||||
{
|
||||
case LEFT_TOP:
|
||||
mDragLastScreenX += new_rect.mLeft - orig_rect.mLeft;
|
||||
mDragLastScreenY += new_rect.mTop - orig_rect.mTop;
|
||||
actual_delta_x = new_rect.mLeft - orig_rect.mLeft;
|
||||
actual_delta_y = new_rect.mTop - orig_rect.mTop;
|
||||
if (actual_delta_x != delta_x
|
||||
|| actual_delta_y != delta_y)
|
||||
{
|
||||
new_rect.mRight = orig_rect.mRight;
|
||||
new_rect.mBottom = orig_rect.mBottom;
|
||||
resizing_view->setShape(new_rect, true);
|
||||
}
|
||||
|
||||
mDragLastScreenX += actual_delta_x;
|
||||
mDragLastScreenY += actual_delta_y;
|
||||
break;
|
||||
case LEFT_BOTTOM:
|
||||
mDragLastScreenX += new_rect.mLeft - orig_rect.mLeft;
|
||||
mDragLastScreenY += new_rect.mBottom- orig_rect.mBottom;
|
||||
actual_delta_x = new_rect.mLeft - orig_rect.mLeft;
|
||||
actual_delta_y = new_rect.mBottom - orig_rect.mBottom;
|
||||
if (actual_delta_x != delta_x
|
||||
|| actual_delta_y != delta_y)
|
||||
{
|
||||
new_rect.mRight = orig_rect.mRight;
|
||||
new_rect.mTop = orig_rect.mTop;
|
||||
resizing_view->setShape(new_rect, true);
|
||||
}
|
||||
|
||||
mDragLastScreenX += actual_delta_x;
|
||||
mDragLastScreenY += actual_delta_y;
|
||||
break;
|
||||
case RIGHT_TOP:
|
||||
mDragLastScreenX += new_rect.mRight - orig_rect.mRight;
|
||||
mDragLastScreenY += new_rect.mTop - orig_rect.mTop;
|
||||
actual_delta_x = new_rect.mRight - orig_rect.mRight;
|
||||
actual_delta_y = new_rect.mTop - orig_rect.mTop;
|
||||
if (actual_delta_x != delta_x
|
||||
|| actual_delta_y != delta_y)
|
||||
{
|
||||
new_rect.mLeft = orig_rect.mLeft;
|
||||
new_rect.mBottom = orig_rect.mBottom;
|
||||
resizing_view->setShape(new_rect, true);
|
||||
}
|
||||
|
||||
mDragLastScreenX += actual_delta_x;
|
||||
mDragLastScreenY += actual_delta_y;
|
||||
break;
|
||||
case RIGHT_BOTTOM:
|
||||
mDragLastScreenX += new_rect.mRight - orig_rect.mRight;
|
||||
mDragLastScreenY += new_rect.mBottom- orig_rect.mBottom;
|
||||
actual_delta_x = new_rect.mRight - orig_rect.mRight;
|
||||
actual_delta_y = new_rect.mBottom - orig_rect.mBottom;
|
||||
if (actual_delta_x != delta_x
|
||||
|| actual_delta_y != delta_y)
|
||||
{
|
||||
new_rect.mLeft = orig_rect.mLeft;
|
||||
new_rect.mTop = orig_rect.mTop;
|
||||
resizing_view->setShape(new_rect, true);
|
||||
}
|
||||
|
||||
mDragLastScreenX += actual_delta_x;
|
||||
mDragLastScreenY += actual_delta_y;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -239,7 +239,8 @@ LLTextEditor::Params::Params()
|
|||
show_line_numbers("show_line_numbers", false),
|
||||
default_color("default_color"),
|
||||
commit_on_focus_lost("commit_on_focus_lost", false),
|
||||
show_context_menu("show_context_menu")
|
||||
show_context_menu("show_context_menu"),
|
||||
enable_tooltip_paste("enable_tooltip_paste")
|
||||
{
|
||||
addSynonym(prevalidate_callback, "text_type");
|
||||
}
|
||||
|
|
@ -258,7 +259,8 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
|
|||
mTabsToNextField(p.ignore_tab),
|
||||
mPrevalidateFunc(p.prevalidate_callback()),
|
||||
mContextMenu(NULL),
|
||||
mShowContextMenu(p.show_context_menu)
|
||||
mShowContextMenu(p.show_context_menu),
|
||||
mEnableTooltipPaste(p.enable_tooltip_paste)
|
||||
{
|
||||
mSourceID.generate();
|
||||
|
||||
|
|
@ -1411,6 +1413,23 @@ void LLTextEditor::pasteHelper(bool is_primary)
|
|||
|
||||
// Clean up string (replace tabs and remove characters that our fonts don't support).
|
||||
LLWString clean_string(paste);
|
||||
cleanStringForPaste(clean_string);
|
||||
|
||||
// Insert the new text into the existing text.
|
||||
|
||||
//paste text with linebreaks.
|
||||
pasteTextWithLinebreaks(clean_string);
|
||||
|
||||
deselect();
|
||||
|
||||
onKeyStroke();
|
||||
mParseOnTheFly = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Clean up string (replace tabs and remove characters that our fonts don't support).
|
||||
void LLTextEditor::cleanStringForPaste(LLWString & clean_string)
|
||||
{
|
||||
LLWStringUtil::replaceTabsWithSpaces(clean_string, SPACES_PER_TAB);
|
||||
if( mAllowEmbeddedItems )
|
||||
{
|
||||
|
|
@ -1429,10 +1448,11 @@ void LLTextEditor::pasteHelper(bool is_primary)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Insert the new text into the existing text.
|
||||
|
||||
//paste text with linebreaks.
|
||||
void LLTextEditor::pasteTextWithLinebreaks(LLWString & clean_string)
|
||||
{
|
||||
std::basic_string<llwchar>::size_type start = 0;
|
||||
std::basic_string<llwchar>::size_type pos = clean_string.find('\n',start);
|
||||
|
||||
|
|
@ -1451,15 +1471,8 @@ void LLTextEditor::pasteHelper(bool is_primary)
|
|||
|
||||
std::basic_string<llwchar> str = std::basic_string<llwchar>(clean_string,start,clean_string.length()-start);
|
||||
setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr()));
|
||||
|
||||
deselect();
|
||||
|
||||
onKeyStroke();
|
||||
mParseOnTheFly = TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// copy selection to primary
|
||||
void LLTextEditor::copyPrimary()
|
||||
{
|
||||
|
|
@ -1680,19 +1693,50 @@ BOOL LLTextEditor::handleKeyHere(KEY key, MASK mask )
|
|||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (mReadOnly && mScroller)
|
||||
{
|
||||
handled = (mScroller && mScroller->handleKeyHere( key, mask ))
|
||||
|| handleSelectionKey(key, mask)
|
||||
|| handleControlKey(key, mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mEnableTooltipPaste &&
|
||||
LLToolTipMgr::instance().toolTipVisible() &&
|
||||
KEY_TAB == key)
|
||||
{ // Paste the first line of a tooltip into the editor
|
||||
std::string message;
|
||||
LLToolTipMgr::instance().getToolTipMessage(message);
|
||||
LLWString tool_tip_text(utf8str_to_wstring(message));
|
||||
|
||||
if (tool_tip_text.size() > 0)
|
||||
{
|
||||
// Delete any selected characters (the tooltip text replaces them)
|
||||
if(hasSelection())
|
||||
{
|
||||
deleteSelection(TRUE);
|
||||
}
|
||||
|
||||
std::basic_string<llwchar>::size_type pos = tool_tip_text.find('\n',0);
|
||||
if (pos != -1)
|
||||
{ // Extract the first line of the tooltip
|
||||
tool_tip_text = std::basic_string<llwchar>(tool_tip_text, 0, pos);
|
||||
}
|
||||
|
||||
// Add the text
|
||||
cleanStringForPaste(tool_tip_text);
|
||||
pasteTextWithLinebreaks(tool_tip_text);
|
||||
handled = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // Normal key handling
|
||||
handled = handleNavigationKey( key, mask )
|
||||
|| handleSelectionKey(key, mask)
|
||||
|| handleControlKey(key, mask)
|
||||
|| handleSpecialKey(key, mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
handled = handleNavigationKey( key, mask )
|
||||
|| handleSelectionKey(key, mask)
|
||||
|| handleControlKey(key, mask)
|
||||
|| handleSpecialKey(key, mask);
|
||||
}
|
||||
|
||||
if( handled )
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ public:
|
|||
ignore_tab,
|
||||
show_line_numbers,
|
||||
commit_on_focus_lost,
|
||||
show_context_menu;
|
||||
show_context_menu,
|
||||
enable_tooltip_paste;
|
||||
|
||||
//colors
|
||||
Optional<LLUIColor> default_color;
|
||||
|
|
@ -288,6 +289,8 @@ private:
|
|||
// Methods
|
||||
//
|
||||
void pasteHelper(bool is_primary);
|
||||
void cleanStringForPaste(LLWString & clean_string);
|
||||
void pasteTextWithLinebreaks(LLWString & clean_string);
|
||||
|
||||
void drawLineNumbers();
|
||||
|
||||
|
|
@ -321,6 +324,7 @@ private:
|
|||
BOOL mAllowEmbeddedItems;
|
||||
bool mShowContextMenu;
|
||||
bool mParseOnTheFly;
|
||||
bool mEnableTooltipPaste;
|
||||
|
||||
LLUUID mSourceID;
|
||||
|
||||
|
|
|
|||
|
|
@ -101,3 +101,8 @@ bool LLToggleableMenu::toggleVisibility()
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLToggleableMenu::addChild(LLView* view, S32 tab_group)
|
||||
{
|
||||
return addContextChild(view, tab_group);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ public:
|
|||
|
||||
virtual void handleVisibilityChange (BOOL curVisibilityIn);
|
||||
|
||||
virtual bool addChild (LLView* view, S32 tab_group = 0);
|
||||
|
||||
const LLRect& getButtonRect() const { return mButtonRect; }
|
||||
|
||||
// Converts the given local button rect to a screen rect
|
||||
|
|
|
|||
|
|
@ -117,7 +117,8 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p)
|
|||
mButtonEnterSignal(NULL),
|
||||
mButtonLeaveSignal(NULL),
|
||||
mButtonRemoveSignal(NULL),
|
||||
mDragAndDropTarget(false)
|
||||
mDragAndDropTarget(false),
|
||||
mCaretIcon(NULL)
|
||||
{
|
||||
mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text;
|
||||
mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon;
|
||||
|
|
@ -830,7 +831,12 @@ void LLToolBar::draw()
|
|||
LLUI::translate((F32)getRect().mLeft, (F32)getRect().mBottom);
|
||||
|
||||
// Position the caret
|
||||
LLIconCtrl* caret = getChild<LLIconCtrl>("caret");
|
||||
if (!mCaretIcon)
|
||||
{
|
||||
mCaretIcon = getChild<LLIconCtrl>("caret");
|
||||
}
|
||||
|
||||
LLIconCtrl* caret = mCaretIcon;
|
||||
caret->setVisible(FALSE);
|
||||
if (mDragAndDropTarget && !mButtonCommands.empty())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
class LLToolBar;
|
||||
class LLToolBarButton;
|
||||
class LLIconCtrl;
|
||||
|
||||
typedef boost::function<void (S32 x, S32 y, LLToolBarButton* button)> tool_startdrag_callback_t;
|
||||
typedef boost::function<BOOL (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> tool_handledrag_callback_t;
|
||||
|
|
@ -284,6 +285,8 @@ private:
|
|||
button_signal_t* mButtonRemoveSignal;
|
||||
|
||||
std::string mButtonTooltipSuffix;
|
||||
|
||||
LLIconCtrl* mCaretIcon;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -390,6 +390,15 @@ bool LLToolTip::hasClickCallback()
|
|||
return mHasClickCallback;
|
||||
}
|
||||
|
||||
void LLToolTip::getToolTipMessage(std::string & message)
|
||||
{
|
||||
if (mTextBox)
|
||||
{
|
||||
message = mTextBox->getText();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// LLToolTipMgr
|
||||
|
|
@ -594,5 +603,14 @@ void LLToolTipMgr::updateToolTipVisibility()
|
|||
}
|
||||
|
||||
|
||||
// Return the current tooltip text
|
||||
void LLToolTipMgr::getToolTipMessage(std::string & message)
|
||||
{
|
||||
if (toolTipVisible())
|
||||
{
|
||||
mToolTip->getToolTipMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// EOF
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ public:
|
|||
LLToolTip(const Params& p);
|
||||
void initFromParams(const LLToolTip::Params& params);
|
||||
|
||||
void getToolTipMessage(std::string & message);
|
||||
|
||||
private:
|
||||
class LLTextBox* mTextBox;
|
||||
class LLButton* mInfoButton;
|
||||
|
|
@ -142,6 +144,8 @@ public:
|
|||
LLRect getMouseNearRect();
|
||||
void updateToolTipVisibility();
|
||||
|
||||
void getToolTipMessage(std::string & message);
|
||||
|
||||
private:
|
||||
void createToolTip(const LLToolTip::Params& params);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,14 +50,15 @@ LLSplashScreen *gSplashScreenp = NULL;
|
|||
BOOL gDebugClicks = FALSE;
|
||||
BOOL gDebugWindowProc = FALSE;
|
||||
|
||||
const S32 gURLProtocolWhitelistCount = 3;
|
||||
const std::string gURLProtocolWhitelist[] = { "file:", "http:", "https:" };
|
||||
const S32 gURLProtocolWhitelistCount = 4;
|
||||
const std::string gURLProtocolWhitelist[] = { "secondlife:", "http:", "https:", "data:" };
|
||||
|
||||
// CP: added a handler list - this is what's used to open the protocol and is based on registry entry
|
||||
// only meaningful difference currently is that file: protocols are opened using http:
|
||||
// since no protocol handler exists in registry for file:
|
||||
// Important - these lists should match - protocol to handler
|
||||
const std::string gURLProtocolWhitelistHandler[] = { "http", "http", "https" };
|
||||
// Maestro: This list isn't referenced anywhere that I could find
|
||||
//const std::string gURLProtocolWhitelistHandler[] = { "http", "http", "https" };
|
||||
|
||||
|
||||
S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type)
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ extern BOOL gDebugWindowProc;
|
|||
// Protocols, like "http" and "https" we support in URLs
|
||||
extern const S32 gURLProtocolWhitelistCount;
|
||||
extern const std::string gURLProtocolWhitelist[];
|
||||
extern const std::string gURLProtocolWhitelistHandler[];
|
||||
//extern const std::string gURLProtocolWhitelistHandler[];
|
||||
|
||||
void simpleEscapeString ( std::string& stringIn );
|
||||
|
||||
|
|
|
|||
|
|
@ -2516,6 +2516,23 @@ void exec_cmd(const std::string& cmd, const std::string& arg)
|
|||
// Must begin with protocol identifier.
|
||||
void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
|
||||
{
|
||||
bool found = false;
|
||||
S32 i;
|
||||
for (i = 0; i < gURLProtocolWhitelistCount; i++)
|
||||
{
|
||||
if (escaped_url.find(gURLProtocolWhitelist[i]) != std::string::npos)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
llwarns << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
llinfos << "spawn_web_browser: " << escaped_url << llendl;
|
||||
|
||||
#if LL_LINUX || LL_SOLARIS
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@
|
|||
#include <dinput.h>
|
||||
#include <Dbt.h.>
|
||||
|
||||
#include "llmemtype.h"
|
||||
// culled from winuser.h
|
||||
#ifndef WM_MOUSEWHEEL /* Added to be compatible with later SDK's */
|
||||
const S32 WM_MOUSEWHEEL = 0x020A;
|
||||
|
|
@ -1773,8 +1772,6 @@ void LLWindowWin32::gatherInput()
|
|||
MSG msg;
|
||||
int msg_count = 0;
|
||||
|
||||
LLMemType m1(LLMemType::MTYPE_GATHER_INPUT);
|
||||
|
||||
while ((msg_count < MAX_MESSAGE_PER_UPDATE) && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||
{
|
||||
mCallbacks->handlePingWatchdog(this, "Main:TranslateGatherInput");
|
||||
|
|
|
|||
|
|
@ -254,6 +254,7 @@ public:
|
|||
else
|
||||
{
|
||||
llwarns << "Control " << name << " not found." << llendl;
|
||||
return T();
|
||||
}
|
||||
return convert_from_llsd<T>(value, type, name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,18 +48,37 @@ private:
|
|||
set_volume_func_t mSetVolumeFunc;
|
||||
set_mute_func_t mSetMuteFunc;
|
||||
|
||||
// tests if running on Vista, 7, 8 + once in CTOR
|
||||
bool isWindowsVistaOrHigher();
|
||||
|
||||
F32 mVolume;
|
||||
F32 mPan;
|
||||
bool mSystemIsVistaOrHigher;
|
||||
};
|
||||
VolumeCatcherImpl::VolumeCatcherImpl()
|
||||
: mVolume(1.0f), // default volume is max
|
||||
mPan(0.f) // default pan is centered
|
||||
|
||||
bool VolumeCatcherImpl::isWindowsVistaOrHigher()
|
||||
{
|
||||
HMODULE handle = ::LoadLibrary(L"winmm.dll");
|
||||
if(handle)
|
||||
OSVERSIONINFO osvi;
|
||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
GetVersionEx(&osvi);
|
||||
return osvi.dwMajorVersion >= 6;
|
||||
}
|
||||
|
||||
VolumeCatcherImpl::VolumeCatcherImpl()
|
||||
: mVolume(1.0f), // default volume is max
|
||||
mPan(0.f) // default pan is centered
|
||||
{
|
||||
mSystemIsVistaOrHigher = isWindowsVistaOrHigher();
|
||||
|
||||
if ( ! mSystemIsVistaOrHigher )
|
||||
{
|
||||
mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume");
|
||||
mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute");
|
||||
HMODULE handle = ::LoadLibrary(L"winmm.dll");
|
||||
if(handle)
|
||||
{
|
||||
mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume");
|
||||
mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,18 +86,29 @@ VolumeCatcherImpl::~VolumeCatcherImpl()
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
void VolumeCatcherImpl::setVolume(F32 volume)
|
||||
{
|
||||
mVolume = volume;
|
||||
|
||||
if (mSetMuteFunc)
|
||||
if ( mSystemIsVistaOrHigher )
|
||||
{
|
||||
mSetMuteFunc(volume == 0.f);
|
||||
// set both left/right to same volume
|
||||
// TODO: use pan value to set independently
|
||||
DWORD left_channel = (DWORD)(mVolume * 65535.0f);
|
||||
DWORD right_channel = (DWORD)(mVolume * 65535.0f);
|
||||
DWORD hw_volume = left_channel << 16 | right_channel;
|
||||
::waveOutSetVolume(NULL, hw_volume);
|
||||
}
|
||||
if (mSetVolumeFunc)
|
||||
else
|
||||
{
|
||||
mSetVolumeFunc(mVolume);
|
||||
if (mSetMuteFunc)
|
||||
{
|
||||
mSetMuteFunc(volume == 0.f);
|
||||
}
|
||||
if (mSetVolumeFunc)
|
||||
{
|
||||
mSetVolumeFunc(mVolume);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ include(LLXML)
|
|||
include(LScript)
|
||||
include(Linking)
|
||||
include(NDOF)
|
||||
include(NVAPI)
|
||||
include(GooglePerfTools)
|
||||
include(TemplateCheck)
|
||||
include(UI)
|
||||
|
|
@ -336,7 +337,6 @@ set(viewer_SOURCE_FILES
|
|||
llmarketplacenotifications.cpp
|
||||
llmediactrl.cpp
|
||||
llmediadataclient.cpp
|
||||
llmemoryview.cpp
|
||||
llmenuoptionpathfindingrebakenavmesh.cpp
|
||||
llmeshrepository.cpp
|
||||
llmimetypes.cpp
|
||||
|
|
@ -913,7 +913,6 @@ set(viewer_HEADER_FILES
|
|||
llmarketplacenotifications.h
|
||||
llmediactrl.h
|
||||
llmediadataclient.h
|
||||
llmemoryview.h
|
||||
llmenuoptionpathfindingrebakenavmesh.h
|
||||
llmeshrepository.h
|
||||
llmimetypes.h
|
||||
|
|
@ -1819,6 +1818,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
|||
${LLCOREHTTP_LIBRARIES}
|
||||
${LLCOMMON_LIBRARIES}
|
||||
${NDOF_LIBRARY}
|
||||
${NVAPI_LIBRARY}
|
||||
${HUNSPELL_LIBRARY}
|
||||
${viewer_LIBRARIES}
|
||||
${BOOST_PROGRAM_OPTIONS_LIBRARY}
|
||||
|
|
@ -1867,7 +1867,6 @@ if (LINUX)
|
|||
set(COPY_INPUT_DEPENDENCIES
|
||||
${VIEWER_BINARY_NAME}
|
||||
linux-crash-logger
|
||||
linux-updater
|
||||
SLPlugin
|
||||
media_plugin_webkit
|
||||
media_plugin_gstreamer010
|
||||
|
|
|
|||
|
|
@ -48,6 +48,6 @@
|
|||
-->
|
||||
</array>
|
||||
</map>
|
||||
</array>
|
||||
</array>
|
||||
</map>
|
||||
</llsd>
|
||||
|
|
|
|||
|
|
@ -5168,7 +5168,7 @@
|
|||
<key>Comment</key>
|
||||
<string>Center the focal point of the minimap.</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
|
|
@ -14070,6 +14070,18 @@
|
|||
<real>1.0</real>
|
||||
</array>
|
||||
</map>
|
||||
|
||||
<key>HideUIControls</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Hide all menu items and buttons</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>SimulateFBOFailure</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
/**
|
||||
* @file llmemoryview.h
|
||||
* @brief LLMemoryView class definition
|
||||
* @file previewF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
* Copyright (C) 2011, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
@ -24,39 +23,19 @@
|
|||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLMEMORYVIEW_H
|
||||
#define LL_LLMEMORYVIEW_H
|
||||
|
||||
#include "llview.h"
|
||||
|
||||
class LLAllocator;
|
||||
|
||||
class LLMemoryView : public LLView
|
||||
{
|
||||
public:
|
||||
struct Params : public LLInitParam::Block<Params, LLView::Params>
|
||||
{
|
||||
Params()
|
||||
{
|
||||
changeDefault(mouse_opaque, true);
|
||||
changeDefault(visible, false);
|
||||
}
|
||||
};
|
||||
LLMemoryView(const LLMemoryView::Params&);
|
||||
virtual ~LLMemoryView();
|
||||
|
||||
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
virtual void draw();
|
||||
|
||||
void refreshProfile();
|
||||
|
||||
private:
|
||||
std::vector<LLWString> mLines;
|
||||
LLAllocator* mAlloc;
|
||||
BOOL mPaused ;
|
||||
|
||||
};
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
|
||||
frag_color = color;
|
||||
}
|
||||
|
|
@ -32,12 +32,51 @@ ATTRIBUTE vec3 position;
|
|||
ATTRIBUTE vec3 normal;
|
||||
ATTRIBUTE vec2 texcoord0;
|
||||
|
||||
uniform vec4 color;
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
uniform vec4 light_position[8];
|
||||
uniform vec3 light_direction[8];
|
||||
uniform vec3 light_attenuation[8];
|
||||
uniform vec3 light_diffuse[8];
|
||||
|
||||
//===================================================================================================
|
||||
//declare these here explicitly to separate them from atmospheric lighting elsewhere to work around
|
||||
//drivers that are picky about functions being declared but not defined even if they aren't called
|
||||
float calcDirectionalLight(vec3 n, vec3 l)
|
||||
{
|
||||
float a = max(dot(n,l),0.0);
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight)
|
||||
{
|
||||
//get light vector
|
||||
vec3 lv = lp.xyz-v;
|
||||
|
||||
//get distance
|
||||
float d = length(lv);
|
||||
|
||||
//normalize light vector
|
||||
lv *= 1.0/d;
|
||||
|
||||
//distance attenuation
|
||||
float da = clamp(1.0/(la * d), 0.0, 1.0);
|
||||
|
||||
// spotlight coefficient.
|
||||
float spot = max(dot(-ln, lv), is_pointlight);
|
||||
da *= spot*spot; // GL_SPOT_EXPONENT=2
|
||||
|
||||
//angular attenuation
|
||||
da *= calcDirectionalLight(n, lv);
|
||||
|
||||
return da;
|
||||
}
|
||||
//====================================================================================================
|
||||
|
||||
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
|
||||
void calcAtmospherics(vec3 inPositionEye);
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
@ -45,13 +84,15 @@ void main()
|
|||
vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));
|
||||
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
|
||||
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
|
||||
|
||||
|
||||
vec3 norm = normalize(normal_matrix * normal);
|
||||
|
||||
calcAtmospherics(pos.xyz);
|
||||
vec4 col = vec4(0,0,0,1);
|
||||
|
||||
vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
|
||||
vertex_color = color;
|
||||
|
||||
|
||||
// Collect normal lights (need to be divided by two, as we later multiply by 2)
|
||||
col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz);
|
||||
col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z);
|
||||
col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z);
|
||||
|
||||
vertex_color = col*color;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "llfloaterreg.h"
|
||||
#include "llhudmanager.h"
|
||||
#include "lljoystickbutton.h"
|
||||
#include "llmoveview.h"
|
||||
#include "llselectmgr.h"
|
||||
#include "llsmoothstep.h"
|
||||
#include "lltoolmgr.h"
|
||||
|
|
@ -2113,6 +2114,11 @@ void LLAgentCamera::changeCameraToDefault()
|
|||
{
|
||||
changeCameraToThirdPerson();
|
||||
}
|
||||
if (gSavedSettings.getBOOL("HideUIControls"))
|
||||
{
|
||||
gViewerWindow->setUIVisibility(false);
|
||||
LLPanelStandStopFlying::getInstance()->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -731,10 +731,6 @@ bool LLAppViewer::init()
|
|||
|
||||
mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling"));
|
||||
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::initClass();
|
||||
#endif
|
||||
|
||||
// Initialize the non-LLCurl libcurl library. Should be called
|
||||
// before consumers (LLTextureFetch).
|
||||
mAppCoreHttp.init();
|
||||
|
|
@ -808,9 +804,6 @@ bool LLAppViewer::init()
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
// *FIX: The following code isn't grouped into functions yet.
|
||||
|
||||
// Statistics / debug timer initialization
|
||||
init_statistics();
|
||||
|
||||
//
|
||||
// Various introspection concerning the libs we're using - particularly
|
||||
// the libs involved in getting to a full login screen.
|
||||
|
|
@ -1037,11 +1030,20 @@ bool LLAppViewer::init()
|
|||
}
|
||||
|
||||
#if LL_WINDOWS
|
||||
if (gGLManager.mIsIntel &&
|
||||
LLFeatureManager::getInstance()->getGPUClass() > 0 &&
|
||||
gGLManager.mGLVersion <= 3.f)
|
||||
if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion())
|
||||
{
|
||||
LLNotificationsUtil::add("IntelOldDriver");
|
||||
if (gGLManager.mIsIntel)
|
||||
{
|
||||
LLNotificationsUtil::add("IntelOldDriver");
|
||||
}
|
||||
else if (gGLManager.mIsNVIDIA)
|
||||
{
|
||||
LLNotificationsUtil::add("NVIDIAOldDriver");
|
||||
}
|
||||
else if (gGLManager.mIsATI)
|
||||
{
|
||||
LLNotificationsUtil::add("AMDOldDriver");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1196,9 +1198,10 @@ static LLFastTimer::DeclareTimer FTM_SERVICE_CALLBACK("Callback");
|
|||
static LLFastTimer::DeclareTimer FTM_AGENT_AUTOPILOT("Autopilot");
|
||||
static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE("Update");
|
||||
|
||||
LLFastTimer::DeclareTimer FTM_FRAME("Frame", true);
|
||||
|
||||
bool LLAppViewer::mainLoop()
|
||||
{
|
||||
LLMemType mt1(LLMemType::MTYPE_MAIN);
|
||||
mMainloopTimeout = new LLWatchdogTimeout();
|
||||
|
||||
//-------------------------------------------
|
||||
|
|
@ -1234,7 +1237,8 @@ bool LLAppViewer::mainLoop()
|
|||
// Handle messages
|
||||
while (!LLApp::isExiting())
|
||||
{
|
||||
LLFastTimer::nextFrame(); // Should be outside of any timer instances
|
||||
LLFastTimer _(FTM_FRAME);
|
||||
LLFastTimer::nextFrame();
|
||||
|
||||
//clear call stack records
|
||||
llclearcallstacks;
|
||||
|
|
@ -1298,7 +1302,6 @@ bool LLAppViewer::mainLoop()
|
|||
&& (gHeadlessClient || !gViewerWindow->getShowProgress())
|
||||
&& !gFocusMgr.focusLocked())
|
||||
{
|
||||
LLMemType mjk(LLMemType::MTYPE_JOY_KEY);
|
||||
joystick->scanJoystick();
|
||||
gKeyboard->scanKeyboard();
|
||||
}
|
||||
|
|
@ -1312,7 +1315,6 @@ bool LLAppViewer::mainLoop()
|
|||
|
||||
if (gAres != NULL && gAres->isInitialized())
|
||||
{
|
||||
LLMemType mt_ip(LLMemType::MTYPE_IDLE_PUMP);
|
||||
pingMainloopTimeout("Main:ServicePump");
|
||||
LLFastTimer t4(FTM_PUMP);
|
||||
{
|
||||
|
|
@ -1362,7 +1364,6 @@ bool LLAppViewer::mainLoop()
|
|||
|
||||
// Sleep and run background threads
|
||||
{
|
||||
LLMemType mt_sleep(LLMemType::MTYPE_SLEEP);
|
||||
LLFastTimer t2(FTM_SLEEP);
|
||||
|
||||
// yield some time to the os based on command line option
|
||||
|
|
@ -1939,10 +1940,6 @@ bool LLAppViewer::cleanup()
|
|||
|
||||
LLMetricPerformanceTesterBasic::cleanClass() ;
|
||||
|
||||
#if LL_RECORD_VIEWER_STATS
|
||||
LLViewerStatsRecorder::cleanupClass();
|
||||
#endif
|
||||
|
||||
llinfos << "Cleaning up Media and Textures" << llendflush;
|
||||
|
||||
//Note:
|
||||
|
|
@ -3222,8 +3219,6 @@ void LLAppViewer::writeSystemInfo()
|
|||
LL_INFOS("SystemInfo") << "OS: " << getOSInfo().getOSStringSimple() << LL_ENDL;
|
||||
LL_INFOS("SystemInfo") << "OS info: " << getOSInfo() << LL_ENDL;
|
||||
|
||||
LL_INFOS("SystemInfo") << "Timers: " << LLFastTimer::sClockType << LL_ENDL;
|
||||
|
||||
writeDebugInfo(); // Save out debug_info.log early, in case of crash.
|
||||
}
|
||||
|
||||
|
|
@ -4207,7 +4202,6 @@ static LLFastTimer::DeclareTimer FTM_VLMANAGER("VL Manager");
|
|||
///////////////////////////////////////////////////////
|
||||
void LLAppViewer::idle()
|
||||
{
|
||||
LLMemType mt_idle(LLMemType::MTYPE_IDLE);
|
||||
pingMainloopTimeout("Main:Idle");
|
||||
|
||||
// Update frame timers
|
||||
|
|
@ -4320,7 +4314,6 @@ void LLAppViewer::idle()
|
|||
// of SEND_STATS_PERIOD so that the initial stats report will
|
||||
// be sent immediately.
|
||||
static LLFrameStatsTimer viewer_stats_timer(SEND_STATS_PERIOD);
|
||||
reset_statistics();
|
||||
|
||||
// Update session stats every large chunk of time
|
||||
// *FIX: (???) SAMANTHA
|
||||
|
|
@ -4380,7 +4373,7 @@ void LLAppViewer::idle()
|
|||
idle_afk_check();
|
||||
|
||||
// Update statistics for this frame
|
||||
update_statistics(gFrameCount);
|
||||
update_statistics();
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
|
|
@ -4806,7 +4799,6 @@ static LLFastTimer::DeclareTimer FTM_CHECK_REGION_CIRCUIT("Check Region Circuit"
|
|||
|
||||
void LLAppViewer::idleNetwork()
|
||||
{
|
||||
LLMemType mt_in(LLMemType::MTYPE_IDLE_NETWORK);
|
||||
pingMainloopTimeout("idleNetwork");
|
||||
|
||||
gObjectList.mNumNewObjects = 0;
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@ class LLTextureFetch;
|
|||
class LLWatchdogTimeout;
|
||||
class LLUpdaterService;
|
||||
|
||||
extern LLFastTimer::DeclareTimer FTM_FRAME;
|
||||
|
||||
|
||||
class LLAppViewer : public LLApp
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include "llcommandlineparser.h"
|
||||
|
||||
#include "lldiriterator.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llurldispatcher.h" // SLURL from other app instance
|
||||
#include "llviewernetwork.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
|
@ -71,8 +70,6 @@ static void exceptionTerminateHandler()
|
|||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
LLMemType mt1(LLMemType::MTYPE_STARTUP);
|
||||
|
||||
#if LL_SOLARIS && defined(__sparc)
|
||||
asm ("ta\t6"); // NOTE: Make sure memory alignment is enforced on SPARC
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@
|
|||
#include "llappviewermacosx.h"
|
||||
#include "llcommandlineparser.h"
|
||||
|
||||
#include "llmemtype.h"
|
||||
|
||||
#include "llviewernetwork.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llmd5.h"
|
||||
|
|
@ -67,8 +65,6 @@ namespace
|
|||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
LLMemType mt1(LLMemType::MTYPE_STARTUP);
|
||||
|
||||
#if LL_SOLARIS && defined(__sparc)
|
||||
asm ("ta\t6"); // NOTE: Make sure memory alignment is enforced on SPARC
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "llappviewerwin32.h"
|
||||
|
||||
#include "llmemtype.h"
|
||||
|
||||
#include "llwindowwin32.h" // *FIX: for setting gIconResource.
|
||||
#include "llgl.h"
|
||||
|
|
@ -47,6 +46,11 @@
|
|||
#include "llviewercontrol.h"
|
||||
#include "lldxhardware.h"
|
||||
|
||||
#include "nvapi/nvapi.h"
|
||||
#include "nvapi/NvApiDriverSettings.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "llweb.h"
|
||||
#include "llsecondlifeurls.h"
|
||||
|
||||
|
|
@ -61,6 +65,7 @@
|
|||
#include "llwindebug.h"
|
||||
#endif
|
||||
|
||||
|
||||
// *FIX:Mani - This hack is to fix a linker issue with libndofdev.lib
|
||||
// The lib was compiled under VS2005 - in VS2003 we need to remap assert
|
||||
#ifdef LL_DEBUG
|
||||
|
|
@ -76,6 +81,20 @@ extern "C" {
|
|||
|
||||
const std::string LLAppViewerWin32::sWindowClass = "Second Life";
|
||||
|
||||
/*
|
||||
This function is used to print to the command line a text message
|
||||
describing the nvapi error and quits
|
||||
*/
|
||||
void nvapi_error(NvAPI_Status status)
|
||||
{
|
||||
NvAPI_ShortString szDesc = {0};
|
||||
NvAPI_GetErrorMessage(status, szDesc);
|
||||
llwarns << szDesc << llendl;
|
||||
|
||||
//should always trigger when asserts are enabled
|
||||
llassert(status == NVAPI_OK);
|
||||
}
|
||||
|
||||
// Create app mutex creates a unique global windows object.
|
||||
// If the object can be created it returns true, otherwise
|
||||
// it returns false. The false result can be used to determine
|
||||
|
|
@ -97,6 +116,79 @@ bool create_app_mutex()
|
|||
return result;
|
||||
}
|
||||
|
||||
void ll_nvapi_init(NvDRSSessionHandle hSession)
|
||||
{
|
||||
// (2) load all the system settings into the session
|
||||
NvAPI_Status status = NvAPI_DRS_LoadSettings(hSession);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
|
||||
NvAPI_UnicodeString profile_name;
|
||||
std::string app_name = LLTrans::getString("APP_NAME");
|
||||
llutf16string w_app_name = utf8str_to_utf16str(app_name);
|
||||
wsprintf(profile_name, L"%s", w_app_name.c_str());
|
||||
status = NvAPI_DRS_SetCurrentGlobalProfile(hSession, profile_name);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
|
||||
// (3) Obtain the current profile.
|
||||
NvDRSProfileHandle hProfile = 0;
|
||||
status = NvAPI_DRS_GetCurrentGlobalProfile(hSession, &hProfile);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
|
||||
// load settings for querying
|
||||
status = NvAPI_DRS_LoadSettings(hSession);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
|
||||
//get the preferred power management mode for Second Life
|
||||
NVDRS_SETTING drsSetting = {0};
|
||||
drsSetting.version = NVDRS_SETTING_VER;
|
||||
status = NvAPI_DRS_GetSetting(hSession, hProfile, PREFERRED_PSTATE_ID, &drsSetting);
|
||||
if (status == NVAPI_SETTING_NOT_FOUND)
|
||||
{ //only override if the user hasn't specifically set this setting
|
||||
// (4) Specify that we want the VSYNC disabled setting
|
||||
// first we fill the NVDRS_SETTING struct, then we call the function
|
||||
drsSetting.version = NVDRS_SETTING_VER;
|
||||
drsSetting.settingId = PREFERRED_PSTATE_ID;
|
||||
drsSetting.settingType = NVDRS_DWORD_TYPE;
|
||||
drsSetting.u32CurrentValue = PREFERRED_PSTATE_PREFER_MAX;
|
||||
status = NvAPI_DRS_SetSetting(hSession, hProfile, &drsSetting);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// (5) Now we apply (or save) our changes to the system
|
||||
status = NvAPI_DRS_SaveSettings(hSession);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
}
|
||||
}
|
||||
|
||||
//#define DEBUGGING_SEH_FILTER 1
|
||||
#if DEBUGGING_SEH_FILTER
|
||||
# define WINMAIN DebuggingWinMain
|
||||
|
|
@ -117,8 +209,6 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
|
|||
#endif // _DEBUG
|
||||
#endif // INCLUDE_VLD
|
||||
|
||||
LLMemType mt1(LLMemType::MTYPE_STARTUP);
|
||||
|
||||
const S32 MAX_HEAPS = 255;
|
||||
DWORD heap_enable_lfh_error[MAX_HEAPS];
|
||||
S32 num_heaps = 0;
|
||||
|
|
@ -168,6 +258,27 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
|
|||
return -1;
|
||||
}
|
||||
|
||||
NvAPI_Status status;
|
||||
|
||||
// Initialize NVAPI
|
||||
status = NvAPI_Initialize();
|
||||
NvDRSSessionHandle hSession = 0;
|
||||
|
||||
if (status == NVAPI_OK)
|
||||
{
|
||||
// Create the session handle to access driver settings
|
||||
status = NvAPI_DRS_CreateSession(&hSession);
|
||||
if (status != NVAPI_OK)
|
||||
{
|
||||
nvapi_error(status);
|
||||
}
|
||||
else
|
||||
{
|
||||
//override driver setting as needed
|
||||
ll_nvapi_init(hSession);
|
||||
}
|
||||
}
|
||||
|
||||
// Have to wait until after logging is initialized to display LFH info
|
||||
if (num_heaps > 0)
|
||||
{
|
||||
|
|
@ -235,6 +346,15 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
|
|||
LLAppViewer::sUpdaterInfo = NULL ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// (NVAPI) (6) We clean up. This is analogous to doing a free()
|
||||
if (hSession)
|
||||
{
|
||||
NvAPI_DRS_DestroySession(hSession);
|
||||
hSession = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,9 @@ public:
|
|||
mFrom(),
|
||||
mSessionID(),
|
||||
mMinUserNameWidth(0),
|
||||
mUserNameFont(NULL)
|
||||
mUserNameFont(NULL),
|
||||
mUserNameTextBox(NULL),
|
||||
mTimeBoxTextBox(NULL)
|
||||
{}
|
||||
|
||||
static LLChatHistoryHeader* createInstance(const std::string& file_name)
|
||||
|
|
@ -187,6 +189,9 @@ public:
|
|||
setMouseEnterCallback(boost::bind(&LLChatHistoryHeader::showInfoCtrl, this));
|
||||
setMouseLeaveCallback(boost::bind(&LLChatHistoryHeader::hideInfoCtrl, this));
|
||||
|
||||
mUserNameTextBox = getChild<LLTextBox>("user_name");
|
||||
mTimeBoxTextBox = getChild<LLTextBox>("time_box");
|
||||
|
||||
return LLPanel::postBuild();
|
||||
}
|
||||
|
||||
|
|
@ -377,8 +382,8 @@ public:
|
|||
|
||||
/*virtual*/ void draw()
|
||||
{
|
||||
LLTextBox* user_name = getChild<LLTextBox>("user_name");
|
||||
LLTextBox* time_box = getChild<LLTextBox>("time_box");
|
||||
LLTextBox* user_name = mUserNameTextBox; //getChild<LLTextBox>("user_name");
|
||||
LLTextBox* time_box = mTimeBoxTextBox; //getChild<LLTextBox>("time_box");
|
||||
|
||||
LLRect user_name_rect = user_name->getRect();
|
||||
S32 user_name_width = user_name_rect.getWidth();
|
||||
|
|
@ -568,6 +573,8 @@ protected:
|
|||
|
||||
S32 mMinUserNameWidth;
|
||||
const LLFontGL* mUserNameFont;
|
||||
LLTextBox* mUserNameTextBox;
|
||||
LLTextBox* mTimeBoxTextBox;
|
||||
};
|
||||
|
||||
LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
// library includes
|
||||
#include "llfasttimerview.h"
|
||||
#include "llmemoryview.h"
|
||||
#include "llconsole.h"
|
||||
#include "lltextureview.h"
|
||||
#include "llresmgr.h"
|
||||
|
|
@ -38,7 +37,6 @@
|
|||
#include "llviewercontrol.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llappviewer.h"
|
||||
#include "llmemoryview.h"
|
||||
#include "llsceneview.h"
|
||||
#include "llviewertexture.h"
|
||||
#include "llfloaterreg.h"
|
||||
|
|
@ -103,13 +101,6 @@ void LLDebugView::init()
|
|||
|
||||
r.setLeftTopAndSize(25, rect.getHeight() - 50, (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f),
|
||||
(S32) (gViewerWindow->getWindowRectScaled().getHeight() * 0.75f));
|
||||
LLMemoryView::Params mp;
|
||||
mp.name("memory");
|
||||
mp.rect(r);
|
||||
mp.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT);
|
||||
mp.visible(false);
|
||||
mMemoryView = LLUICtrlFactory::create<LLMemoryView>(mp);
|
||||
addChild(mMemoryView);
|
||||
|
||||
r.set(150, rect.getHeight() - 50, 820, 100);
|
||||
LLTextureView::Params tvp;
|
||||
|
|
|
|||
|
|
@ -254,11 +254,17 @@ S32 LLDrawable::findReferences(LLDrawable *drawablep)
|
|||
return count;
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_ALLOCATE_FACE("Allocate Face", true);
|
||||
|
||||
LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep)
|
||||
{
|
||||
LLMemType mt(LLMemType::MTYPE_DRAWABLE);
|
||||
|
||||
LLFace *face = new LLFace(this, mVObjp);
|
||||
LLFace *face;
|
||||
{
|
||||
LLFastTimer t(FTM_ALLOCATE_FACE);
|
||||
face = new LLFace(this, mVObjp);
|
||||
}
|
||||
|
||||
if (!face) llerrs << "Allocating new Face: " << mFaces.size() << llendl;
|
||||
|
||||
if (face)
|
||||
|
|
@ -280,10 +286,12 @@ LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep)
|
|||
|
||||
LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep)
|
||||
{
|
||||
LLMemType mt(LLMemType::MTYPE_DRAWABLE);
|
||||
|
||||
LLFace *face;
|
||||
face = new LLFace(this, mVObjp);
|
||||
|
||||
{
|
||||
LLFastTimer t(FTM_ALLOCATE_FACE);
|
||||
face = new LLFace(this, mVObjp);
|
||||
}
|
||||
|
||||
face->setTEOffset(mFaces.size());
|
||||
face->setTexture(texturep);
|
||||
|
|
@ -516,6 +524,7 @@ F32 LLDrawable::updateXform(BOOL undamped)
|
|||
dist_squared = dist_vec_squared(new_pos, target_pos);
|
||||
|
||||
LLQuaternion new_rot = nlerp(lerp_amt, old_rot, target_rot);
|
||||
// FIXME: This can be negative! It is be possible for some rots to 'cancel out' pos or size changes.
|
||||
dist_squared += (1.f - dot(new_rot, target_rot)) * 10.f;
|
||||
|
||||
LLVector3 new_scale = lerp(old_scale, target_scale, lerp_amt);
|
||||
|
|
@ -539,6 +548,15 @@ F32 LLDrawable::updateXform(BOOL undamped)
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// The following fixes MAINT-1742 but breaks vehicles similar to MAINT-2275
|
||||
// dist_squared = dist_vec_squared(old_pos, target_pos);
|
||||
|
||||
// The following fixes MAINT-2247 but causes MAINT-2275
|
||||
//dist_squared += (1.f - dot(old_rot, target_rot)) * 10.f;
|
||||
//dist_squared += dist_vec_squared(old_scale, target_scale);
|
||||
}
|
||||
|
||||
LLVector3 vec = mCurrentScale-target_scale;
|
||||
|
||||
|
|
@ -764,8 +782,6 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
|
|||
|
||||
void LLDrawable::updateTexture()
|
||||
{
|
||||
LLMemType mt(LLMemType::MTYPE_DRAWABLE);
|
||||
|
||||
if (isDead())
|
||||
{
|
||||
llwarns << "Dead drawable updating texture!" << llendl;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
#include "llvector4a.h"
|
||||
#include "llquaternion.h"
|
||||
#include "xform.h"
|
||||
#include "llmemtype.h"
|
||||
#include "lldarray.h"
|
||||
#include "llviewerobject.h"
|
||||
#include "llrect.h"
|
||||
|
|
@ -87,7 +86,6 @@ public:
|
|||
}
|
||||
|
||||
LLDrawable() { init(); }
|
||||
MEM_TYPE_NEW(LLMemType::MTYPE_DRAWABLE);
|
||||
|
||||
void markDead(); // Mark this drawable as dead
|
||||
BOOL isDead() const { return isState(DEAD); }
|
||||
|
|
|
|||
|
|
@ -1272,6 +1272,9 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
|
|||
face->setGeomIndex(0);
|
||||
face->setIndicesIndex(0);
|
||||
|
||||
//rigged faces do not batch textures
|
||||
face->setTextureIndex(255);
|
||||
|
||||
if (buffer.isNull() || buffer->getTypeMask() != data_mask || !buffer->isWriteable())
|
||||
{ //make a new buffer
|
||||
if (sShaderLevel > 0)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue