Innitial commit. Did as much as I can for llmediactrl without diving too deep into llviewermedia
This commit is contained in:
@@ -122,7 +122,10 @@ void LLPluginClassMedia::reset_impl(void)
|
|||||||
mStatusText.clear();
|
mStatusText.clear();
|
||||||
mProgressPercent = 0;
|
mProgressPercent = 0;
|
||||||
mClickURL.clear();
|
mClickURL.clear();
|
||||||
|
mClickNavType.clear();
|
||||||
mClickTarget.clear();
|
mClickTarget.clear();
|
||||||
|
mClickUUID.clear();
|
||||||
|
mStatusCode = 0;
|
||||||
|
|
||||||
// media_time class
|
// media_time class
|
||||||
mCurrentTime = 0.0f;
|
mCurrentTime = 0.0f;
|
||||||
@@ -393,6 +396,94 @@ std::string LLPluginClassMedia::translateModifiers(MASK modifiers)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::jsEnableObject( bool enable )
|
||||||
|
{
|
||||||
|
if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_enable_object");
|
||||||
|
message.setValueBoolean( "enable", enable );
|
||||||
|
sendMessage( message );
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::jsAgentLocationEvent( double x, double y, double z )
|
||||||
|
{
|
||||||
|
if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_location");
|
||||||
|
message.setValueReal( "x", x );
|
||||||
|
message.setValueReal( "y", y );
|
||||||
|
message.setValueReal( "z", z );
|
||||||
|
sendMessage( message );
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::jsAgentGlobalLocationEvent( double x, double y, double z )
|
||||||
|
{
|
||||||
|
if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_global_location");
|
||||||
|
message.setValueReal( "x", x );
|
||||||
|
message.setValueReal( "y", y );
|
||||||
|
message.setValueReal( "z", z );
|
||||||
|
sendMessage( message );
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::jsAgentOrientationEvent( double angle )
|
||||||
|
{
|
||||||
|
if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_orientation");
|
||||||
|
message.setValueReal( "angle", angle );
|
||||||
|
|
||||||
|
sendMessage( message );
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::jsAgentLanguageEvent( const std::string& language )
|
||||||
|
{
|
||||||
|
if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_language");
|
||||||
|
message.setValue( "language", language );
|
||||||
|
sendMessage( message );
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::jsAgentRegionEvent( const std::string& region )
|
||||||
|
{
|
||||||
|
if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_region");
|
||||||
|
message.setValue( "region", region );
|
||||||
|
sendMessage( message );
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::jsAgentMaturityEvent( const std::string& maturity )
|
||||||
|
{
|
||||||
|
if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_maturity");
|
||||||
|
message.setValue( "maturity", maturity );
|
||||||
|
sendMessage( message );
|
||||||
|
}
|
||||||
void LLPluginClassMedia::mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers)
|
void LLPluginClassMedia::mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers)
|
||||||
{
|
{
|
||||||
if(type == MOUSE_EVENT_MOVE)
|
if(type == MOUSE_EVENT_MOVE)
|
||||||
@@ -568,6 +659,32 @@ F64 LLPluginClassMedia::getCPUUsage()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::sendPickFileResponse(const std::string &file)
|
||||||
|
{
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file_response");
|
||||||
|
message.setValue("file", file);
|
||||||
|
if(mPlugin && mPlugin->isBlocked())
|
||||||
|
{
|
||||||
|
// If the plugin sent a blocking pick-file request, the response should unblock it.
|
||||||
|
message.setValueBoolean("blocking_response", true);
|
||||||
|
}
|
||||||
|
sendMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::sendAuthResponse(bool ok, const std::string &username, const std::string &password)
|
||||||
|
{
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "auth_response");
|
||||||
|
message.setValueBoolean("ok", ok);
|
||||||
|
message.setValue("username", username);
|
||||||
|
message.setValue("password", password);
|
||||||
|
if(mPlugin && mPlugin->isBlocked())
|
||||||
|
{
|
||||||
|
// If the plugin sent a blocking pick-file request, the response should unblock it.
|
||||||
|
message.setValueBoolean("blocking_response", true);
|
||||||
|
}
|
||||||
|
sendMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
void LLPluginClassMedia::cut()
|
void LLPluginClassMedia::cut()
|
||||||
{
|
{
|
||||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_cut");
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_cut");
|
||||||
@@ -614,6 +731,10 @@ void LLPluginClassMedia::setJavascriptEnabled(const bool enabled)
|
|||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::setTarget(const std::string &target)
|
||||||
|
{
|
||||||
|
mTarget = target;
|
||||||
|
}
|
||||||
/* virtual */
|
/* virtual */
|
||||||
void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
|
void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
|
||||||
{
|
{
|
||||||
@@ -828,6 +949,16 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
|
|||||||
mMediaName = message.getValue("name");
|
mMediaName = message.getValue("name");
|
||||||
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAME_CHANGED);
|
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAME_CHANGED);
|
||||||
}
|
}
|
||||||
|
else if(message_name == "pick_file")
|
||||||
|
{
|
||||||
|
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PICK_FILE_REQUEST);
|
||||||
|
}
|
||||||
|
else if(message_name == "auth_request")
|
||||||
|
{
|
||||||
|
mAuthURL = message.getValue("url");
|
||||||
|
mAuthRealm = message.getValue("realm");
|
||||||
|
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_AUTH_REQUEST);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
|
LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
|
||||||
@@ -870,14 +1001,21 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
|
|||||||
{
|
{
|
||||||
mClickURL = message.getValue("uri");
|
mClickURL = message.getValue("uri");
|
||||||
mClickTarget = message.getValue("target");
|
mClickTarget = message.getValue("target");
|
||||||
|
mClickUUID = message.getValue("uuid");
|
||||||
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF);
|
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF);
|
||||||
}
|
}
|
||||||
else if(message_name == "click_nofollow")
|
else if(message_name == "click_nofollow")
|
||||||
{
|
{
|
||||||
mClickURL = message.getValue("uri");
|
mClickURL = message.getValue("uri");
|
||||||
|
mClickNavType = message.getValue("nav_type");
|
||||||
mClickTarget.clear();
|
mClickTarget.clear();
|
||||||
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW);
|
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW);
|
||||||
}
|
}
|
||||||
|
else if(message_name == "navigate_error_page")
|
||||||
|
{
|
||||||
|
mStatusCode = message.getValueS32("status_code");
|
||||||
|
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_ERROR_PAGE);
|
||||||
|
}
|
||||||
else if(message_name == "cookie_set")
|
else if(message_name == "cookie_set")
|
||||||
{
|
{
|
||||||
if(mOwner)
|
if(mOwner)
|
||||||
@@ -885,6 +1023,29 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
|
|||||||
mOwner->handleCookieSet(this, message.getValue("cookie"));
|
mOwner->handleCookieSet(this, message.getValue("cookie"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(message_name == "close_request")
|
||||||
|
{
|
||||||
|
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLOSE_REQUEST);
|
||||||
|
}
|
||||||
|
else if(message_name == "geometry_change")
|
||||||
|
{
|
||||||
|
mClickUUID = message.getValue("uuid");
|
||||||
|
mGeometryX = message.getValueS32("x");
|
||||||
|
mGeometryY = message.getValueS32("y");
|
||||||
|
mGeometryWidth = message.getValueS32("width");
|
||||||
|
mGeometryHeight = message.getValueS32("height");
|
||||||
|
|
||||||
|
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_GEOMETRY_CHANGE);
|
||||||
|
}
|
||||||
|
else if(message_name == "link_hovered")
|
||||||
|
{
|
||||||
|
// text is not currently used -- the tooltip hover text is taken from the "title".
|
||||||
|
mHoverLink = message.getValue("link");
|
||||||
|
mHoverText = message.getValue("title");
|
||||||
|
// message.getValue("text");
|
||||||
|
|
||||||
|
mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_LINK_HOVERED);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
|
LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
|
||||||
@@ -1025,6 +1186,39 @@ void LLPluginClassMedia::setBrowserUserAgent(const std::string& user_agent)
|
|||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::proxyWindowOpened(const std::string &target, const std::string &uuid)
|
||||||
|
{
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "proxy_window_opened");
|
||||||
|
|
||||||
|
message.setValue("target", target);
|
||||||
|
message.setValue("uuid", uuid);
|
||||||
|
|
||||||
|
sendMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::proxyWindowClosed(const std::string &uuid)
|
||||||
|
{
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "proxy_window_closed");
|
||||||
|
|
||||||
|
message.setValue("uuid", uuid);
|
||||||
|
|
||||||
|
sendMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::ignore_ssl_cert_errors(bool ignore)
|
||||||
|
{
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "ignore_ssl_cert_errors");
|
||||||
|
message.setValueBoolean("ignore", ignore);
|
||||||
|
sendMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLPluginClassMedia::addCertificateFilePath(const std::string& path)
|
||||||
|
{
|
||||||
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "add_certificate_file_path");
|
||||||
|
message.setValue("path", path);
|
||||||
|
sendMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
void LLPluginClassMedia::crashPlugin()
|
void LLPluginClassMedia::crashPlugin()
|
||||||
{
|
{
|
||||||
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "crash");
|
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "crash");
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#ifndef LL_LLPLUGINCLASSMEDIA_H
|
#ifndef LL_LLPLUGINCLASSMEDIA_H
|
||||||
#define LL_LLPLUGINCLASSMEDIA_H
|
#define LL_LLPLUGINCLASSMEDIA_H
|
||||||
|
|
||||||
|
#include "llgltypes.h"
|
||||||
#include "llpluginclassbasic.h"
|
#include "llpluginclassbasic.h"
|
||||||
#include "llrect.h"
|
#include "llrect.h"
|
||||||
#include "v4color.h"
|
#include "v4color.h"
|
||||||
@@ -79,6 +80,8 @@ public:
|
|||||||
|
|
||||||
void setBackgroundColor(LLColor4 color) { mBackgroundColor = color; };
|
void setBackgroundColor(LLColor4 color) { mBackgroundColor = color; };
|
||||||
|
|
||||||
|
void setOwner(LLPluginClassMediaOwner *owner) { mOwner = owner; };
|
||||||
|
|
||||||
// Returns true if all of the texture parameters (depth, format, size, and texture size) are set up and consistent.
|
// Returns true if all of the texture parameters (depth, format, size, and texture size) are set up and consistent.
|
||||||
// This will initially be false, and will also be false for some time after setSize while the resize is processed.
|
// This will initially be false, and will also be false for some time after setSize while the resize is processed.
|
||||||
// Note that if this returns true, it is safe to use all the get() functions above without checking for invalid return values
|
// Note that if this returns true, it is safe to use all the get() functions above without checking for invalid return values
|
||||||
@@ -88,27 +91,36 @@ public:
|
|||||||
bool getDirty(LLRect *dirty_rect = NULL);
|
bool getDirty(LLRect *dirty_rect = NULL);
|
||||||
void resetDirty(void);
|
void resetDirty(void);
|
||||||
|
|
||||||
enum EMouseEventType
|
typedef enum
|
||||||
{
|
{
|
||||||
MOUSE_EVENT_DOWN,
|
MOUSE_EVENT_DOWN,
|
||||||
MOUSE_EVENT_UP,
|
MOUSE_EVENT_UP,
|
||||||
MOUSE_EVENT_MOVE,
|
MOUSE_EVENT_MOVE,
|
||||||
MOUSE_EVENT_DOUBLE_CLICK
|
MOUSE_EVENT_DOUBLE_CLICK
|
||||||
};
|
}EMouseEventType;
|
||||||
|
|
||||||
void mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers);
|
void mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers);
|
||||||
|
|
||||||
enum EKeyEventType
|
typedef enum
|
||||||
{
|
{
|
||||||
KEY_EVENT_DOWN,
|
KEY_EVENT_DOWN,
|
||||||
KEY_EVENT_UP,
|
KEY_EVENT_UP,
|
||||||
KEY_EVENT_REPEAT
|
KEY_EVENT_REPEAT
|
||||||
};
|
}EKeyEventType;
|
||||||
|
|
||||||
bool keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data);
|
bool keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data);
|
||||||
|
|
||||||
void scrollEvent(int x, int y, MASK modifiers);
|
void scrollEvent(int x, int y, MASK modifiers);
|
||||||
|
|
||||||
|
// Javascript <-> viewer events
|
||||||
|
void jsEnableObject( bool enable );
|
||||||
|
void jsAgentLocationEvent( double x, double y, double z );
|
||||||
|
void jsAgentGlobalLocationEvent( double x, double y, double z );
|
||||||
|
void jsAgentOrientationEvent( double angle );
|
||||||
|
void jsAgentLanguageEvent( const std::string& language );
|
||||||
|
void jsAgentRegionEvent( const std::string& region_name );
|
||||||
|
void jsAgentMaturityEvent( const std::string& maturity );
|
||||||
|
|
||||||
// Text may be unicode (utf8 encoded)
|
// Text may be unicode (utf8 encoded)
|
||||||
bool textInput(const std::string &text, MASK modifiers, LLSD native_key_data);
|
bool textInput(const std::string &text, MASK modifiers, LLSD native_key_data);
|
||||||
|
|
||||||
@@ -124,6 +136,10 @@ public:
|
|||||||
void setLowPrioritySizeLimit(int size);
|
void setLowPrioritySizeLimit(int size);
|
||||||
|
|
||||||
F64 getCPUUsage();
|
F64 getCPUUsage();
|
||||||
|
|
||||||
|
void sendPickFileResponse(const std::string &file);
|
||||||
|
|
||||||
|
void sendAuthResponse(bool ok, const std::string &username, const std::string &password);
|
||||||
|
|
||||||
// Valid after a MEDIA_EVENT_CURSOR_CHANGED event
|
// Valid after a MEDIA_EVENT_CURSOR_CHANGED event
|
||||||
std::string getCursorName() const { return mCursorName; };
|
std::string getCursorName() const { return mCursorName; };
|
||||||
@@ -144,7 +160,8 @@ public:
|
|||||||
void setLanguageCode(const std::string &language_code);
|
void setLanguageCode(const std::string &language_code);
|
||||||
void setPluginsEnabled(const bool enabled);
|
void setPluginsEnabled(const bool enabled);
|
||||||
void setJavascriptEnabled(const bool enabled);
|
void setJavascriptEnabled(const bool enabled);
|
||||||
|
void setTarget(const std::string &target);
|
||||||
|
|
||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
// media browser class functions
|
// media browser class functions
|
||||||
bool pluginSupportsMediaBrowser(void);
|
bool pluginSupportsMediaBrowser(void);
|
||||||
@@ -161,6 +178,10 @@ public:
|
|||||||
void browse_back();
|
void browse_back();
|
||||||
void set_status_redirect(int code, const std::string &url);
|
void set_status_redirect(int code, const std::string &url);
|
||||||
void setBrowserUserAgent(const std::string& user_agent);
|
void setBrowserUserAgent(const std::string& user_agent);
|
||||||
|
void proxyWindowOpened(const std::string &target, const std::string &uuid);
|
||||||
|
void proxyWindowClosed(const std::string &uuid);
|
||||||
|
void ignore_ssl_cert_errors(bool ignore);
|
||||||
|
void addCertificateFilePath(const std::string& path);
|
||||||
|
|
||||||
// This is valid after MEDIA_EVENT_NAVIGATE_BEGIN or MEDIA_EVENT_NAVIGATE_COMPLETE
|
// This is valid after MEDIA_EVENT_NAVIGATE_BEGIN or MEDIA_EVENT_NAVIGATE_COMPLETE
|
||||||
std::string getNavigateURI() const { return mNavigateURI; };
|
std::string getNavigateURI() const { return mNavigateURI; };
|
||||||
@@ -183,10 +204,32 @@ public:
|
|||||||
// This is valid after MEDIA_EVENT_CLICK_LINK_HREF or MEDIA_EVENT_CLICK_LINK_NOFOLLOW
|
// This is valid after MEDIA_EVENT_CLICK_LINK_HREF or MEDIA_EVENT_CLICK_LINK_NOFOLLOW
|
||||||
std::string getClickURL() const { return mClickURL; };
|
std::string getClickURL() const { return mClickURL; };
|
||||||
|
|
||||||
|
// This is valid after MEDIA_EVENT_CLICK_LINK_NOFOLLOW
|
||||||
|
std::string getClickNavType() const { return mClickNavType; };
|
||||||
|
|
||||||
// This is valid after MEDIA_EVENT_CLICK_LINK_HREF
|
// This is valid after MEDIA_EVENT_CLICK_LINK_HREF
|
||||||
std::string getClickTarget() const { return mClickTarget; };
|
std::string getClickTarget() const { return mClickTarget; };
|
||||||
|
|
||||||
|
// This is valid during MEDIA_EVENT_CLICK_LINK_HREF and MEDIA_EVENT_GEOMETRY_CHANGE
|
||||||
|
std::string getClickUUID() const { return mClickUUID; };
|
||||||
|
|
||||||
|
// This is valid after MEDIA_EVENT_NAVIGATE_ERROR_PAGE
|
||||||
|
S32 getStatusCode() const { return mStatusCode; };
|
||||||
|
|
||||||
|
// These are valid during MEDIA_EVENT_GEOMETRY_CHANGE
|
||||||
|
S32 getGeometryX() const { return mGeometryX; };
|
||||||
|
S32 getGeometryY() const { return mGeometryY; };
|
||||||
|
S32 getGeometryWidth() const { return mGeometryWidth; };
|
||||||
|
S32 getGeometryHeight() const { return mGeometryHeight; };
|
||||||
|
|
||||||
|
// These are valid during MEDIA_EVENT_AUTH_REQUEST
|
||||||
|
std::string getAuthURL() const { return mAuthURL; };
|
||||||
|
std::string getAuthRealm() const { return mAuthRealm; };
|
||||||
|
|
||||||
|
// These are valid during MEDIA_EVENT_LINK_HOVERED
|
||||||
|
std::string getHoverText() const { return mHoverText; };
|
||||||
|
std::string getHoverLink() const { return mHoverLink; };
|
||||||
|
|
||||||
std::string getMediaName() const { return mMediaName; };
|
std::string getMediaName() const { return mMediaName; };
|
||||||
std::string getMediaDescription() const { return mMediaDescription; };
|
std::string getMediaDescription() const { return mMediaDescription; };
|
||||||
|
|
||||||
@@ -228,12 +271,12 @@ protected:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
LLPluginClassMediaOwner *mOwner;
|
LLPluginClassMediaOwner *mOwner;
|
||||||
|
|
||||||
bool mTextureParamsReceived; // the mRequestedTexture* fields are only valid when this is true
|
bool mTextureParamsReceived; // the mRequestedTexture* fields are only valid when this is true
|
||||||
S32 mRequestedTextureDepth;
|
S32 mRequestedTextureDepth;
|
||||||
U32 mRequestedTextureInternalFormat;
|
LLGLenum mRequestedTextureInternalFormat;
|
||||||
U32 mRequestedTextureFormat;
|
LLGLenum mRequestedTextureFormat;
|
||||||
U32 mRequestedTextureType;
|
LLGLenum mRequestedTextureType;
|
||||||
bool mRequestedTextureSwapBytes;
|
bool mRequestedTextureSwapBytes;
|
||||||
bool mRequestedTextureCoordsOpenGL;
|
bool mRequestedTextureCoordsOpenGL;
|
||||||
|
|
||||||
@@ -299,6 +342,8 @@ protected:
|
|||||||
|
|
||||||
LLColor4 mBackgroundColor;
|
LLColor4 mBackgroundColor;
|
||||||
|
|
||||||
|
std::string mTarget;
|
||||||
|
|
||||||
/////////////////////////////////////////
|
/////////////////////////////////////////
|
||||||
// media_browser class
|
// media_browser class
|
||||||
std::string mNavigateURI;
|
std::string mNavigateURI;
|
||||||
@@ -310,7 +355,18 @@ protected:
|
|||||||
int mProgressPercent;
|
int mProgressPercent;
|
||||||
std::string mLocation;
|
std::string mLocation;
|
||||||
std::string mClickURL;
|
std::string mClickURL;
|
||||||
|
std::string mClickNavType;
|
||||||
std::string mClickTarget;
|
std::string mClickTarget;
|
||||||
|
std::string mClickUUID;
|
||||||
|
S32 mGeometryX;
|
||||||
|
S32 mGeometryY;
|
||||||
|
S32 mGeometryWidth;
|
||||||
|
S32 mGeometryHeight;
|
||||||
|
S32 mStatusCode;
|
||||||
|
std::string mAuthURL;
|
||||||
|
std::string mAuthRealm;
|
||||||
|
std::string mHoverText;
|
||||||
|
std::string mHoverLink;
|
||||||
|
|
||||||
/////////////////////////////////////////
|
/////////////////////////////////////////
|
||||||
// media_time class
|
// media_time class
|
||||||
|
|||||||
@@ -59,11 +59,19 @@ public:
|
|||||||
MEDIA_EVENT_STATUS_TEXT_CHANGED, // browser has updated the status text
|
MEDIA_EVENT_STATUS_TEXT_CHANGED, // browser has updated the status text
|
||||||
MEDIA_EVENT_NAME_CHANGED, // browser has updated the name of the media (typically <title> tag)
|
MEDIA_EVENT_NAME_CHANGED, // browser has updated the name of the media (typically <title> tag)
|
||||||
MEDIA_EVENT_LOCATION_CHANGED, // browser location (URL) has changed (maybe due to internal navagation/frames/etc)
|
MEDIA_EVENT_LOCATION_CHANGED, // browser location (URL) has changed (maybe due to internal navagation/frames/etc)
|
||||||
|
MEDIA_EVENT_NAVIGATE_ERROR_PAGE, // browser navigated to a page that resulted in an HTTP error
|
||||||
MEDIA_EVENT_CLICK_LINK_HREF, // I'm not entirely sure what the semantics of these two are
|
MEDIA_EVENT_CLICK_LINK_HREF, // I'm not entirely sure what the semantics of these two are
|
||||||
MEDIA_EVENT_CLICK_LINK_NOFOLLOW,
|
MEDIA_EVENT_CLICK_LINK_NOFOLLOW,
|
||||||
|
MEDIA_EVENT_CLOSE_REQUEST, // The plugin requested its window be closed (currently hooked up to javascript window.close in webkit)
|
||||||
|
MEDIA_EVENT_PICK_FILE_REQUEST, // The plugin wants the user to pick a file
|
||||||
|
MEDIA_EVENT_GEOMETRY_CHANGE, // The plugin requested its window geometry be changed (per the javascript window interface)
|
||||||
|
|
||||||
MEDIA_EVENT_PLUGIN_FAILED_LAUNCH, // The plugin failed to launch
|
MEDIA_EVENT_PLUGIN_FAILED_LAUNCH, // The plugin failed to launch
|
||||||
MEDIA_EVENT_PLUGIN_FAILED // The plugin died unexpectedly
|
MEDIA_EVENT_PLUGIN_FAILED, // The plugin died unexpectedly
|
||||||
|
|
||||||
|
MEDIA_EVENT_AUTH_REQUEST, // The plugin wants to display an auth dialog
|
||||||
|
|
||||||
|
MEDIA_EVENT_LINK_HOVERED // Got a "link hovered" event from the plugin
|
||||||
|
|
||||||
} EMediaEvent;
|
} EMediaEvent;
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,28 @@ LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LLFloaterMediaBrowser::geometryChanged(S32 x, S32 y, S32 width, S32 height)
|
||||||
|
{
|
||||||
|
// Make sure the layout of the browser control is updated, so this calculation is correct.
|
||||||
|
LLLayoutStack::updateClass();
|
||||||
|
|
||||||
|
// TODO: need to adjust size and constrain position to make sure floaters aren't moved outside the window view, etc.
|
||||||
|
LLCoordWindow window_size;
|
||||||
|
getWindow()->getSize(&window_size);
|
||||||
|
|
||||||
|
// Adjust width and height for the size of the chrome on the Media Browser window.
|
||||||
|
width += getRect().getWidth() - mBrowser->getRect().getWidth();
|
||||||
|
height += getRect().getHeight() - mBrowser->getRect().getHeight();
|
||||||
|
|
||||||
|
LLRect geom;
|
||||||
|
geom.setOriginAndSize(x, window_size.mY - (y + height), width, height);
|
||||||
|
|
||||||
|
lldebugs << "geometry change: " << geom << llendl;
|
||||||
|
|
||||||
|
handleReshape(geom,false);
|
||||||
|
}
|
||||||
|
|
||||||
void LLFloaterMediaBrowser::draw()
|
void LLFloaterMediaBrowser::draw()
|
||||||
{
|
{
|
||||||
childSetEnabled("go", !mAddressCombo->getValue().asString().empty());
|
childSetEnabled("go", !mAddressCombo->getValue().asString().empty());
|
||||||
@@ -105,6 +127,7 @@ BOOL LLFloaterMediaBrowser::postBuild()
|
|||||||
mAddressCombo = getChild<LLComboBox>("address");
|
mAddressCombo = getChild<LLComboBox>("address");
|
||||||
mAddressCombo->setCommitCallback(onEnterAddress);
|
mAddressCombo->setCommitCallback(onEnterAddress);
|
||||||
mAddressCombo->setCallbackUserData(this);
|
mAddressCombo->setCallbackUserData(this);
|
||||||
|
mAddressCombo->sortByName();
|
||||||
|
|
||||||
childSetAction("back", onClickBack, this);
|
childSetAction("back", onClickBack, this);
|
||||||
childSetAction("forward", onClickForward, this);
|
childSetAction("forward", onClickForward, this);
|
||||||
@@ -146,7 +169,10 @@ void LLFloaterMediaBrowser::buildURLHistory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// initialize URL history in the plugin
|
// initialize URL history in the plugin
|
||||||
mBrowser->getMediaPlugin()->initializeUrlHistory(browser_history);
|
if(mBrowser && mBrowser->getMediaPlugin())
|
||||||
|
{
|
||||||
|
mBrowser->getMediaPlugin()->initializeUrlHistory(browser_history);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string LLFloaterMediaBrowser::getSupportURL()
|
std::string LLFloaterMediaBrowser::getSupportURL()
|
||||||
@@ -171,6 +197,15 @@ void LLFloaterMediaBrowser::handleMediaEvent(LLPluginClassMedia* self, EMediaEve
|
|||||||
childSetEnabled("back", self->getHistoryBackAvailable());
|
childSetEnabled("back", self->getHistoryBackAvailable());
|
||||||
childSetEnabled("forward", self->getHistoryForwardAvailable());
|
childSetEnabled("forward", self->getHistoryForwardAvailable());
|
||||||
}
|
}
|
||||||
|
else if(event == MEDIA_EVENT_CLOSE_REQUEST)
|
||||||
|
{
|
||||||
|
// The browser instance wants its window closed.
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
else if(event == MEDIA_EVENT_GEOMETRY_CHANGE)
|
||||||
|
{
|
||||||
|
geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void LLFloaterMediaBrowser::setCurrentURL(const std::string& url)
|
void LLFloaterMediaBrowser::setCurrentURL(const std::string& url)
|
||||||
{
|
{
|
||||||
@@ -213,7 +248,15 @@ void LLFloaterMediaBrowser::onClickRefresh(void* user_data)
|
|||||||
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
|
LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data;
|
||||||
|
|
||||||
self->mAddressCombo->remove(0);
|
self->mAddressCombo->remove(0);
|
||||||
self->mBrowser->navigateTo(self->mCurrentURL);
|
if( self->mBrowser->getMediaPlugin() && self->mBrowser->getMediaPlugin()->pluginSupportsMediaBrowser())
|
||||||
|
{
|
||||||
|
bool ignore_cache = true;
|
||||||
|
self->mBrowser->getMediaPlugin()->browse_reload( ignore_cache );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self->mBrowser->navigateTo(self->mCurrentURL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//static
|
//static
|
||||||
|
|||||||
@@ -64,6 +64,9 @@ class LLFloaterMediaBrowser :
|
|||||||
public:
|
public:
|
||||||
LLFloaterMediaBrowser(const LLSD& media_data);
|
LLFloaterMediaBrowser(const LLSD& media_data);
|
||||||
|
|
||||||
|
|
||||||
|
void geometryChanged(S32 x, S32 y, S32 width, S32 height);
|
||||||
|
|
||||||
/*virtual*/ BOOL postBuild();
|
/*virtual*/ BOOL postBuild();
|
||||||
/*virtual*/ void onClose(bool app_quitting);
|
/*virtual*/ void onClose(bool app_quitting);
|
||||||
/*virtual*/ void draw();
|
/*virtual*/ void draw();
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ static LLRegisterWidget<LLMediaCtrl> r("web_browser");
|
|||||||
|
|
||||||
LLMediaCtrl::LLMediaCtrl( const std::string& name, const LLRect& rect ) :
|
LLMediaCtrl::LLMediaCtrl( const std::string& name, const LLRect& rect ) :
|
||||||
LLUICtrl( name, rect, FALSE, NULL, NULL ),
|
LLUICtrl( name, rect, FALSE, NULL, NULL ),
|
||||||
|
LLInstanceTracker<LLMediaCtrl, LLUUID>(LLUUID::generateNewID()),
|
||||||
mTextureDepthBytes( 4 ),
|
mTextureDepthBytes( 4 ),
|
||||||
mWebBrowserImage( 0 ),
|
mWebBrowserImage( 0 ),
|
||||||
mBorder(NULL),
|
mBorder(NULL),
|
||||||
@@ -82,28 +83,26 @@ LLMediaCtrl::LLMediaCtrl( const std::string& name, const LLRect& rect ) :
|
|||||||
mLastSetCursor( UI_CURSOR_ARROW ),
|
mLastSetCursor( UI_CURSOR_ARROW ),
|
||||||
mStretchToFill( true ),
|
mStretchToFill( true ),
|
||||||
mMaintainAspectRatio ( true ),
|
mMaintainAspectRatio ( true ),
|
||||||
|
mDecoupleTextureSize ( false ),
|
||||||
|
mTextureWidth ( 1024 ),
|
||||||
|
mTextureHeight ( 1024 ),
|
||||||
mHideLoading (false)
|
mHideLoading (false)
|
||||||
{
|
{
|
||||||
S32 screen_width = mIgnoreUIScale ?
|
if(!getDecoupleTextureSize())
|
||||||
llround((F32)getRect().getWidth() * LLUI::sGLScaleFactor.mV[VX]) : getRect().getWidth();
|
|
||||||
S32 screen_height = mIgnoreUIScale ?
|
|
||||||
llround((F32)getRect().getHeight() * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight();
|
|
||||||
|
|
||||||
mMediaSource = LLViewerMedia::newMediaImpl(mHomePageUrl, LLUUID::null, screen_width, screen_height, false, false, "text/html");
|
|
||||||
if ( !mMediaSource )
|
|
||||||
{
|
{
|
||||||
llwarns << "media source create failed " << llendl;
|
S32 screen_width = mIgnoreUIScale ?
|
||||||
return;
|
llround((F32)getRect().getWidth() * LLUI::sGLScaleFactor.mV[VX]) : getRect().getWidth();
|
||||||
|
S32 screen_height = mIgnoreUIScale ?
|
||||||
|
llround((F32)getRect().getHeight() * LLUI::sGLScaleFactor.mV[VY]) : getRect().getHeight();
|
||||||
|
|
||||||
|
setTextureSize(screen_width, screen_height);
|
||||||
}
|
}
|
||||||
else
|
// We don't need to create the media source up front anymore unless we have a non-empty home URL to navigate to.
|
||||||
|
if(!mHomePageUrl.empty())
|
||||||
{
|
{
|
||||||
// create a new texture (based on LLDynamic texture) that will be used to display the output
|
navigateHome();
|
||||||
mWebBrowserImage = new LLWebBrowserTexture( screen_width, screen_height, this, mMediaSource );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mMediaSource->setVisible( getVisible() );
|
|
||||||
|
|
||||||
mMediaSource->addObserver( this );
|
|
||||||
|
|
||||||
LLRect border_rect( 0, getRect().getHeight() + 2, getRect().getWidth() + 2, 0 );
|
LLRect border_rect( 0, getRect().getHeight() + 2, getRect().getWidth() + 2, 0 );
|
||||||
mBorder = new LLViewBorder( std::string("web control border"), border_rect, LLViewBorder::BEVEL_IN );
|
mBorder = new LLViewBorder( std::string("web control border"), border_rect, LLViewBorder::BEVEL_IN );
|
||||||
@@ -121,10 +120,7 @@ LLMediaCtrl::~LLMediaCtrl()
|
|||||||
mMediaSource = NULL;
|
mMediaSource = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( mWebBrowserImage )
|
mWebBrowserImage = NULL;
|
||||||
{
|
|
||||||
mWebBrowserImage = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -144,6 +140,7 @@ void LLMediaCtrl::setTakeFocusOnClick( bool take_focus )
|
|||||||
mTakeFocusOnClick = take_focus;
|
mTakeFocusOnClick = take_focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// set flag that forces the embedded browser to open links in the external system browser
|
// set flag that forces the embedded browser to open links in the external system browser
|
||||||
void LLMediaCtrl::setOpenInExternalBrowser( bool valIn )
|
void LLMediaCtrl::setOpenInExternalBrowser( bool valIn )
|
||||||
@@ -168,12 +165,15 @@ void LLMediaCtrl::setTrusted( bool valIn )
|
|||||||
//
|
//
|
||||||
BOOL LLMediaCtrl::handleHover( S32 x, S32 y, MASK mask )
|
BOOL LLMediaCtrl::handleHover( S32 x, S32 y, MASK mask )
|
||||||
{
|
{
|
||||||
|
if (LLUICtrl::handleHover(x, y, mask)) return TRUE;
|
||||||
convertInputCoords(x, y);
|
convertInputCoords(x, y);
|
||||||
|
|
||||||
if (mMediaSource)
|
if (mMediaSource)
|
||||||
|
{
|
||||||
mMediaSource->mouseMove(x, y);
|
mMediaSource->mouseMove(x, y);
|
||||||
|
|
||||||
gViewerWindow->setCursor(mLastSetCursor);
|
gViewerWindow->setCursor(mLastSetCursor);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -182,6 +182,7 @@ BOOL LLMediaCtrl::handleHover( S32 x, S32 y, MASK mask )
|
|||||||
//
|
//
|
||||||
BOOL LLMediaCtrl::handleScrollWheel( S32 x, S32 y, S32 clicks )
|
BOOL LLMediaCtrl::handleScrollWheel( S32 x, S32 y, S32 clicks )
|
||||||
{
|
{
|
||||||
|
if (LLUICtrl::handleScrollWheel(x, y, clicks)) return TRUE;
|
||||||
if (mMediaSource && mMediaSource->hasMedia())
|
if (mMediaSource && mMediaSource->hasMedia())
|
||||||
mMediaSource->getMediaPlugin()->scrollEvent(0, clicks, MASK_NONE);
|
mMediaSource->getMediaPlugin()->scrollEvent(0, clicks, MASK_NONE);
|
||||||
|
|
||||||
@@ -192,19 +193,20 @@ BOOL LLMediaCtrl::handleScrollWheel( S32 x, S32 y, S32 clicks )
|
|||||||
//
|
//
|
||||||
BOOL LLMediaCtrl::handleMouseUp( S32 x, S32 y, MASK mask )
|
BOOL LLMediaCtrl::handleMouseUp( S32 x, S32 y, MASK mask )
|
||||||
{
|
{
|
||||||
|
if (LLUICtrl::handleMouseUp(x, y, mask)) return TRUE;
|
||||||
convertInputCoords(x, y);
|
convertInputCoords(x, y);
|
||||||
|
|
||||||
if (mMediaSource)
|
if (mMediaSource)
|
||||||
{
|
{
|
||||||
mMediaSource->mouseUp(x, y);
|
mMediaSource->mouseUp(x, y);
|
||||||
|
|
||||||
// *HACK: LLMediaImplLLMozLib automatically takes focus on mouseup,
|
/*// *HACK: LLMediaImplLLMozLib automatically takes focus on mouseup,
|
||||||
// in addition to the onFocusReceived() call below. Undo this. JC
|
// in addition to the onFocusReceived() call below. Undo this. JC
|
||||||
if (!mTakeFocusOnClick)
|
if (!mTakeFocusOnClick)
|
||||||
{
|
{
|
||||||
mMediaSource->focus(false);
|
mMediaSource->focus(false);
|
||||||
gViewerWindow->focusClient();
|
gViewerWindow->focusClient();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
gFocusMgr.setMouseCapture( NULL );
|
gFocusMgr.setMouseCapture( NULL );
|
||||||
@@ -216,6 +218,7 @@ BOOL LLMediaCtrl::handleMouseUp( S32 x, S32 y, MASK mask )
|
|||||||
//
|
//
|
||||||
BOOL LLMediaCtrl::handleMouseDown( S32 x, S32 y, MASK mask )
|
BOOL LLMediaCtrl::handleMouseDown( S32 x, S32 y, MASK mask )
|
||||||
{
|
{
|
||||||
|
if (LLUICtrl::handleMouseDown(x, y, mask)) return TRUE;
|
||||||
convertInputCoords(x, y);
|
convertInputCoords(x, y);
|
||||||
|
|
||||||
if (mMediaSource)
|
if (mMediaSource)
|
||||||
@@ -233,12 +236,60 @@ BOOL LLMediaCtrl::handleMouseDown( S32 x, S32 y, MASK mask )
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
BOOL LLMediaCtrl::handleDoubleClick( S32 x, S32 y, MASK mask )
|
BOOL LLMediaCtrl::handleRightMouseUp( S32 x, S32 y, MASK mask )
|
||||||
{
|
{
|
||||||
|
/*if (LLPanel::handleRightMouseUp(x, y, mask)) return TRUE;
|
||||||
convertInputCoords(x, y);
|
convertInputCoords(x, y);
|
||||||
|
|
||||||
if (mMediaSource)
|
if (mMediaSource)
|
||||||
mMediaSource->mouseLeftDoubleClick( x, y );
|
{
|
||||||
|
mMediaSource->mouseUp(x, y, mask, 1);
|
||||||
|
|
||||||
|
// *HACK: LLMediaImplLLMozLib automatically takes focus on mouseup,
|
||||||
|
// in addition to the onFocusReceived() call below. Undo this. JC
|
||||||
|
if (!mTakeFocusOnClick)
|
||||||
|
{
|
||||||
|
mMediaSource->focus(false);
|
||||||
|
gViewerWindow->focusClient();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gFocusMgr.setMouseCapture( NULL );
|
||||||
|
*/
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
BOOL LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask )
|
||||||
|
{
|
||||||
|
if (LLUICtrl::handleRightMouseDown(x, y, mask)) return TRUE;
|
||||||
|
|
||||||
|
/*S32 media_x = x, media_y = y;
|
||||||
|
convertInputCoords(media_x, media_y);
|
||||||
|
|
||||||
|
if (mMediaSource)
|
||||||
|
mMediaSource->mouseDown(media_x, media_y);
|
||||||
|
|
||||||
|
gFocusMgr.setMouseCapture( this );
|
||||||
|
|
||||||
|
if (mTakeFocusOnClick)
|
||||||
|
{
|
||||||
|
setFocus( TRUE );
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
BOOL LLMediaCtrl::handleDoubleClick( S32 x, S32 y, MASK mask )
|
||||||
|
{
|
||||||
|
if (LLUICtrl::handleDoubleClick(x, y, mask)) return TRUE;
|
||||||
|
convertInputCoords(x, y);
|
||||||
|
|
||||||
|
if (mMediaSource)
|
||||||
|
mMediaSource->mouseLeftDoubleClick( x, y);
|
||||||
|
|
||||||
gFocusMgr.setMouseCapture( this );
|
gFocusMgr.setMouseCapture( this );
|
||||||
|
|
||||||
@@ -374,18 +425,18 @@ void LLMediaCtrl::onVisibilityChange ( BOOL new_visibility )
|
|||||||
//
|
//
|
||||||
void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent )
|
void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent )
|
||||||
{
|
{
|
||||||
S32 screen_width = mIgnoreUIScale ? llround((F32)width * LLUI::sGLScaleFactor.mV[VX]) : width;
|
if(!getDecoupleTextureSize())
|
||||||
S32 screen_height = mIgnoreUIScale ? llround((F32)height * LLUI::sGLScaleFactor.mV[VY]) : height;
|
|
||||||
|
|
||||||
// llinfos << "reshape called with width = " << width << ", height = " << height << llendl;
|
|
||||||
|
|
||||||
// when floater is minimized, these sizes are negative
|
|
||||||
if ( mWebBrowserImage && screen_height > 0 && screen_width > 0 )
|
|
||||||
{
|
{
|
||||||
mWebBrowserImage->resize( screen_width, screen_height );
|
S32 screen_width = mIgnoreUIScale ? llround((F32)width * LLUI::sGLScaleFactor.mV[VX]) : width;
|
||||||
mForceUpdate = true;
|
S32 screen_height = mIgnoreUIScale ? llround((F32)height * LLUI::sGLScaleFactor.mV[VY]) : height;
|
||||||
}
|
|
||||||
|
|
||||||
|
// when floater is minimized, these sizes are negative
|
||||||
|
if ( screen_height > 0 && screen_width > 0 )
|
||||||
|
{
|
||||||
|
setTextureSize(screen_width, screen_height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LLUICtrl::reshape( width, height, called_from_parent );
|
LLUICtrl::reshape( width, height, called_from_parent );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -460,9 +511,10 @@ void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mMediaSource)
|
if (ensureMediaSourceExists())
|
||||||
{
|
{
|
||||||
mCurrentNavUrl = url_in;
|
mCurrentNavUrl = url_in;
|
||||||
|
mMediaSource->setSize(mTextureWidth, mTextureHeight);
|
||||||
mMediaSource->navigateTo(url_in, mime_type, mime_type.empty());
|
mMediaSource->navigateTo(url_in, mime_type, mime_type.empty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -498,9 +550,10 @@ void LLMediaCtrl::navigateToLocalPage( const std::string& subdir, const std::str
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mMediaSource)
|
if (ensureMediaSourceExists())
|
||||||
{
|
{
|
||||||
mCurrentNavUrl = expanded_filename;
|
mCurrentNavUrl = expanded_filename;
|
||||||
|
mMediaSource->setSize(mTextureWidth, mTextureHeight);
|
||||||
mMediaSource->navigateTo(expanded_filename, "text/html", false);
|
mMediaSource->navigateTo(expanded_filename, "text/html", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -510,11 +563,11 @@ void LLMediaCtrl::navigateToLocalPage( const std::string& subdir, const std::str
|
|||||||
//
|
//
|
||||||
void LLMediaCtrl::navigateHome()
|
void LLMediaCtrl::navigateHome()
|
||||||
{
|
{
|
||||||
if( mHomePageUrl.length() )
|
if (ensureMediaSourceExists())
|
||||||
{
|
{
|
||||||
if (mMediaSource)
|
mMediaSource->setSize(mTextureWidth, mTextureHeight);
|
||||||
mMediaSource->navigateTo(mHomePageUrl);
|
mMediaSource->navigateHome();
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -522,6 +575,10 @@ void LLMediaCtrl::navigateHome()
|
|||||||
void LLMediaCtrl::setHomePageUrl( const std::string urlIn )
|
void LLMediaCtrl::setHomePageUrl( const std::string urlIn )
|
||||||
{
|
{
|
||||||
mHomePageUrl = urlIn;
|
mHomePageUrl = urlIn;
|
||||||
|
if (mMediaSource)
|
||||||
|
{
|
||||||
|
mMediaSource->setHomeURL(mHomePageUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -531,6 +588,22 @@ bool LLMediaCtrl::setCaretColor(unsigned int red, unsigned int green, unsigned i
|
|||||||
//NOOP
|
//NOOP
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
void LLMediaCtrl::setTextureSize(S32 width, S32 height)
|
||||||
|
{
|
||||||
|
mTextureWidth = width;
|
||||||
|
mTextureHeight = height;
|
||||||
|
|
||||||
|
if(mMediaSource)
|
||||||
|
{
|
||||||
|
mMediaSource->setSize(mTextureWidth, mTextureHeight);
|
||||||
|
mWebBrowserImage->resize( mTextureWidth, mTextureHeight );
|
||||||
|
mForceUpdate = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
std::string LLMediaCtrl::getHomePageUrl()
|
std::string LLMediaCtrl::getHomePageUrl()
|
||||||
@@ -538,6 +611,39 @@ std::string LLMediaCtrl::getHomePageUrl()
|
|||||||
return mHomePageUrl;
|
return mHomePageUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
bool LLMediaCtrl::ensureMediaSourceExists()
|
||||||
|
{
|
||||||
|
if(mMediaSource.isNull())
|
||||||
|
{
|
||||||
|
mMediaSource = LLViewerMedia::newMediaImpl(mHomePageUrl, LLUUID::null, mTextureWidth, mTextureWidth, false, false, "text/html");
|
||||||
|
if ( mMediaSource )
|
||||||
|
{
|
||||||
|
// create a new texture (based on LLDynamic texture) that will be used to display the output
|
||||||
|
mWebBrowserImage = new LLWebBrowserTexture( mTextureWidth, mTextureWidth, this, mMediaSource );
|
||||||
|
mMediaSource->setHomeURL(mHomePageUrl);
|
||||||
|
mMediaSource->setVisible( getVisible() );
|
||||||
|
mMediaSource->addObserver( this );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
llwarns << "media source create failed " << llendl;
|
||||||
|
// return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return !mMediaSource.isNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
void LLMediaCtrl::unloadMediaSource()
|
||||||
|
{
|
||||||
|
mMediaSource = NULL;
|
||||||
|
mWebBrowserImage = NULL; //release the dynamic texture too.
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
LLPluginClassMedia* LLMediaCtrl::getMediaPlugin()
|
LLPluginClassMedia* LLMediaCtrl::getMediaPlugin()
|
||||||
@@ -575,111 +681,132 @@ void LLMediaCtrl::draw()
|
|||||||
LLGLSUIDefault gls_ui;
|
LLGLSUIDefault gls_ui;
|
||||||
LLGLDisable gls_alphaTest( GL_ALPHA_TEST );
|
LLGLDisable gls_alphaTest( GL_ALPHA_TEST );
|
||||||
|
|
||||||
gGL.pushMatrix();
|
bool draw_media = false;
|
||||||
|
|
||||||
|
LLPluginClassMedia* media_plugin = NULL;
|
||||||
|
LLWebBrowserTexture* media_texture = mWebBrowserImage;
|
||||||
|
|
||||||
|
if(mMediaSource && mMediaSource->hasMedia())
|
||||||
{
|
{
|
||||||
if (mIgnoreUIScale)
|
media_plugin = mMediaSource->getMediaPlugin();
|
||||||
{
|
|
||||||
glLoadIdentity();
|
|
||||||
// font system stores true screen origin, need to scale this by UI scale factor
|
|
||||||
// to get render origin for this view (with unit scale)
|
|
||||||
gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]),
|
|
||||||
floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]),
|
|
||||||
LLFontGL::sCurOrigin.mZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
// scale texture to fit the space using texture coords
|
if(media_plugin && (media_plugin->textureValid()))
|
||||||
gGL.getTexUnit(0)->bind(mWebBrowserImage);
|
|
||||||
gGL.color4fv( LLColor4::white.mV );
|
|
||||||
F32 max_u = ( F32 )mWebBrowserImage->getMediaWidth() / ( F32 )mWebBrowserImage->getWidth();
|
|
||||||
F32 max_v = ( F32 )mWebBrowserImage->getMediaHeight() / ( F32 )mWebBrowserImage->getHeight();
|
|
||||||
|
|
||||||
LLRect r = getRect();
|
|
||||||
S32 width, height;
|
|
||||||
S32 x_offset = 0;
|
|
||||||
S32 y_offset = 0;
|
|
||||||
|
|
||||||
if(mStretchToFill)
|
|
||||||
{
|
{
|
||||||
if(mMaintainAspectRatio)
|
media_texture = mWebBrowserImage;
|
||||||
|
if(media_texture)
|
||||||
{
|
{
|
||||||
F32 media_aspect = (F32)(mWebBrowserImage->getMediaWidth()) / (F32)(mWebBrowserImage->getMediaHeight());
|
draw_media = true;
|
||||||
F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight());
|
}
|
||||||
if(media_aspect > view_aspect)
|
}
|
||||||
|
}
|
||||||
|
if(draw_media)
|
||||||
|
{
|
||||||
|
gGL.pushMatrix();
|
||||||
|
{
|
||||||
|
if (mIgnoreUIScale)
|
||||||
|
{
|
||||||
|
glLoadIdentity();
|
||||||
|
// font system stores true screen origin, need to scale this by UI scale factor
|
||||||
|
// to get render origin for this view (with unit scale)
|
||||||
|
gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]),
|
||||||
|
floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]),
|
||||||
|
LLFontGL::sCurOrigin.mZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
// scale texture to fit the space using texture coords
|
||||||
|
gGL.getTexUnit(0)->bind(media_texture);
|
||||||
|
LLColor4 media_color = LLColor4::white;
|
||||||
|
gGL.color4fv( media_color.mV );
|
||||||
|
F32 max_u = ( F32 )media_plugin->getWidth() / ( F32 )media_plugin->getTextureWidth();
|
||||||
|
F32 max_v = ( F32 )media_plugin->getHeight() / ( F32 )media_plugin->getTextureHeight();
|
||||||
|
|
||||||
|
LLRect r = getRect();
|
||||||
|
S32 width, height;
|
||||||
|
S32 x_offset = 0;
|
||||||
|
S32 y_offset = 0;
|
||||||
|
|
||||||
|
if(mStretchToFill)
|
||||||
|
{
|
||||||
|
if(mMaintainAspectRatio)
|
||||||
{
|
{
|
||||||
// max width, adjusted height
|
F32 media_aspect = (F32)(media_plugin->getWidth()) / (F32)(media_plugin->getHeight());
|
||||||
width = r.getWidth();
|
F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight());
|
||||||
height = llmin(llmax(S32(width / media_aspect), 0), r.getHeight());
|
if(media_aspect > view_aspect)
|
||||||
|
{
|
||||||
|
// max width, adjusted height
|
||||||
|
width = r.getWidth();
|
||||||
|
height = llmin(llmax(llround(width / media_aspect), 0), r.getHeight());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// max height, adjusted width
|
||||||
|
height = r.getHeight();
|
||||||
|
width = llmin(llmax(llround(height * media_aspect), 0), r.getWidth());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// max height, adjusted width
|
width = r.getWidth();
|
||||||
height = r.getHeight();
|
height = r.getHeight();
|
||||||
width = llmin(llmax(S32(height * media_aspect), 0), r.getWidth());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
width = r.getWidth();
|
width = llmin(media_plugin->getWidth(), r.getWidth());
|
||||||
height = r.getHeight();
|
height = llmin(media_plugin->getHeight(), r.getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x_offset = (r.getWidth() - width) / 2;
|
||||||
|
y_offset = (r.getHeight() - height) / 2;
|
||||||
|
|
||||||
|
if (mIgnoreUIScale)
|
||||||
|
{
|
||||||
|
x_offset = llround((F32)x_offset * LLUI::sGLScaleFactor.mV[VX]);
|
||||||
|
y_offset = llround((F32)y_offset * LLUI::sGLScaleFactor.mV[VY]);
|
||||||
|
width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]);
|
||||||
|
height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// draw the browser
|
||||||
|
gGL.setSceneBlendType(LLRender::BT_REPLACE);
|
||||||
|
gGL.begin( LLRender::QUADS );
|
||||||
|
if (! media_plugin->getTextureCoordsOpenGL())
|
||||||
|
{
|
||||||
|
// render using web browser reported width and height, instead of trying to invert GL scale
|
||||||
|
gGL.texCoord2f( max_u, 0.f );
|
||||||
|
gGL.vertex2i( x_offset + width, y_offset + height );
|
||||||
|
|
||||||
|
gGL.texCoord2f( 0.f, 0.f );
|
||||||
|
gGL.vertex2i( x_offset, y_offset + height );
|
||||||
|
|
||||||
|
gGL.texCoord2f( 0.f, max_v );
|
||||||
|
gGL.vertex2i( x_offset, y_offset );
|
||||||
|
|
||||||
|
gGL.texCoord2f( max_u, max_v );
|
||||||
|
gGL.vertex2i( x_offset + width, y_offset );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// render using web browser reported width and height, instead of trying to invert GL scale
|
||||||
|
gGL.texCoord2f( max_u, max_v );
|
||||||
|
gGL.vertex2i( x_offset + width, y_offset + height );
|
||||||
|
|
||||||
|
gGL.texCoord2f( 0.f, max_v );
|
||||||
|
gGL.vertex2i( x_offset, y_offset + height );
|
||||||
|
|
||||||
|
gGL.texCoord2f( 0.f, 0.f );
|
||||||
|
gGL.vertex2i( x_offset, y_offset );
|
||||||
|
|
||||||
|
gGL.texCoord2f( max_u, 0.f );
|
||||||
|
gGL.vertex2i( x_offset + width, y_offset );
|
||||||
|
}
|
||||||
|
gGL.end();
|
||||||
|
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||||
}
|
}
|
||||||
else
|
gGL.popMatrix();
|
||||||
{
|
|
||||||
width = llmin(mWebBrowserImage->getMediaWidth(), r.getWidth());
|
|
||||||
height = llmin(mWebBrowserImage->getMediaHeight(), r.getHeight());
|
|
||||||
}
|
|
||||||
|
|
||||||
x_offset = (r.getWidth() - width) / 2;
|
|
||||||
y_offset = (r.getHeight() - height) / 2;
|
|
||||||
|
|
||||||
if (mIgnoreUIScale)
|
|
||||||
{
|
|
||||||
width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]);
|
|
||||||
height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]);
|
|
||||||
x_offset = llround((F32)x_offset * LLUI::sGLScaleFactor.mV[VX]);
|
|
||||||
y_offset = llround((F32)y_offset * LLUI::sGLScaleFactor.mV[VY]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// draw the browser
|
|
||||||
gGL.setSceneBlendType(LLRender::BT_REPLACE);
|
|
||||||
gGL.begin( LLRender::QUADS );
|
|
||||||
if (! mWebBrowserImage->getTextureCoordsOpenGL())
|
|
||||||
{
|
|
||||||
// render using web browser reported width and height, instead of trying to invert GL scale
|
|
||||||
gGL.texCoord2f( max_u, 0.f );
|
|
||||||
gGL.vertex2i( x_offset + width, y_offset + height );
|
|
||||||
|
|
||||||
gGL.texCoord2f( 0.f, 0.f );
|
|
||||||
gGL.vertex2i( x_offset, y_offset + height );
|
|
||||||
|
|
||||||
gGL.texCoord2f( 0.f, max_v );
|
|
||||||
gGL.vertex2i( x_offset, y_offset );
|
|
||||||
|
|
||||||
gGL.texCoord2f( max_u, max_v );
|
|
||||||
gGL.vertex2i( x_offset + width, y_offset );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// render using web browser reported width and height, instead of trying to invert GL scale
|
|
||||||
gGL.texCoord2f( max_u, max_v );
|
|
||||||
gGL.vertex2i( x_offset + width, y_offset + height );
|
|
||||||
|
|
||||||
gGL.texCoord2f( 0.f, max_v );
|
|
||||||
gGL.vertex2i( x_offset, y_offset + height );
|
|
||||||
|
|
||||||
gGL.texCoord2f( 0.f, 0.f );
|
|
||||||
gGL.vertex2i( x_offset, y_offset );
|
|
||||||
|
|
||||||
gGL.texCoord2f( max_u, 0.f );
|
|
||||||
gGL.vertex2i( x_offset + width, y_offset );
|
|
||||||
}
|
|
||||||
gGL.end();
|
|
||||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
|
||||||
}
|
}
|
||||||
gGL.popMatrix();
|
|
||||||
|
|
||||||
// highlight if keyboard focus here. (TODO: this needs some work)
|
// highlight if keyboard focus here. (TODO: this needs some work)
|
||||||
if ( mBorder->getVisible() )
|
if ( mBorder && mBorder->getVisible() )
|
||||||
mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus( this ) );
|
mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus( this ) );
|
||||||
|
|
||||||
|
|
||||||
@@ -690,8 +817,15 @@ void LLMediaCtrl::draw()
|
|||||||
//
|
//
|
||||||
void LLMediaCtrl::convertInputCoords(S32& x, S32& y)
|
void LLMediaCtrl::convertInputCoords(S32& x, S32& y)
|
||||||
{
|
{
|
||||||
|
bool coords_opengl = false;
|
||||||
|
|
||||||
|
if(mMediaSource && mMediaSource->hasMedia())
|
||||||
|
{
|
||||||
|
coords_opengl = mMediaSource->getMediaPlugin()->getTextureCoordsOpenGL();
|
||||||
|
}
|
||||||
|
|
||||||
x = mIgnoreUIScale ? llround((F32)x * LLUI::sGLScaleFactor.mV[VX]) : x;
|
x = mIgnoreUIScale ? llround((F32)x * LLUI::sGLScaleFactor.mV[VX]) : x;
|
||||||
if ( ! mWebBrowserImage->getTextureCoordsOpenGL() )
|
if ( ! coords_opengl )
|
||||||
{
|
{
|
||||||
y = mIgnoreUIScale ? llround((F32)(y) * LLUI::sGLScaleFactor.mV[VY]) : y;
|
y = mIgnoreUIScale ? llround((F32)(y) * LLUI::sGLScaleFactor.mV[VY]) : y;
|
||||||
}
|
}
|
||||||
@@ -930,7 +1064,6 @@ LLWebBrowserTexture::LLWebBrowserTexture( S32 width, S32 height, LLMediaCtrl* br
|
|||||||
LLWebBrowserTexture::~LLWebBrowserTexture()
|
LLWebBrowserTexture::~LLWebBrowserTexture()
|
||||||
{
|
{
|
||||||
mElapsedTime.stop();
|
mElapsedTime.stop();
|
||||||
mMediaSource = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ class LLUICtrlFactory;
|
|||||||
class LLMediaCtrl :
|
class LLMediaCtrl :
|
||||||
public LLUICtrl,
|
public LLUICtrl,
|
||||||
public LLViewerMediaObserver,
|
public LLViewerMediaObserver,
|
||||||
public LLViewerMediaEventEmitter
|
public LLViewerMediaEventEmitter,
|
||||||
|
public LLInstanceTracker<LLMediaCtrl, LLUUID>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLMediaCtrl( const std::string& name, const LLRect& rect );
|
LLMediaCtrl( const std::string& name, const LLRect& rect );
|
||||||
@@ -69,6 +70,8 @@ class LLMediaCtrl :
|
|||||||
virtual BOOL handleHover( S32 x, S32 y, MASK mask );
|
virtual BOOL handleHover( S32 x, S32 y, MASK mask );
|
||||||
virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
|
virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
|
||||||
virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
|
virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
|
||||||
|
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
|
||||||
|
virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
|
||||||
virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
|
virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
|
||||||
virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks );
|
virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks );
|
||||||
|
|
||||||
@@ -112,10 +115,17 @@ class LLMediaCtrl :
|
|||||||
void setForceUpdate(bool force_update) { mForceUpdate = force_update; }
|
void setForceUpdate(bool force_update) { mForceUpdate = force_update; }
|
||||||
bool getForceUpdate() { return mForceUpdate; }
|
bool getForceUpdate() { return mForceUpdate; }
|
||||||
|
|
||||||
|
bool ensureMediaSourceExists();
|
||||||
|
void unloadMediaSource();
|
||||||
|
|
||||||
LLPluginClassMedia* getMediaPlugin();
|
LLPluginClassMedia* getMediaPlugin();
|
||||||
|
|
||||||
bool setCaretColor( unsigned int red, unsigned int green, unsigned int blue );
|
bool setCaretColor( unsigned int red, unsigned int green, unsigned int blue );
|
||||||
|
|
||||||
|
void setDecoupleTextureSize(bool decouple) { mDecoupleTextureSize = decouple; }
|
||||||
|
bool getDecoupleTextureSize() { return mDecoupleTextureSize; }
|
||||||
|
|
||||||
|
void setTextureSize(S32 width, S32 height);
|
||||||
|
|
||||||
// over-rides
|
// over-rides
|
||||||
virtual BOOL handleKeyHere( KEY key, MASK mask);
|
virtual BOOL handleKeyHere( KEY key, MASK mask);
|
||||||
@@ -143,6 +153,7 @@ class LLMediaCtrl :
|
|||||||
static bool onClickLinkExternalTarget( const LLSD&, const LLSD& );
|
static bool onClickLinkExternalTarget( const LLSD&, const LLSD& );
|
||||||
|
|
||||||
const S32 mTextureDepthBytes;
|
const S32 mTextureDepthBytes;
|
||||||
|
LLUUID mMediaTextureID;
|
||||||
LLPointer<LLWebBrowserTexture> mWebBrowserImage;
|
LLPointer<LLWebBrowserTexture> mWebBrowserImage;
|
||||||
LLViewBorder* mBorder;
|
LLViewBorder* mBorder;
|
||||||
bool mFrequentUpdates;
|
bool mFrequentUpdates;
|
||||||
@@ -161,6 +172,9 @@ class LLMediaCtrl :
|
|||||||
bool mStretchToFill;
|
bool mStretchToFill;
|
||||||
bool mMaintainAspectRatio;
|
bool mMaintainAspectRatio;
|
||||||
bool mHideLoading;
|
bool mHideLoading;
|
||||||
|
bool mDecoupleTextureSize;
|
||||||
|
S32 mTextureWidth;
|
||||||
|
S32 mTextureHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -122,7 +122,8 @@ public:
|
|||||||
bool canNavigateForward();
|
bool canNavigateForward();
|
||||||
bool canNavigateBack();
|
bool canNavigateBack();
|
||||||
std::string getMediaURL() { return mMediaURL; }
|
std::string getMediaURL() { return mMediaURL; }
|
||||||
std::string getMediaHomeURL() { return mHomeURL; }
|
std::string getHomeURL() { return mHomeURL; }
|
||||||
|
void setHomeURL(const std::string& home_url) { mHomeURL = home_url; }
|
||||||
std::string getMimeType() { return mMimeType; }
|
std::string getMimeType() { return mMimeType; }
|
||||||
void getTextureSize(S32 *texture_width, S32 *texture_height);
|
void getTextureSize(S32 *texture_width, S32 *texture_height);
|
||||||
void scaleMouse(S32 *mouse_x, S32 *mouse_y);
|
void scaleMouse(S32 *mouse_x, S32 *mouse_y);
|
||||||
|
|||||||
@@ -66,7 +66,9 @@
|
|||||||
//#include "lltextureatlas.h"
|
//#include "lltextureatlas.h"
|
||||||
//#include "lltextureatlasmanager.h"
|
//#include "lltextureatlasmanager.h"
|
||||||
#include "lltextureentry.h"
|
#include "lltextureentry.h"
|
||||||
//#include "llmediaentry.h"
|
#if NEW_MEDIA_TEXTURE
|
||||||
|
#include "llmediaentry.h"
|
||||||
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
#include "llvovolume.h"
|
#include "llvovolume.h"
|
||||||
#include "llviewermedia.h"
|
#include "llviewermedia.h"
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -79,9 +81,11 @@ LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sDefaultImagep = NULL;
|
|||||||
LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sSmokeImagep = NULL;
|
LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sSmokeImagep = NULL;
|
||||||
#if NEW_MEDIA_TEXTURE
|
#if NEW_MEDIA_TEXTURE
|
||||||
LLViewerMediaTexture::media_map_t LLViewerMediaTexture::sMediaMap ;
|
LLViewerMediaTexture::media_map_t LLViewerMediaTexture::sMediaMap ;
|
||||||
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
|
#if 0
|
||||||
|
LLTexturePipelineTester* LLViewerTextureManager::sTesterp = NULL ;
|
||||||
#endif
|
#endif
|
||||||
//LLTexturePipelineTester* LLViewerTextureManager::sTesterp = NULL ;
|
const std::string sTesterName("TextureTester");
|
||||||
//const std::string sTesterName("TextureTester");
|
|
||||||
|
|
||||||
S32 LLViewerTexture::sImageCount = 0;
|
S32 LLViewerTexture::sImageCount = 0;
|
||||||
S32 LLViewerTexture::sRawCount = 0;
|
S32 LLViewerTexture::sRawCount = 0;
|
||||||
@@ -171,7 +175,7 @@ LLViewerMediaTexture* LLViewerTextureManager::createMediaTexture(const LLUUID &m
|
|||||||
{
|
{
|
||||||
return new LLViewerMediaTexture(media_id, usemipmaps, gl_image) ;
|
return new LLViewerMediaTexture(media_id, usemipmaps, gl_image) ;
|
||||||
}
|
}
|
||||||
#endif
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
|
|
||||||
LLViewerTexture* LLViewerTextureManager::findTexture(const LLUUID& id)
|
LLViewerTexture* LLViewerTextureManager::findTexture(const LLUUID& id)
|
||||||
{
|
{
|
||||||
@@ -185,7 +189,7 @@ LLViewerTexture* LLViewerTextureManager::findTexture(const LLUUID& id)
|
|||||||
{
|
{
|
||||||
tex = LLViewerTextureManager::findMediaTexture(id) ;
|
tex = LLViewerTextureManager::findMediaTexture(id) ;
|
||||||
}
|
}
|
||||||
#endif
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
return tex ;
|
return tex ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +211,7 @@ LLViewerMediaTexture* LLViewerTextureManager::getMediaTexture(const LLUUID& id,
|
|||||||
|
|
||||||
return tex ;
|
return tex ;
|
||||||
}
|
}
|
||||||
#endif
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
|
|
||||||
LLViewerFetchedTexture* LLViewerTextureManager::staticCastToFetchedTexture(LLTexture* tex, BOOL report_error)
|
LLViewerFetchedTexture* LLViewerTextureManager::staticCastToFetchedTexture(LLTexture* tex, BOOL report_error)
|
||||||
{
|
{
|
||||||
@@ -358,7 +362,8 @@ void LLViewerTextureManager::init()
|
|||||||
|
|
||||||
LLViewerTexture::initClass() ;
|
LLViewerTexture::initClass() ;
|
||||||
|
|
||||||
/*if (LLMetricPerformanceTesterBasic::isMetricLogRequested(sTesterName) && !LLMetricPerformanceTesterBasic::getTester(sTesterName))
|
#if 0
|
||||||
|
if (LLMetricPerformanceTesterBasic::isMetricLogRequested(sTesterName) && !LLMetricPerformanceTesterBasic::getTester(sTesterName))
|
||||||
{
|
{
|
||||||
sTesterp = new LLTexturePipelineTester() ;
|
sTesterp = new LLTexturePipelineTester() ;
|
||||||
if (!sTesterp->isValid())
|
if (!sTesterp->isValid())
|
||||||
@@ -366,7 +371,8 @@ void LLViewerTextureManager::init()
|
|||||||
delete sTesterp;
|
delete sTesterp;
|
||||||
sTesterp = NULL;
|
sTesterp = NULL;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLViewerTextureManager::cleanup()
|
void LLViewerTextureManager::cleanup()
|
||||||
@@ -382,7 +388,7 @@ void LLViewerTextureManager::cleanup()
|
|||||||
|
|
||||||
#if NEW_MEDIA_TEXTURE
|
#if NEW_MEDIA_TEXTURE
|
||||||
LLViewerMediaTexture::cleanUpClass() ;
|
LLViewerMediaTexture::cleanUpClass() ;
|
||||||
#endif
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------
|
||||||
@@ -432,14 +438,16 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity
|
|||||||
{
|
{
|
||||||
sCurrentTime = gFrameTimeSeconds ;
|
sCurrentTime = gFrameTimeSeconds ;
|
||||||
|
|
||||||
/*LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
#if 0
|
||||||
|
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
||||||
if (tester)
|
if (tester)
|
||||||
{
|
{
|
||||||
tester->update() ;
|
tester->update() ;
|
||||||
}*/
|
}
|
||||||
|
#endif
|
||||||
#if NEW_MEDIA_TEXTURE
|
#if NEW_MEDIA_TEXTURE
|
||||||
LLViewerMediaTexture::updateClass() ;
|
LLViewerMediaTexture::updateClass() ;
|
||||||
#endif
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
|
|
||||||
sBoundTextureMemoryInBytes = LLImageGL::sBoundTextureMemoryInBytes;//in bytes
|
sBoundTextureMemoryInBytes = LLImageGL::sBoundTextureMemoryInBytes;//in bytes
|
||||||
sTotalTextureMemoryInBytes = LLImageGL::sGlobalTextureMemoryInBytes;//in bytes
|
sTotalTextureMemoryInBytes = LLImageGL::sGlobalTextureMemoryInBytes;//in bytes
|
||||||
@@ -560,7 +568,9 @@ void LLViewerTexture::init(bool firstinit)
|
|||||||
mFaceList.clear() ;
|
mFaceList.clear() ;
|
||||||
mVolumeList.clear();
|
mVolumeList.clear();
|
||||||
|
|
||||||
|
#if !NEW_MEDIA_TEXTURE
|
||||||
mIsMediaTexture = false;
|
mIsMediaTexture = false;
|
||||||
|
#endif //!NEW_MEDIA_TEXTURE
|
||||||
}
|
}
|
||||||
|
|
||||||
//virtual
|
//virtual
|
||||||
@@ -632,11 +642,13 @@ bool LLViewerTexture::bindDefaultImage(S32 stage)
|
|||||||
//check if there is cached raw image and switch to it if possible
|
//check if there is cached raw image and switch to it if possible
|
||||||
switchToCachedImage() ;
|
switchToCachedImage() ;
|
||||||
|
|
||||||
/*LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
#if 0
|
||||||
|
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
||||||
if (tester)
|
if (tester)
|
||||||
{
|
{
|
||||||
tester->updateGrayTextureBinding() ;
|
tester->updateGrayTextureBinding() ;
|
||||||
}*/
|
}
|
||||||
|
#endif
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1096,11 +1108,13 @@ BOOL LLViewerTexture::isLargeImage()
|
|||||||
//virtual
|
//virtual
|
||||||
void LLViewerTexture::updateBindStatsForTester()
|
void LLViewerTexture::updateBindStatsForTester()
|
||||||
{
|
{
|
||||||
/*LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
#if 0
|
||||||
|
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
||||||
if (tester)
|
if (tester)
|
||||||
{
|
{
|
||||||
tester->updateTextureBindingStats(this) ;
|
tester->updateTextureBindingStats(this) ;
|
||||||
}*/
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------
|
||||||
@@ -1888,12 +1902,14 @@ bool LLViewerFetchedTexture::updateFetch()
|
|||||||
// We may have data ready regardless of whether or not we are finished (e.g. waiting on write)
|
// We may have data ready regardless of whether or not we are finished (e.g. waiting on write)
|
||||||
if (mRawImage.notNull())
|
if (mRawImage.notNull())
|
||||||
{
|
{
|
||||||
/*LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
#if 0
|
||||||
|
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
||||||
if (tester)
|
if (tester)
|
||||||
{
|
{
|
||||||
mIsFetched = TRUE ;
|
mIsFetched = TRUE ;
|
||||||
tester->updateTextureLoadingStats(this, mRawImage, LLAppViewer::getTextureFetch()->isFromLocalCache(mID)) ;
|
tester->updateTextureLoadingStats(this, mRawImage, LLAppViewer::getTextureFetch()->isFromLocalCache(mID)) ;
|
||||||
}*/
|
}
|
||||||
|
#endif
|
||||||
mRawDiscardLevel = fetch_discard;
|
mRawDiscardLevel = fetch_discard;
|
||||||
if ((mRawImage->getDataSize() > 0 && mRawDiscardLevel >= 0) &&
|
if ((mRawImage->getDataSize() > 0 && mRawDiscardLevel >= 0) &&
|
||||||
(current_discard < 0 || mRawDiscardLevel < current_discard))
|
(current_discard < 0 || mRawDiscardLevel < current_discard))
|
||||||
@@ -3134,11 +3150,13 @@ void LLViewerLODTexture::scaleDown()
|
|||||||
{
|
{
|
||||||
switchToCachedImage() ;
|
switchToCachedImage() ;
|
||||||
|
|
||||||
/*LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
#if 0
|
||||||
|
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
|
||||||
if (tester)
|
if (tester)
|
||||||
{
|
{
|
||||||
tester->setStablizingTime() ;
|
tester->setStablizingTime() ;
|
||||||
}*/
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------
|
||||||
@@ -3154,7 +3172,7 @@ void LLViewerMediaTexture::updateClass()
|
|||||||
{
|
{
|
||||||
static const F32 MAX_INACTIVE_TIME = 30.f ;
|
static const F32 MAX_INACTIVE_TIME = 30.f ;
|
||||||
|
|
||||||
#if NEW_MEDIA_TEXTURE
|
#if 0
|
||||||
//force to play media.
|
//force to play media.
|
||||||
gSavedSettings.setBOOL("AudioStreamingMedia", true) ;
|
gSavedSettings.setBOOL("AudioStreamingMedia", true) ;
|
||||||
#endif
|
#endif
|
||||||
@@ -3247,7 +3265,7 @@ LLViewerMediaTexture::~LLViewerMediaTexture()
|
|||||||
tex->setParcelMedia(NULL) ;
|
tex->setParcelMedia(NULL) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
void LLViewerMediaTexture::reinit(BOOL usemipmaps /* = TRUE */)
|
void LLViewerMediaTexture::reinit(BOOL usemipmaps /* = TRUE */)
|
||||||
{
|
{
|
||||||
llassert(mGLTexturep.notNull()) ;
|
llassert(mGLTexturep.notNull()) ;
|
||||||
@@ -3641,7 +3659,7 @@ F32 LLViewerMediaTexture::getMaxVirtualSize()
|
|||||||
|
|
||||||
return mMaxVirtualSize ;
|
return mMaxVirtualSize ;
|
||||||
}
|
}
|
||||||
#endif
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
//----------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------
|
||||||
//end of LLViewerMediaTexture
|
//end of LLViewerMediaTexture
|
||||||
//----------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------
|
||||||
@@ -3743,22 +3761,23 @@ void LLTexturePipelineTester::reset()
|
|||||||
//virtual
|
//virtual
|
||||||
void LLTexturePipelineTester::outputTestRecord(LLSD *sd)
|
void LLTexturePipelineTester::outputTestRecord(LLSD *sd)
|
||||||
{
|
{
|
||||||
(*sd)[mCurLabel]["TotalBytesLoaded"] = (LLSD::Integer)mTotalBytesLoaded ;
|
std::string currentLabel = getCurrentLabelName();
|
||||||
(*sd)[mCurLabel]["TotalBytesLoadedFromCache"] = (LLSD::Integer)mTotalBytesLoadedFromCache ;
|
(*sd)[currentLabel]["TotalBytesLoaded"] = (LLSD::Integer)mTotalBytesLoaded ;
|
||||||
(*sd)[mCurLabel]["TotalBytesLoadedForLargeImage"] = (LLSD::Integer)mTotalBytesLoadedForLargeImage ;
|
(*sd)[currentLabel]["TotalBytesLoadedFromCache"] = (LLSD::Integer)mTotalBytesLoadedFromCache ;
|
||||||
(*sd)[mCurLabel]["TotalBytesLoadedForSculpties"] = (LLSD::Integer)mTotalBytesLoadedForSculpties ;
|
(*sd)[currentLabel]["TotalBytesLoadedForLargeImage"] = (LLSD::Integer)mTotalBytesLoadedForLargeImage ;
|
||||||
|
(*sd)[currentLabel]["TotalBytesLoadedForSculpties"] = (LLSD::Integer)mTotalBytesLoadedForSculpties ;
|
||||||
|
|
||||||
(*sd)[mCurLabel]["StartFetchingTime"] = (LLSD::Real)mStartFetchingTime ;
|
(*sd)[currentLabel]["StartFetchingTime"] = (LLSD::Real)mStartFetchingTime ;
|
||||||
(*sd)[mCurLabel]["TotalGrayTime"] = (LLSD::Real)mTotalGrayTime ;
|
(*sd)[currentLabel]["TotalGrayTime"] = (LLSD::Real)mTotalGrayTime ;
|
||||||
(*sd)[mCurLabel]["TotalStablizingTime"] = (LLSD::Real)mTotalStablizingTime ;
|
(*sd)[currentLabel]["TotalStablizingTime"] = (LLSD::Real)mTotalStablizingTime ;
|
||||||
|
|
||||||
(*sd)[mCurLabel]["StartTimeLoadingSculpties"] = (LLSD::Real)mStartTimeLoadingSculpties ;
|
(*sd)[currentLabel]["StartTimeLoadingSculpties"] = (LLSD::Real)mStartTimeLoadingSculpties ;
|
||||||
(*sd)[mCurLabel]["EndTimeLoadingSculpties"] = (LLSD::Real)mEndTimeLoadingSculpties ;
|
(*sd)[currentLabel]["EndTimeLoadingSculpties"] = (LLSD::Real)mEndTimeLoadingSculpties ;
|
||||||
|
|
||||||
(*sd)[mCurLabel]["Time"] = LLImageGL::sLastFrameTime ;
|
(*sd)[currentLabel]["Time"] = LLImageGL::sLastFrameTime ;
|
||||||
(*sd)[mCurLabel]["TotalBytesBound"] = (LLSD::Integer)mLastTotalBytesUsed ;
|
(*sd)[currentLabel]["TotalBytesBound"] = (LLSD::Integer)mLastTotalBytesUsed ;
|
||||||
(*sd)[mCurLabel]["TotalBytesBoundForLargeImage"] = (LLSD::Integer)mLastTotalBytesUsedForLargeImage ;
|
(*sd)[currentLabel]["TotalBytesBoundForLargeImage"] = (LLSD::Integer)mLastTotalBytesUsedForLargeImage ;
|
||||||
(*sd)[mCurLabel]["PercentageBytesBound"] = (LLSD::Real)(100.f * mLastTotalBytesUsed / mTotalBytesLoaded) ;
|
(*sd)[currentLabel]["PercentageBytesBound"] = (LLSD::Real)(100.f * mLastTotalBytesUsed / mTotalBytesLoaded) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLTexturePipelineTester::updateTextureBindingStats(const LLViewerTexture* imagep)
|
void LLTexturePipelineTester::updateTextureBindingStats(const LLViewerTexture* imagep)
|
||||||
@@ -3847,7 +3866,7 @@ void LLTexturePipelineTester::compareTestSessions(std::ofstream* os)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//compare and output the comparison
|
//compare and output the comparison
|
||||||
*os << llformat("%s\n", mName.c_str()) ;
|
*os << llformat("%s\n", getTesterName().c_str()) ;
|
||||||
*os << llformat("AggregateResults\n") ;
|
*os << llformat("AggregateResults\n") ;
|
||||||
|
|
||||||
compareTestResults(os, "TotalFetchingTime", base_sessionp->mTotalFetchingTime, current_sessionp->mTotalFetchingTime) ;
|
compareTestResults(os, "TotalFetchingTime", base_sessionp->mTotalFetchingTime, current_sessionp->mTotalFetchingTime) ;
|
||||||
@@ -3902,7 +3921,7 @@ void LLTexturePipelineTester::compareTestSessions(std::ofstream* os)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//virtual
|
//virtual
|
||||||
LLMetricPerformanceTester::LLTestSession* LLTexturePipelineTester::loadTestSession(LLSD* log)
|
LLMetricPerformanceTesterWithSession::LLTestSession* LLTexturePipelineTester::loadTestSession(LLSD* log)
|
||||||
{
|
{
|
||||||
LLTexturePipelineTester::LLTextureTestSession* sessionp = new LLTexturePipelineTester::LLTextureTestSession() ;
|
LLTexturePipelineTester::LLTextureTestSession* sessionp = new LLTexturePipelineTester::LLTextureTestSession() ;
|
||||||
if(!sessionp)
|
if(!sessionp)
|
||||||
@@ -3929,12 +3948,11 @@ LLMetricPerformanceTester::LLTestSession* LLTexturePipelineTester::loadTestSessi
|
|||||||
sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f ;
|
sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f ;
|
||||||
|
|
||||||
//load a session
|
//load a session
|
||||||
BOOL in_log = (*log).has(mCurLabel) ;
|
std::string currentLabel = getCurrentLabelName();
|
||||||
while(in_log)
|
BOOL in_log = (*log).has(currentLabel) ;
|
||||||
|
while (in_log)
|
||||||
{
|
{
|
||||||
LLSD::String label = mCurLabel ;
|
LLSD::String label = currentLabel ;
|
||||||
incLabel() ;
|
|
||||||
in_log = (*log).has(mCurLabel) ;
|
|
||||||
|
|
||||||
if(sessionp->mInstantPerformanceListCounter >= (S32)sessionp->mInstantPerformanceList.size())
|
if(sessionp->mInstantPerformanceListCounter >= (S32)sessionp->mInstantPerformanceList.size())
|
||||||
{
|
{
|
||||||
@@ -4000,7 +4018,11 @@ LLMetricPerformanceTester::LLTestSession* LLTexturePipelineTester::loadTestSessi
|
|||||||
sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond = 0 ;
|
sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond = 0 ;
|
||||||
sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond = 0.f ;
|
sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond = 0.f ;
|
||||||
sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f ;
|
sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f ;
|
||||||
}
|
}
|
||||||
|
// Next label
|
||||||
|
incrementCurrentCount() ;
|
||||||
|
currentLabel = getCurrentLabelName();
|
||||||
|
in_log = (*log).has(currentLabel) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
sessionp->mTotalFetchingTime += total_fetching_time ;
|
sessionp->mTotalFetchingTime += total_fetching_time ;
|
||||||
@@ -4040,7 +4062,7 @@ void LLTexturePipelineTester::LLTextureTestSession::reset()
|
|||||||
|
|
||||||
mInstantPerformanceListCounter = 0 ;
|
mInstantPerformanceListCounter = 0 ;
|
||||||
}
|
}
|
||||||
#endif //0
|
#endif 0
|
||||||
//----------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------
|
||||||
//end of LLTexturePipelineTester
|
//end of LLTexturePipelineTester
|
||||||
//----------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -40,7 +40,9 @@
|
|||||||
#include "llhost.h"
|
#include "llhost.h"
|
||||||
#include "llgltypes.h"
|
#include "llgltypes.h"
|
||||||
#include "llrender.h"
|
#include "llrender.h"
|
||||||
//#include "llmetricperformancetester.h"
|
#if 0
|
||||||
|
#include "llmetricperformancetester.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -620,14 +622,16 @@ class LLViewerMediaTexture : public LLViewerTexture
|
|||||||
{
|
{
|
||||||
#if NEW_MEDIA_TEXTURE
|
#if NEW_MEDIA_TEXTURE
|
||||||
protected:
|
protected:
|
||||||
*virtual*/ ~LLViewerMediaTexture() ;
|
/*virtual*/ ~LLViewerMediaTexture() ;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = NULL) ;
|
LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = NULL) ;
|
||||||
|
|
||||||
/*virtual*/* S8 getType() const;
|
/*virtual*/ S8 getType() const;
|
||||||
#endif
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
|
#if !NEW_MEDIA_TEXTURE
|
||||||
public:
|
public:
|
||||||
|
#endif //!NEW_MEDIA_TEXTURE
|
||||||
void reinit(BOOL usemipmaps = TRUE);
|
void reinit(BOOL usemipmaps = TRUE);
|
||||||
|
|
||||||
BOOL getUseMipMaps() {return mUseMipMaps ; }
|
BOOL getUseMipMaps() {return mUseMipMaps ; }
|
||||||
@@ -642,7 +646,7 @@ public:
|
|||||||
void invalidateMediaImpl() ;
|
void invalidateMediaImpl() ;
|
||||||
|
|
||||||
void addMediaToFace(LLFace* facep) ;
|
void addMediaToFace(LLFace* facep) ;
|
||||||
void removeMediaFromFace(LLFace* facep) ;*/
|
void removeMediaFromFace(LLFace* facep) ;
|
||||||
|
|
||||||
/*virtual*/ void addFace(LLFace* facep) ;
|
/*virtual*/ void addFace(LLFace* facep) ;
|
||||||
/*virtual*/ void removeFace(LLFace* facep) ;
|
/*virtual*/ void removeFace(LLFace* facep) ;
|
||||||
@@ -678,7 +682,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
typedef std::map< LLUUID, LLPointer<LLViewerMediaTexture> > media_map_t ;
|
typedef std::map< LLUUID, LLPointer<LLViewerMediaTexture> > media_map_t ;
|
||||||
static media_map_t sMediaMap ;
|
static media_map_t sMediaMap ;
|
||||||
#endif
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
};
|
};
|
||||||
|
|
||||||
//just an interface class, do not create instance from this class.
|
//just an interface class, do not create instance from this class.
|
||||||
@@ -690,7 +694,9 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//texture pipeline tester
|
//texture pipeline tester
|
||||||
//static LLTexturePipelineTester* sTesterp ;
|
#if 0
|
||||||
|
static LLTexturePipelineTester* sTesterp ;
|
||||||
|
#endif
|
||||||
|
|
||||||
//returns NULL if tex is not a LLViewerFetchedTexture nor derived from LLViewerFetchedTexture.
|
//returns NULL if tex is not a LLViewerFetchedTexture nor derived from LLViewerFetchedTexture.
|
||||||
static LLViewerFetchedTexture* staticCastToFetchedTexture(LLTexture* tex, BOOL report_error = FALSE) ;
|
static LLViewerFetchedTexture* staticCastToFetchedTexture(LLTexture* tex, BOOL report_error = FALSE) ;
|
||||||
@@ -708,7 +714,7 @@ public:
|
|||||||
//"get-texture" will create a new texture if the texture does not exist.
|
//"get-texture" will create a new texture if the texture does not exist.
|
||||||
//
|
//
|
||||||
static LLViewerMediaTexture* getMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = NULL) ;
|
static LLViewerMediaTexture* getMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = NULL) ;
|
||||||
#endif
|
#endif //NEW_MEDIA_TEXTURE
|
||||||
|
|
||||||
static LLPointer<LLViewerTexture> getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE);
|
static LLPointer<LLViewerTexture> getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE);
|
||||||
static LLPointer<LLViewerTexture> getLocalTexture(const LLUUID& id, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) ;
|
static LLPointer<LLViewerTexture> getLocalTexture(const LLUUID& id, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) ;
|
||||||
@@ -839,8 +845,8 @@ private:
|
|||||||
S32 mInstantPerformanceListCounter ;
|
S32 mInstantPerformanceListCounter ;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*virtual*/ LLMetricPerformanceTester::LLTestSession* loadTestSession(LLSD* log) ;
|
/*virtual*/ LLMetricPerformanceTesterWithSession::LLTestSession* loadTestSession(LLSD* log) ;
|
||||||
/*virtual*/ void compareTestSessions(std::ofstream* os) ;
|
/*virtual*/ void compareTestSessions(std::ofstream* os) ;
|
||||||
};
|
};
|
||||||
#endif //0
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user