From bfbcd6d16931819c43eea8e83963c9f86c6892dd Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Wed, 28 Feb 2018 22:14:38 -0800 Subject: [MAINT-8081] - bakes on mesh. 1st pass. changed texture panel to select bakes on objects. handle magic bake ids in LLViewerObject. --- indra/llcommon/indra_constants.cpp | 7 +++++++ indra/llcommon/indra_constants.h | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/indra_constants.cpp b/indra/llcommon/indra_constants.cpp index 7ea42a3fc0..1e85e1c605 100644 --- a/indra/llcommon/indra_constants.cpp +++ b/indra/llcommon/indra_constants.cpp @@ -72,3 +72,10 @@ const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // V const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER +const LLUUID IMG_USE_BAKED_HEAD ("af238700-22df-5a1f-0818-f9877b30e027"); +const LLUUID IMG_USE_BAKED_UPPER ("b45fc8cc-7ab7-9bf7-bddb-d1053d89fc55"); +const LLUUID IMG_USE_BAKED_LOWER ("040973c3-5e2d-5f0e-6c7a-377bca151f82"); +const LLUUID IMG_USE_BAKED_EYES ("3769e766-88b6-df79-4c1e-46a588c5adb6"); +const LLUUID IMG_USE_BAKED_SKIRT ("96c3b3d8-9909-ab07-e858-626525a0a345"); +const LLUUID IMG_USE_BAKED_HAIR ("42f76a58-f1ab-7385-3f4f-da762d69192c"); + diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index fda84aa5a8..28e55b2091 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -207,6 +207,13 @@ LL_COMMON_API extern const LLUUID TERRAIN_GRASS_DETAIL; LL_COMMON_API extern const LLUUID TERRAIN_MOUNTAIN_DETAIL; LL_COMMON_API extern const LLUUID TERRAIN_ROCK_DETAIL; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_HEAD; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_UPPER; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LOWER; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_EYES; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_SKIRT; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_HAIR; + LL_COMMON_API extern const LLUUID DEFAULT_WATER_NORMAL; -- cgit v1.2.3 From 83ab2dfe0f590650693c31a0f4c101bc27b3141e Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Thu, 29 Mar 2018 14:05:47 -0700 Subject: MAINT-8421: default textures for server bakes --- indra/llcommon/indra_constants.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/indra_constants.cpp b/indra/llcommon/indra_constants.cpp index 1e85e1c605..a9bdab9f4e 100644 --- a/indra/llcommon/indra_constants.cpp +++ b/indra/llcommon/indra_constants.cpp @@ -72,10 +72,10 @@ const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // V const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER -const LLUUID IMG_USE_BAKED_HEAD ("af238700-22df-5a1f-0818-f9877b30e027"); -const LLUUID IMG_USE_BAKED_UPPER ("b45fc8cc-7ab7-9bf7-bddb-d1053d89fc55"); -const LLUUID IMG_USE_BAKED_LOWER ("040973c3-5e2d-5f0e-6c7a-377bca151f82"); -const LLUUID IMG_USE_BAKED_EYES ("3769e766-88b6-df79-4c1e-46a588c5adb6"); -const LLUUID IMG_USE_BAKED_SKIRT ("96c3b3d8-9909-ab07-e858-626525a0a345"); -const LLUUID IMG_USE_BAKED_HAIR ("42f76a58-f1ab-7385-3f4f-da762d69192c"); +const LLUUID IMG_USE_BAKED_HEAD ("11c5d053-0ea9-a529-46cb-351d4e84d17a"); +const LLUUID IMG_USE_BAKED_UPPER ("149e7c88-74ef-995b-5e23-a27208de3193"); +const LLUUID IMG_USE_BAKED_LOWER ("066d5659-0856-748e-a6de-495d896fe93b"); +const LLUUID IMG_USE_BAKED_EYES ("136c0789-b42c-4c6c-134b-63669d981fcb"); +const LLUUID IMG_USE_BAKED_SKIRT ("baf656f8-0b45-a85a-244e-f3bdb835f1a2"); +const LLUUID IMG_USE_BAKED_HAIR ("1ba5b07f-2d59-21ed-066c-1e188f9a8cad"); -- cgit v1.2.3 From 3bf89821d9c9777a0f24d89280bd7a7011a7a3df Mon Sep 17 00:00:00 2001 From: Anchor Linden Date: Mon, 21 May 2018 16:00:52 -0700 Subject: [DRTVWR-455] - added 5 new bake channels --- indra/llcommon/indra_constants.cpp | 5 +++++ indra/llcommon/indra_constants.h | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/indra_constants.cpp b/indra/llcommon/indra_constants.cpp index a9bdab9f4e..d9000bb5ac 100644 --- a/indra/llcommon/indra_constants.cpp +++ b/indra/llcommon/indra_constants.cpp @@ -78,4 +78,9 @@ const LLUUID IMG_USE_BAKED_LOWER ("066d5659-0856-748e-a6de-495d896fe93b"); const LLUUID IMG_USE_BAKED_EYES ("136c0789-b42c-4c6c-134b-63669d981fcb"); const LLUUID IMG_USE_BAKED_SKIRT ("baf656f8-0b45-a85a-244e-f3bdb835f1a2"); const LLUUID IMG_USE_BAKED_HAIR ("1ba5b07f-2d59-21ed-066c-1e188f9a8cad"); +const LLUUID IMG_USE_BAKED_LEFTARM ("9f39febf-22d7-0087-79d1-e9e8c6c9ed19"); +const LLUUID IMG_USE_BAKED_LEFTLEG ("054a7a58-8ed5-6386-0add-3b636fb28b78"); +const LLUUID IMG_USE_BAKED_AUX1 ("790c11be-b25c-c17e-b4d2-6a4ad786b752"); +const LLUUID IMG_USE_BAKED_AUX2 ("d78c478f-48c7-5928-5864-8d99fb1f521e"); +const LLUUID IMG_USE_BAKED_AUX3 ("6a95dd53-edd9-aac8-f6d3-27ed99f3c3eb"); diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 28e55b2091..dc518b8ab4 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -213,6 +213,11 @@ LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LOWER; LL_COMMON_API extern const LLUUID IMG_USE_BAKED_EYES; LL_COMMON_API extern const LLUUID IMG_USE_BAKED_SKIRT; LL_COMMON_API extern const LLUUID IMG_USE_BAKED_HAIR; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LEFTARM; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LEFTLEG; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX1; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX2; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX3; LL_COMMON_API extern const LLUUID DEFAULT_WATER_NORMAL; -- cgit v1.2.3 From e4a244a6cb1837d1748381e4552b5199a5782150 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 11 Apr 2019 20:29:50 +0300 Subject: SL-10924 Fix data escaping to accomodate CEF update --- indra/llcommon/lluri.cpp | 97 ++++++++++++++++++++++++++++++++++++++++++++++++ indra/llcommon/lluri.h | 8 ++++ 2 files changed, 105 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index 758b98e143..e2285d0a9c 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -173,6 +173,19 @@ namespace "-._~"; return s; } + const std::string path() + { + static const std::string s = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "$-_.+" + "!*'()," + "{}|\\^~[]`" + "<>#%" + ";/?:@&="; + return s; + } const std::string sub_delims() { static const std::string s = "!$&'()*+,;="; @@ -187,6 +200,12 @@ namespace { return LLURI::escape(s, unreserved() + ":@!$'()*+,"); } // sub_delims - "&;=" + ":@" std::string escapeQueryValue(const std::string& s) { return LLURI::escape(s, unreserved() + ":@!$'()*+,="); } // sub_delims - "&;" + ":@" + std::string escapeUriQuery(const std::string& s) + { return LLURI::escape(s, unreserved() + ":@?&$;*+=%/"); } + std::string escapeUriData(const std::string& s) + { return LLURI::escape(s, unreserved()); } + std::string escapeUriPath(const std::string& s) + { return LLURI::escape(s, path()); } } //static @@ -202,6 +221,84 @@ std::string LLURI::escape(const std::string& str) return escape(str, default_allowed, true); } +//static +std::string LLURI::escapePathAndData(const std::string &str) +{ + std::string result; + + const std::string data_marker = "data:"; + if (str.compare(0, data_marker.length(), data_marker) == 0) + { + // This is not url, but data, data part needs to be properly escaped + // data part is separated by ',' from header. Minimal data uri is "data:," + // See "data URI scheme" + size_t separator = str.find(','); + if (separator != std::string::npos) + { + size_t header_size = separator + 1; + std::string header = str.substr(0, header_size); + // base64 is url-safe + if (header.find("base64") != std::string::npos) + { + // assume url-safe data + result = str; + } + else + { + std::string data = str.substr(header_size, str.length() - header_size); + + // Notes: File can be partially pre-escaped, that's why escaping ignores '%' + // It somewhat limits user from displaying strings like "%20" in text + // but that's how viewer worked for a while and user can double-encode it + + // Header doesn't need escaping + result = header + escapeUriData(data); + } + } + } + else + { + // try processing it as path with query separator + // The query component is indicated by the first question + // mark("?") character and terminated by a number sign("#") + size_t delim_pos = str.find('?'); + if (delim_pos == std::string::npos) + { + // alternate separator + delim_pos = str.find(';'); + } + + if (delim_pos != std::string::npos) + { + size_t path_size = delim_pos + 1; + std::string query; + std::string fragment; + + size_t fragment_pos = str.find('#'); + if (fragment_pos != std::string::npos) + { + query = str.substr(path_size, fragment_pos - path_size); + fragment = str.substr(fragment_pos); + } + else + { + query = str.substr(path_size); + } + + std::string path = str.substr(0, path_size); + + result = escapeUriPath(path) + escapeUriQuery(query) + escapeUriPath(fragment); + } + } + + if (result.empty()) + { + // Not a known scheme or no data part, try just escaping as Uri path + result = escapeUriPath(str); + } + return result; +} + LLURI::LLURI() { } diff --git a/indra/llcommon/lluri.h b/indra/llcommon/lluri.h index 9e44cc7da2..b8fca0ca51 100644 --- a/indra/llcommon/lluri.h +++ b/indra/llcommon/lluri.h @@ -157,6 +157,14 @@ public: const std::string& allowed, bool is_allowed_sorted = false); + /** + * @brief Break string into data part and path or sheme + * and escape path (if present) and data. + * Data part is not allowed to have path related symbols + * @param str The raw URI to escape. + */ + static std::string escapePathAndData(const std::string &str); + /** * @brief unescape an escaped URI string. * -- cgit v1.2.3 From ffe93b3c93b628b73c0a809f48c3370f656603bb Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Sat, 13 Apr 2019 14:42:38 +0300 Subject: SL-10924 Missed symbol --- indra/llcommon/lluri.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index e2285d0a9c..9942bc0cf8 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -203,7 +203,7 @@ namespace std::string escapeUriQuery(const std::string& s) { return LLURI::escape(s, unreserved() + ":@?&$;*+=%/"); } std::string escapeUriData(const std::string& s) - { return LLURI::escape(s, unreserved()); } + { return LLURI::escape(s, unreserved() + "%"); } std::string escapeUriPath(const std::string& s) { return LLURI::escape(s, path()); } } @@ -249,7 +249,8 @@ std::string LLURI::escapePathAndData(const std::string &str) // Notes: File can be partially pre-escaped, that's why escaping ignores '%' // It somewhat limits user from displaying strings like "%20" in text - // but that's how viewer worked for a while and user can double-encode it + // but that's how viewer worked for a while and user can double-escape it + // Header doesn't need escaping result = header + escapeUriData(data); -- cgit v1.2.3 From 29f0a7808ff470bd20c76b089881c98b3b59e6fc Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 16 Apr 2019 21:58:22 +0300 Subject: SL-10930 LLStringUtil pointlessly scan the string --- indra/llcommon/llstring.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 30bec3a6f8..b619a9e48c 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -1735,7 +1735,8 @@ bool LLStringUtilBase::startsWith( const string_type& substr) { if(string.empty() || (substr.empty())) return false; - if(0 == string.find(substr)) return true; + if (substr.length() > string.length()) return false; + if (0 == string.compare(0, substr.length(), substr)) return true; return false; } @@ -1746,9 +1747,11 @@ bool LLStringUtilBase::endsWith( const string_type& substr) { if(string.empty() || (substr.empty())) return false; - std::string::size_type idx = string.rfind(substr); - if(std::string::npos == idx) return false; - return (idx == (string.size() - substr.size())); + size_t sub_len = substr.length(); + size_t str_len = string.length(); + if (sub_len > str_len) return false; + if (0 == string.compare(str_len - sub_len, sub_len, substr)) return true; + return false; } // static -- cgit v1.2.3 From 098f6399fb00498e2866c63cb455c1a5d6700e76 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 7 May 2019 20:36:19 +0300 Subject: SL-10954 Unit test escapePathAndData --- indra/llcommon/tests/lluri_test.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/tests/lluri_test.cpp b/indra/llcommon/tests/lluri_test.cpp index 4c64f15ca7..1a4c6641b9 100644 --- a/indra/llcommon/tests/lluri_test.cpp +++ b/indra/llcommon/tests/lluri_test.cpp @@ -383,6 +383,41 @@ namespace tut ensure_equals("query", u.query(), "redirect-http-hack=secondlife:///app/login?first_name=Callum&last_name=Linden&location=specify&grid=vaak®ion=/Morris/128/128&web_login_key=efaa4795-c2aa-4c58-8966-763c27931e78"); ensure_equals("query map element", u.queryMap()["redirect-http-hack"].asString(), "secondlife:///app/login?first_name=Callum&last_name=Linden&location=specify&grid=vaak®ion=/Morris/128/128&web_login_key=efaa4795-c2aa-4c58-8966-763c27931e78"); } + + template<> template<> + void URITestObject::test<20>() + { + set_test_name("escapePathAndData uri test"); + + // Basics scheme:[//authority]path[?query][#fragment] + ensure_equals(LLURI::escapePathAndData("dirname?query"), + "dirname?query"); + ensure_equals(LLURI::escapePathAndData("dirname?query=data"), + "dirname?query=data"); + ensure_equals(LLURI::escapePathAndData("host://dirname/subdir name?query#fragment"), + "host://dirname/subdir%20name?query#fragment"); + ensure_equals(LLURI::escapePathAndData("host://dirname/subdir name?query=some@>data#fragment"), + "host://dirname/subdir%20name?query=some@%3Edata#fragment"); + ensure_equals(LLURI::escapePathAndData("host://dir[name/subdir name?query=some[data#fra[gment"), + "host://dir[name/subdir%20name?query=some%5Bdata#fra[gment"); + ensure_equals(LLURI::escapePathAndData("mailto:zero@ll.com"), + "mailto:zero@ll.com"); + // pre-escaped + ensure_equals(LLURI::escapePathAndData("host://dirname/subdir%20name"), + "host://dirname/subdir%20name"); + + // data:[][;base64], + ensure_equals(LLURI::escapePathAndData("data:,Hello, World!"), + "data:,Hello%2C%20World%21"); + ensure_equals(LLURI::escapePathAndData("data:text/html,

