From 9b66108081a8c8cf79faaa6c541554091c40850e Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 6 Feb 2009 16:55:34 +0000 Subject: This changeset is the step 1 of 2 in refactoring OpenSim.Region.Environment into a "framework" part and a modules only part. This first changeset refactors OpenSim.Region.Environment.Scenes, OpenSim.Region.Environment.Interfaces, and OpenSim.Region.Interfaces into OpenSim.Region.Framework.{Interfaces,Scenes} leaving only region modules in OpenSim.Region.Environment. The next step will be to move region modules up from OpenSim.Region.Environment.Modules to OpenSim.Region.CoreModules and then sort out which modules are really core modules and which should move out to forge. I've been very careful to NOT BREAK anything. i hope i've succeeded. as this is the work of a whole week i hope i managed to keep track with the applied patches of the last week --- could any of you that did check in stuff have a look at whether it survived? thx! --- .../Framework/Interfaces/IDynamicTextureManager.cs | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs (limited to 'OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs new file mode 100644 index 0000000..e119bc3 --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -0,0 +1,58 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSim Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System.IO; +using OpenMetaverse; + +namespace OpenSim.Region.Framework.Interfaces +{ + public interface IDynamicTextureManager + { + void RegisterRender(string handleType, IDynamicTextureRender render); + void ReturnData(UUID id, byte[] data); + + UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, + int updateTimer); + UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, + int updateTimer, bool SetBlending, byte AlphaValue); + UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, + int updateTimer); + UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, + int updateTimer, bool SetBlending, byte AlphaValue); + } + + public interface IDynamicTextureRender + { + string GetName(); + string GetContentType(); + bool SupportsAsynchronous(); + byte[] ConvertUrl(string url, string extraParams); + byte[] ConvertStream(Stream data, string extraParams); + bool AsyncConvertUrl(UUID id, string url, string extraParams); + bool AsyncConvertData(UUID id, string bodyData, string extraParams); + } +} -- cgit v1.1 From 383f8b3ac601baef7b2cb322f53fb36b69367286 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 18 Feb 2009 12:56:36 +0000 Subject: From: Christopher Yeoh The attached patch implements osGetDrawStringSize that looks like: vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize) in LSL. It is meant to be used in conjunction with the osDraw* functions. It returns accurate information on the size that a given string will be rendered given the specified font and font size. This allows for nicely formatted and positioned text on the generated image. --- OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index e119bc3..9b29209 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -43,6 +43,8 @@ namespace OpenSim.Region.Framework.Interfaces int updateTimer); UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue); + void GetDrawStringSize(string contentType, string text, string fontName, int fontSize, + out double xSize, out double ySize); } public interface IDynamicTextureRender @@ -54,5 +56,7 @@ namespace OpenSim.Region.Framework.Interfaces byte[] ConvertStream(Stream data, 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); } } -- cgit v1.1 From 3b689e506f82ea45fcf703b22eb50a00e40baa4f Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 22 May 2009 16:22:49 +0000 Subject: From: Alan Webb Changes to support client-side image pre-caching in the region. This commit adds an additional calling sequence to the DynamicTexture data and URL calls. The new interface allows a dynamic image to be loaded into a specific object face (rather than the mandatory ALL_SIDES supported today. This is in part fulfilment of ticket #458. --- OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index 9b29209..80592d7 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -39,10 +39,14 @@ namespace OpenSim.Region.Framework.Interfaces int updateTimer); UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue); + UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, + int updateTimer, bool SetBlending, byte AlphaValue, int face); UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer); UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue); + UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, + int updateTimer, bool SetBlending, byte AlphaValue, int face); void GetDrawStringSize(string contentType, string text, string fontName, int fontSize, out double xSize, out double ySize); } -- cgit v1.1 From 840de6c036570d559ec6924cd8405d3f34a99fdd Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 1 Jun 2009 06:37:14 +0000 Subject: Minor: Change OpenSim to OpenSimulator in older copyright headers and LICENSE.txt. --- OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index 80592d7..f82b322 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -9,7 +9,7 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSim Project nor the + * * Neither the name of the OpenSimulator Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * -- cgit v1.1 From 759636f37e4ea212af4ca40565b2d4e9be1eebbe Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Tue, 9 Jun 2009 06:39:27 +0000 Subject: From: Alan Webb This change addresses two issues: [1] It adds a flag field to the blendface call which allows the caller to indicate whether or not the generated asset is temporary, and whether or not the asset being replaced should be explicitly retired fromt the memory cache. The decimal values correspond to: 0 - Permanent asset, do not expire old asset 1 - Permanent asset, expire old asset 2 - Temporary asset, do not expire old asset 3 - Temporary asset, expire old asset '3' corresponds to the default behavior seen today, and is the continued behavior of the non-blendface calls. [2] The dynamic texture routines are highly-asynchronous and can be scheduled simultaneously on a multi-core machine. The nature of the texture management interfaece is such that updates may be lost, and the nature of asynchornous operation means that they may be processed out of order. A lock has been added to ensure that updates are at least atomic. No attempt has been made to enforce ordering. The lock applies to the SceneObjectPart being updated and is held for the lifetime of the TextureEntry used to carry texture updates (the one instance carries all faces supported by the prim). Users of these services should remember that the dynamic texture call is asynchronous and control will be returned *before* the texture update has actually occurred. As a result, a isubsequent GetTexture call may not return the expected asset id. A script must wait for the corresponding TEXTURE_CHANGED event before retrieving any texture information. --- OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index f82b322..95f9cef 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -30,8 +30,10 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { + public interface IDynamicTextureManager { + void RegisterRender(string handleType, IDynamicTextureRender render); void ReturnData(UUID id, byte[] data); @@ -40,13 +42,13 @@ namespace OpenSim.Region.Framework.Interfaces UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue); UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, - int updateTimer, bool SetBlending, byte AlphaValue, int face); + int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face); UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer); UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue); UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, - int updateTimer, bool SetBlending, byte AlphaValue, int face); + int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face); void GetDrawStringSize(string contentType, string text, string fontName, int fontSize, out double xSize, out double ySize); } -- cgit v1.1 From 2606bf4a535decde80a5836ff3b57c2046908b42 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 16 Nov 2009 19:16:24 +0000 Subject: minor: very minor formatting change --- OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index 95f9cef..abcaf91 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -30,10 +30,8 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { - public interface IDynamicTextureManager { - void RegisterRender(string handleType, IDynamicTextureRender render); void ReturnData(UUID id, byte[] data); -- cgit v1.1 From ad28db3669d7881799c9f88edb98e2186ef462c0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 8 Feb 2010 21:21:21 +0000 Subject: add some method doc to IDynamicTextureManager --- .../Framework/Interfaces/IDynamicTextureManager.cs | 61 +++++++++++++++++++++- 1 file changed, 59 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index abcaf91..c289cdb 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -43,10 +43,67 @@ namespace OpenSim.Region.Framework.Interfaces int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face); UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer); + + /// Apply a dynamically generated texture to all sides of the given prim. The texture is not persisted to the + /// asset service. + /// + /// The simulator in which the texture is being generated + /// The prim to which to apply the texture. + /// The content type to create. Current choices are "vector" to create a vector + /// based texture or "image" to create a texture from an image at a particular URL + /// The data for the generator + /// Parameters for the generator that don't form part of the main data. + /// If zero, the image is never updated after the first generation. If positive + /// the image is updated at the given interval. Not implemented for + /// + /// If true, the newly generated texture is blended with the appropriate existing ones on the prim + /// + /// + /// The alpha value of the generated texture. + /// + /// + /// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need + /// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture + /// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID + /// UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue); - UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, - int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face); + + /// + /// Apply a dynamically generated texture to the given prim. + /// + /// The simulator in which the texture is being generated + /// The prim to which to apply the texture. + /// The content type to create. Current choices are "vector" to create a vector + /// based texture or "image" to create a texture from an image at a particular URL + /// The data for the generator + /// Parameters for the generator that don't form part of the main data. + /// If zero, the image is never updated after the first generation. If positive + /// the image is updated at the given interval. Not implemented for + /// + /// If true, the newly generated texture is blended with the appropriate existing ones on the prim + /// + /// + /// Display flags. If DISP_EXPIRE then the old texture is deleted if it is replaced by a + /// newer generated texture (may not currently be implemented). If DISP_TEMP then the asset is flagged as + /// temporary, which often means that it is not persisted to the database. + /// + /// + /// The alpha value of the generated texture. + /// + /// + /// The face of the prim on which to put the generated texture. If ALL_SIDES then all sides of the prim are + /// set + /// + /// + /// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need + /// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture + /// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID + /// + UUID AddDynamicTextureData( + UUID simID, UUID primID, string contentType, string data, string extraParams, + int updateTimer, bool SetBlending, int disp, byte AlphaValue, int face); + void GetDrawStringSize(string contentType, string text, string fontName, int fontSize, out double xSize, out double ySize); } -- cgit v1.1 From af265e001d3bf043590e480cd6574a14193f6de0 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 15 Feb 2010 19:15:03 +0900 Subject: Formatting cleanup. --- OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index c289cdb..8954513 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -65,7 +65,7 @@ namespace OpenSim.Region.Framework.Interfaces /// The UUID of the texture updater, not the texture UUID. If you need the texture UUID then you will need /// to obtain it directly from the SceneObjectPart. For instance, if ALL_SIDES is set then this texture /// can be obtained as SceneObjectPart.Shape.Textures.DefaultTexture.TextureID - /// + /// UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, string extraParams, int updateTimer, bool SetBlending, byte AlphaValue); -- cgit v1.1 From aa44df9c04658cfa0af9a0f203faea5e493c6f25 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 28 Aug 2012 20:35:17 +0100 Subject: Add IDynamicTextureManager.ConvertData() to match AsyncConvertData(). Remove mismatching ConvertStream() where there is no AsyncConvertStream and neither IDynamicTextureManager implementer implements this method. --- OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index 8954513..773ba73 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -114,7 +114,7 @@ namespace OpenSim.Region.Framework.Interfaces string GetContentType(); bool SupportsAsynchronous(); byte[] ConvertUrl(string url, string extraParams); - byte[] ConvertStream(Stream data, string extraParams); + byte[] 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, -- cgit v1.1 From c1cece4b82d24a17a09b66c9ec3975190cc05d95 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 28 Aug 2012 23:06:53 +0100 Subject: Add experimental DynamicTextureModule.ReuseTextures flag, currently only configurable on compile. Disabled (status quo) by default. This flag makes the dynamic texture module reuse cache previously dynamically generated textures given the same input commands and extra params for 24 hours. This occurs as long as those commands would always generate the same texture (e.g. they do not contain commands to fetch data from the web). This makes texture changing faster as a viewer-cached texture uuid is sent and may reduce simulator load in regions with generation of lots of dynamic textures. A downside is that this stops expiry of old temporary dynamic textures from the cache, Another downside is that a jpeg2000 generation that partially failed is currently not regenerated until restart or after 24 hours. --- .../Region/Framework/Interfaces/IDynamicTextureManager.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs index 773ba73..1a3bcbb 100644 --- a/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs +++ b/OpenSim/Region/Framework/Interfaces/IDynamicTextureManager.cs @@ -33,7 +33,7 @@ namespace OpenSim.Region.Framework.Interfaces public interface IDynamicTextureManager { void RegisterRender(string handleType, IDynamicTextureRender render); - void ReturnData(UUID id, byte[] data); + void ReturnData(UUID id, byte[] data, bool isReuseable); UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, string extraParams, int updateTimer); @@ -113,6 +113,18 @@ namespace OpenSim.Region.Framework.Interfaces string GetName(); string GetContentType(); bool SupportsAsynchronous(); + +// /// +// /// Return true if converting the input body and extra params data will always result in the same byte[] array +// /// +// /// +// /// This method allows the caller to use a previously generated asset if it has one. +// /// +// /// +// /// +// /// +// bool AlwaysIdenticalConversion(string bodyData, string extraParams); + byte[] ConvertUrl(string url, string extraParams); byte[] ConvertData(string bodyData, string extraParams); bool AsyncConvertUrl(UUID id, string url, string extraParams); -- cgit v1.1 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/Interfaces/IDynamicTextureManager.cs') 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