summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewertexture.h')
-rw-r--r--indra/newview/llviewertexture.h104
1 files changed, 45 insertions, 59 deletions
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index b8bdeedd03..1bd4cc793d 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -2,25 +2,31 @@
* @file llviewertexture.h
* @brief Object for managing images and their textures
*
- * $LicenseInfo:firstyear=2000&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2000&license=viewergpl$
+ *
+ * Copyright (c) 2000-2009, Linden Research, Inc.
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
*
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
@@ -61,29 +67,16 @@ class LLVOVolume ;
class LLLoadedCallbackEntry
{
public:
- typedef std::set< LLUUID > source_callback_list_t;
-
-public:
LLLoadedCallbackEntry(loaded_callback_func cb,
S32 discard_level,
BOOL need_imageraw, // Needs image raw for the callback
- void* userdata,
- source_callback_list_t* src_callback_list,
- LLViewerFetchedTexture* target,
- BOOL pause);
- ~LLLoadedCallbackEntry();
- void removeTexture(LLViewerFetchedTexture* tex) ;
+ void* userdata );
loaded_callback_func mCallback;
S32 mLastUsedDiscard;
S32 mDesiredDiscard;
BOOL mNeedsImageRaw;
- BOOL mPaused;
void* mUserData;
- source_callback_list_t* mSourceCallbackList;
-
-public:
- static void cleanUpCallbackList(LLLoadedCallbackEntry::source_callback_list_t* callback_list) ;
};
class LLTextureBar;
@@ -110,24 +103,22 @@ public:
enum EBoostLevel
{
BOOST_NONE = 0,
- BOOST_AVATAR_BAKED ,
- BOOST_AVATAR ,
- BOOST_CLOUDS ,
- BOOST_SCULPTED ,
+ BOOST_AVATAR_BAKED = 1,
+ BOOST_AVATAR = 2,
+ BOOST_CLOUDS = 3,
+ BOOST_SCULPTED = 4,
BOOST_HIGH = 10,
- BOOST_BUMP ,
- BOOST_TERRAIN , // has to be high priority for minimap / low detail
- BOOST_SELECTED ,
- BOOST_AVATAR_BAKED_SELF ,
- BOOST_AVATAR_SELF , // needed for baking avatar
- BOOST_SUPER_HIGH , //textures higher than this need to be downloaded at the required resolution without delay.
- BOOST_HUD ,
- BOOST_ICON ,
- BOOST_UI ,
- BOOST_PREVIEW ,
- BOOST_MAP ,
- BOOST_MAP_VISIBLE ,
+ BOOST_TERRAIN = 11, // has to be high priority for minimap / low detail
+ BOOST_SELECTED = 12,
+ BOOST_HUD = 13,
+ BOOST_AVATAR_BAKED_SELF = 14,
+ BOOST_ICON = 15,
+ BOOST_UI = 16,
+ BOOST_PREVIEW = 17,
+ BOOST_MAP = 18,
+ BOOST_MAP_VISIBLE = 19,
+ BOOST_AVATAR_SELF = 20, // needed for baking avatar
BOOST_MAX_LEVEL,
//other texture Categories
@@ -153,6 +144,7 @@ protected:
public:
static void initClass();
+ static void cleanupClass();
static void updateClass(const F32 velocity, const F32 angular_velocity) ;
LLViewerTexture(BOOL usemipmaps = TRUE);
@@ -174,8 +166,6 @@ public:
void addTextureStats(F32 virtual_size, BOOL needs_gltexture = TRUE) const;
void resetTextureStats();
- void setMaxVirtualSizeResetInterval(S32 interval)const {mMaxVirtualSizeResetInterval = interval;}
- void resetMaxVirtualSizeResetCounter()const {mMaxVirtualSizeResetCounter = mMaxVirtualSizeResetInterval;}
virtual F32 getMaxVirtualSize() ;
@@ -261,7 +251,6 @@ protected:
void init(bool firstinit) ;
void reorganizeFaceList() ;
void reorganizeVolumeList() ;
- void setTexelsPerImage();
private:
//note: do not make this function public.
/*virtual*/ LLImageGL* getGLTexture() const ;
@@ -274,11 +263,10 @@ protected:
S32 mFullHeight;
BOOL mUseMipMaps ;
S8 mComponents;
- F32 mTexelsPerImage; // Texels per image.
+ bool mCanResetMaxVirtualSize;
+ mutable F32 mMaxVirtualSize; // The largest virtual size of the image, in pixels - how much data to we need?
mutable S8 mNeedsGLTexture;
- mutable F32 mMaxVirtualSize; // The largest virtual size of the image, in pixels - how much data to we need?
- mutable S32 mMaxVirtualSizeResetCounter ;
- mutable S32 mMaxVirtualSizeResetInterval;
+ mutable BOOL mNeedsResetMaxVirtualSize ;
mutable F32 mAdditionalDecodePriority; // priority add to mDecodePriority.
LLFrameTimer mLastReferencedTimer;
@@ -380,12 +368,9 @@ public:
// resolution versions.
void setLoadedCallback(loaded_callback_func cb,
S32 discard_level, BOOL keep_imageraw, BOOL needs_aux,
- void* userdata, LLLoadedCallbackEntry::source_callback_list_t* src_callback_list, BOOL pause = FALSE);
+ void* userdata);
bool hasCallbacks() { return mLoadedCallbackList.empty() ? false : true; }
- void pauseLoadedCallbacks(const LLLoadedCallbackEntry::source_callback_list_t* callback_list);
- void unpauseLoadedCallbacks(const LLLoadedCallbackEntry::source_callback_list_t* callback_list);
bool doLoadedCallbacks();
- void deleteCallbackEntry(const LLLoadedCallbackEntry::source_callback_list_t* callback_list);
void addToCreateTexture();
@@ -463,7 +448,7 @@ public:
S32 getCachedRawImageLevel() const {return mCachedRawDiscardLevel;}
BOOL isCachedRawImageReady() const {return mCachedRawImageReady ;}
BOOL isRawImageValid()const { return mIsRawImageValid ; }
- void forceToSaveRawImage(S32 desired_discard = 0, bool from_callback = false) ;
+ void forceToSaveRawImage(S32 desired_discard = 0) ;
/*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ;
void destroySavedRawImage() ;
LLImageRaw* getSavedRawImage() ;
@@ -529,7 +514,6 @@ protected:
typedef std::list<LLLoadedCallbackEntry*> callback_list_t;
S8 mLoadedCallbackDesiredDiscardLevel;
- BOOL mPauseLoadedCallBacks;
callback_list_t mLoadedCallbackList;
LLPointer<LLImageRaw> mRawImage;
@@ -593,6 +577,8 @@ private:
void scaleDown() ;
private:
+
+ F32 mTexelsPerImage; // Texels per image.
F32 mDiscardVirtualSize; // Virtual size used to calculate desired discard
F32 mCalculatedDiscardLevel; // Last calculated discard level
};
@@ -651,7 +637,7 @@ private:
public:
static void updateClass() ;
- static void cleanUpClass() ;
+ static void cleanup() ;
static LLViewerMediaTexture* findMediaTexture(const LLUUID& media_id) ;
static void removeMediaImplFromTexture(const LLUUID& media_id) ;