aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-09-06 22:12:05 +0100
committerJustin Clark-Casey (justincc)2012-09-06 22:12:05 +0100
commit8f02fd926e14dfad7f5eb77a67a6701f449511e0 (patch)
tree08e15f6bb44ff84027c278c51bb55a22951d5ecd /OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
parentAdded missing configs, and deleted the [Profile] part on the Hypergrind config. (diff)
downloadopensim-SC_OLD-8f02fd926e14dfad7f5eb77a67a6701f449511e0.zip
opensim-SC_OLD-8f02fd926e14dfad7f5eb77a67a6701f449511e0.tar.gz
opensim-SC_OLD-8f02fd926e14dfad7f5eb77a67a6701f449511e0.tar.bz2
opensim-SC_OLD-8f02fd926e14dfad7f5eb77a67a6701f449511e0.tar.xz
If reusing dynamic textures, do not reuse small data length textures that fall below current viewer discard level 2 thresholds.
Viewer LL 3.3.4 and before sometimes fail to properly redisplay dynamic textures that have a small data length compared to pixel size when pulled from cache. This appears to happen when the data length is smaller than the estimate discard level 2 size the viewer uses when making this GetTexture request. This commit works around this by always regenerating dynamic textures that fall below this threshold rather than reusing them if ReuseDynamicTextures = true This can be controlled by the [Textures] ReuseDynamicLowDataTextures config setting which defaults to false.
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs24
1 files changed, 9 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
index 0e7051e..d82551e 100644
--- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
@@ -35,6 +35,7 @@ using System.Net;
35using Nini.Config; 35using Nini.Config;
36using OpenMetaverse; 36using OpenMetaverse;
37using OpenMetaverse.Imaging; 37using OpenMetaverse.Imaging;
38using OpenSim.Region.CoreModules.Scripting.DynamicTexture;
38using OpenSim.Region.Framework.Interfaces; 39using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
40using log4net; 41using log4net;
@@ -85,20 +86,14 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
85// return lines.Any((str, r) => str.StartsWith("Image")); 86// return lines.Any((str, r) => str.StartsWith("Image"));
86// } 87// }
87 88
88 public byte[] ConvertUrl(string url, string extraParams) 89 public IDynamicTexture ConvertUrl(string url, string extraParams)
89 { 90 {
90 return null; 91 return null;
91 } 92 }
92 93
93 public byte[] ConvertData(string bodyData, string extraParams) 94 public IDynamicTexture ConvertData(string bodyData, string extraParams)
94 { 95 {
95 bool reuseable; 96 return Draw(bodyData, extraParams);
96 return Draw(bodyData, extraParams, out reuseable);
97 }
98
99 private byte[] ConvertData(string bodyData, string extraParams, out bool reuseable)
100 {
101 return Draw(bodyData, extraParams, out reuseable);
102 } 97 }
103 98
104 public bool AsyncConvertUrl(UUID id, string url, string extraParams) 99 public bool AsyncConvertUrl(UUID id, string url, string extraParams)
@@ -109,10 +104,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
109 public bool AsyncConvertData(UUID id, string bodyData, string extraParams) 104 public bool AsyncConvertData(UUID id, string bodyData, string extraParams)
110 { 105 {
111 // XXX: This isn't actually being done asynchronously! 106 // XXX: This isn't actually being done asynchronously!
112 bool reuseable; 107 m_textureManager.ReturnData(id, ConvertData(bodyData, extraParams));
113 byte[] data = ConvertData(bodyData, extraParams, out reuseable);
114
115 m_textureManager.ReturnData(id, data, reuseable);
116 108
117 return true; 109 return true;
118 } 110 }
@@ -191,7 +183,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
191 183
192 #endregion 184 #endregion
193 185
194 private byte[] Draw(string data, string extraParams, out bool reuseable) 186 private IDynamicTexture Draw(string data, string extraParams)
195 { 187 {
196 // We need to cater for old scripts that didnt use extraParams neatly, they use either an integer size which represents both width and height, or setalpha 188 // We need to cater for old scripts that didnt use extraParams neatly, they use either an integer size which represents both width and height, or setalpha
197 // we will now support multiple comma seperated params in the form width:256,height:512,alpha:255 189 // we will now support multiple comma seperated params in the form width:256,height:512,alpha:255
@@ -334,6 +326,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
334 326
335 Bitmap bitmap = null; 327 Bitmap bitmap = null;
336 Graphics graph = null; 328 Graphics graph = null;
329 bool reuseable = false;
337 330
338 try 331 try
339 { 332 {
@@ -396,7 +389,8 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
396 e.Message, e.StackTrace); 389 e.Message, e.StackTrace);
397 } 390 }
398 391
399 return imageJ2000; 392 return new OpenSim.Region.CoreModules.Scripting.DynamicTexture.DynamicTexture(
393 data, extraParams, imageJ2000, new Size(width, height), reuseable);
400 } 394 }
401 finally 395 finally
402 { 396 {