Hello, World!

"), + "data:text/html,%3Ch1%3EHello%2C%20World%21%3C%2Fh1%3E"); + // pre-escaped + ensure_equals(LLURI::escapePathAndData("data:text/html,%3Ch1%3EHello%2C%20World!"), + "data:text/html,%3Ch1%3EHello%2C%20World%21%3C%2Fh1%3E"); + // assume that base64 does not need escaping + ensure_equals(LLURI::escapePathAndData("data:image;base64,SGVs/bG8sIFd/vcmxkIQ%3D%3D!-&*?="), + "data:image;base64,SGVs/bG8sIFd/vcmxkIQ%3D%3D!-&*?="); + } } -- cgit v1.2.3 From d3323fb316bd9a707cedfa7f730761b4bcd4fbe6 Mon Sep 17 00:00:00 2001 From: Anchor Date: Wed, 20 Feb 2019 03:16:05 +0530 Subject: [SL-1360] - fix no alpha on default bake textures. uploaded new pngs --- indra/llcommon/indra_constants.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/indra_constants.cpp b/indra/llcommon/indra_constants.cpp index d9000bb5ac..e13176e8fa 100644 --- a/indra/llcommon/indra_constants.cpp +++ b/indra/llcommon/indra_constants.cpp @@ -72,15 +72,15 @@ const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // V const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER -const LLUUID IMG_USE_BAKED_HEAD ("11c5d053-0ea9-a529-46cb-351d4e84d17a"); -const LLUUID IMG_USE_BAKED_UPPER ("149e7c88-74ef-995b-5e23-a27208de3193"); -const LLUUID IMG_USE_BAKED_LOWER ("066d5659-0856-748e-a6de-495d896fe93b"); -const LLUUID IMG_USE_BAKED_EYES ("136c0789-b42c-4c6c-134b-63669d981fcb"); -const LLUUID IMG_USE_BAKED_SKIRT ("baf656f8-0b45-a85a-244e-f3bdb835f1a2"); -const LLUUID IMG_USE_BAKED_HAIR ("1ba5b07f-2d59-21ed-066c-1e188f9a8cad"); -const LLUUID IMG_USE_BAKED_LEFTARM ("9f39febf-22d7-0087-79d1-e9e8c6c9ed19"); -const LLUUID IMG_USE_BAKED_LEFTLEG ("054a7a58-8ed5-6386-0add-3b636fb28b78"); -const LLUUID IMG_USE_BAKED_AUX1 ("790c11be-b25c-c17e-b4d2-6a4ad786b752"); -const LLUUID IMG_USE_BAKED_AUX2 ("d78c478f-48c7-5928-5864-8d99fb1f521e"); -const LLUUID IMG_USE_BAKED_AUX3 ("6a95dd53-edd9-aac8-f6d3-27ed99f3c3eb"); +const LLUUID IMG_USE_BAKED_HEAD ("5a9f4a74-30f2-821c-b88d-70499d3e7183"); +const LLUUID IMG_USE_BAKED_UPPER ("ae2de45c-d252-50b8-5c6e-19f39ce79317"); +const LLUUID IMG_USE_BAKED_LOWER ("24daea5f-0539-cfcf-047f-fbc40b2786ba"); +const LLUUID IMG_USE_BAKED_EYES ("52cc6bb6-2ee5-e632-d3ad-50197b1dcb8a"); +const LLUUID IMG_USE_BAKED_SKIRT ("43529ce8-7faa-ad92-165a-bc4078371687"); +const LLUUID IMG_USE_BAKED_HAIR ("09aac1fb-6bce-0bee-7d44-caac6dbb6c63"); +const LLUUID IMG_USE_BAKED_LEFTARM ("ff62763f-d60a-9855-890b-0c96f8f8cd98"); +const LLUUID IMG_USE_BAKED_LEFTLEG ("8e915e25-31d1-cc95-ae08-d58a47488251"); +const LLUUID IMG_USE_BAKED_AUX1 ("9742065b-19b5-297c-858a-29711d539043"); +const LLUUID IMG_USE_BAKED_AUX2 ("03642e83-2bd1-4eb9-34b4-4c47ed586d2d"); +const LLUUID IMG_USE_BAKED_AUX3 ("edd51b77-fc10-ce7a-4b3d-011dfc349e4f"); -- cgit v1.2.3