From 8f02fd926e14dfad7f5eb77a67a6701f449511e0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 6 Sep 2012 22:12:05 +0100
Subject: 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.
---
.../Framework/Interfaces/IDynamicTextureManager.cs | 57 ++++++++++++++++++++--
1 file changed, 54 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
index 1a3bcbb..6df5cc2 100644
--- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
+++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs
@@ -25,6 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+using System;
+using System.Drawing;
using System.IO;
using OpenMetaverse;
@@ -33,7 +35,14 @@ namespace OpenSim.Region.Framework.Interfaces
public interface IDynamicTextureManager
{
void RegisterRender(string handleType, IDynamicTextureRender render);
- void ReturnData(UUID id, byte[] data, bool isReuseable);
+
+ ///
+ /// Used by IDynamicTextureRender implementations to return renders
+ ///
+ ///
+ ///
+ ///
+ void ReturnData(UUID id, IDynamicTexture texture);
UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams,
int updateTimer);
@@ -125,11 +134,53 @@ namespace OpenSim.Region.Framework.Interfaces
// ///
// bool AlwaysIdenticalConversion(string bodyData, string extraParams);
- byte[] ConvertUrl(string url, string extraParams);
- byte[] ConvertData(string bodyData, string extraParams);
+ IDynamicTexture ConvertUrl(string url, string extraParams);
+ IDynamicTexture ConvertData(string bodyData, string extraParams);
+
bool AsyncConvertUrl(UUID id, string url, string extraParams);
bool AsyncConvertData(UUID id, string bodyData, string extraParams);
+
void GetDrawStringSize(string text, string fontName, int fontSize,
out double xSize, out double ySize);
}
+
+ public interface IDynamicTexture
+ {
+ ///
+ /// Input commands used to generate this data.
+ ///
+ ///
+ /// Null if input commands were not used.
+ ///
+ string InputCommands { get; }
+
+ ///
+ /// Uri used to generate this data.
+ ///
+ ///
+ /// Null if a uri was not used.
+ ///
+ Uri InputUri { get; }
+
+ ///
+ /// Extra input params used to generate this data.
+ ///
+ string InputParams { get; }
+
+ ///
+ /// Texture data.
+ ///
+ byte[] Data { get; }
+
+ ///
+ /// Size of texture.
+ ///
+ Size Size { get; }
+
+ ///
+ /// Signal whether the texture is reuseable (i.e. whether the same input data will always generate the same
+ /// texture).
+ ///
+ bool IsReuseable { get; }
+ }
}
--
cgit v1.1