diff options
Diffstat (limited to 'indra/newview/llviewertexture.h')
-rw-r--r-- | indra/newview/llviewertexture.h | 138 |
1 files changed, 9 insertions, 129 deletions
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 2e7949e9a3..ba6beec883 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -27,7 +27,7 @@ #ifndef LL_LLVIEWERTEXTURE_H #define LL_LLVIEWERTEXTURE_H -#include "lltexture.h" +#include "llgltexture.h" #include "lltimer.h" #include "llframetimer.h" #include "llhost.h" @@ -88,16 +88,11 @@ public: class LLTextureBar; -class LLViewerTexture : public LLTexture +class LLViewerTexture : public LLGLTexture { public: enum { - MAX_IMAGE_SIZE_DEFAULT = 1024, - INVALID_DISCARD_LEVEL = 0x7fff - }; - enum - { LOCAL_TEXTURE, MEDIA_TEXTURE, DYNAMIC_TEXTURE, @@ -107,43 +102,6 @@ public: INVALID_TEXTURE_TYPE }; - enum EBoostLevel - { - BOOST_NONE = 0, - BOOST_AVATAR_BAKED , - BOOST_AVATAR , - BOOST_CLOUDS , - BOOST_SCULPTED , - - 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_MAX_LEVEL, - - //other texture Categories - LOCAL = BOOST_MAX_LEVEL, - AVATAR_SCRATCH_TEX, - DYNAMIC_TEX, - MEDIA, - ATLAS, - OTHER, - MAX_GL_IMAGE_CATEGORY - }; - - static S32 getTotalNumOfCategories() ; - static S32 getIndexFromCategory(S32 category) ; - static S32 getCategoryFromIndex(S32 index) ; - typedef std::vector<LLFace*> ll_face_list_t; typedef std::vector<LLVOVolume*> ll_volume_list_t; @@ -168,8 +126,7 @@ public: /*virtual*/ bool bindDefaultImage(const S32 stage = 0) ; /*virtual*/ void forceImmediateUpdate() ; - const LLUUID& getID() const { return mID; } - + /*virtual*/ const LLUUID& getID() const { return mID; } void setBoostLevel(S32 level); S32 getBoostLevel() { return mBoostLevel; } @@ -177,13 +134,12 @@ public: void resetTextureStats(); void setMaxVirtualSizeResetInterval(S32 interval)const {mMaxVirtualSizeResetInterval = interval;} void resetMaxVirtualSizeResetCounter()const {mMaxVirtualSizeResetCounter = mMaxVirtualSizeResetInterval;} + S32 getMaxVirtualSizeResetCounter() const { return mMaxVirtualSizeResetCounter; } virtual F32 getMaxVirtualSize() ; LLFrameTimer* getLastReferencedTimer() {return &mLastReferencedTimer ;} - S32 getFullWidth() const { return mFullWidth; } - S32 getFullHeight() const { return mFullHeight; } /*virtual*/ void setKnownDrawSize(S32 width, S32 height); virtual void addFace(LLFace* facep) ; @@ -196,60 +152,8 @@ public: S32 getNumVolumes() const; const ll_volume_list_t* getVolumeList() const { return &mVolumeList; } - void generateGLTexture() ; - void destroyGLTexture() ; - //--------------------------------------------------------------------------------------------- - //functions to access LLImageGL - //--------------------------------------------------------------------------------------------- - /*virtual*/S32 getWidth(S32 discard_level = -1) const; - /*virtual*/S32 getHeight(S32 discard_level = -1) const; - - BOOL hasGLTexture() const ; - LLGLuint getTexName() const ; - BOOL createGLTexture() ; - BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S32 usename = 0, BOOL to_create = TRUE, S32 category = LLViewerTexture::OTHER); virtual void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ; - - void setFilteringOption(LLTexUnit::eTextureFilterOptions option); - void setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format = 0, BOOL swap_bytes = FALSE); - void setAddressMode(LLTexUnit::eTextureAddressMode mode); - BOOL setSubImage(const LLImageRaw* imageraw, S32 x_pos, S32 y_pos, S32 width, S32 height); - BOOL setSubImage(const U8* datap, S32 data_width, S32 data_height, S32 x_pos, S32 y_pos, S32 width, S32 height); - void setGLTextureCreated (bool initialized); - void setCategory(S32 category) ; - - LLTexUnit::eTextureAddressMode getAddressMode(void) const ; - S32 getMaxDiscardLevel() const; - S32 getDiscardLevel() const; - S8 getComponents() const ; - BOOL getBoundRecently() const; - S32 getTextureMemory() const ; - LLGLenum getPrimaryFormat() const; - BOOL getIsAlphaMask() const ; - LLTexUnit::eTextureType getTarget(void) const ; - BOOL getMask(const LLVector2 &tc); - F32 getTimePassedSinceLastBound(); - BOOL getMissed() const ; - BOOL isJustBound()const ; - void forceUpdateBindStats(void) const; - - U32 getTexelsInAtlas() const ; - U32 getTexelsInGLTexture() const ; - BOOL isGLTextureCreated() const ; - S32 getDiscardLevelInAtlas() const ; - //--------------------------------------------------------------------------------------------- - //end of functions to access LLImageGL - //--------------------------------------------------------------------------------------------- - - //----------------- - /*virtual*/ void setActive() ; - void forceActive() ; - void setNoDelete() ; - void dontDiscard() { mDontDiscard = 1; mTextureState = NO_DELETE; } - BOOL getDontDiscard() const { return mDontDiscard; } - //----------------- - BOOL isLargeImage() ; void setParcelMedia(LLViewerMediaTexture* media) {mParcelMedia = media;} @@ -262,36 +166,22 @@ protected: void init(bool firstinit) ; void reorganizeFaceList() ; void reorganizeVolumeList() ; - void setTexelsPerImage(); private: friend class LLBumpImageList; friend class LLUIImageList; - //note: do not make this function public. - /*virtual*/ LLImageGL* getGLTexture() const ; virtual void switchToCachedImage(); static bool isMemoryForTextureLow() ; protected: LLUUID mID; - S32 mBoostLevel; // enum describing priority level F32 mSelectedTime; // time texture was last selected - S32 mFullWidth; - S32 mFullHeight; - BOOL mUseMipMaps ; - S8 mComponents; - F32 mTexelsPerImage; // Texels per image. - 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 F32 mAdditionalDecodePriority; // priority add to mDecodePriority. LLFrameTimer mLastReferencedTimer; - //GL texture - LLPointer<LLImageGL> mGLTexturep ; - S8 mDontDiscard; // Keep full res version of this image (for UI, etc) - ll_face_list_t mFaceList ; //reverse pointer pointing to the faces using this image as texture U32 mNumFaces ; LLFrameTimer mLastFaceListUpdateTimer ; @@ -303,17 +193,6 @@ protected: //do not use LLPointer here. LLViewerMediaTexture* mParcelMedia ; -protected: - typedef enum - { - DELETED = 0, //removed from memory - DELETION_CANDIDATE, //ready to be removed from memory - INACTIVE, //not be used for the last certain period (i.e., 30 seconds). - ACTIVE, //just being used, can become inactive if not being used for a certain time (10 seconds). - NO_DELETE = 99 //stay in memory, can not be removed. - } LLGLTextureState; - LLGLTextureState mTextureState ; - static F32 sTexelPixelRatio; public: static const U32 sCurrentFileVersion; @@ -428,6 +307,7 @@ public: // the priority list, and cause horrible things to happen. void setDecodePriority(F32 priority = -1.0f); F32 getDecodePriority() const { return mDecodePriority; }; + F32 getAdditionalDecodePriority() const { return mAdditionalDecodePriority; }; void setAdditionalDecodePriority(F32 priority) ; @@ -509,7 +389,7 @@ protected: S32 getCurrentDiscardLevelForFetching() ; private: - void init(bool firstinit) ; + void init(bool firstinit) ; void cleanup() ; void saveRawImage() ; @@ -732,7 +612,7 @@ public: static LLViewerFetchedTexture* getFetchedTexture(const LLUUID &image_id, BOOL usemipmap = TRUE, - LLViewerTexture::EBoostLevel boost_priority = LLViewerTexture::BOOST_NONE, // Get the requested level immediately upon creation. + LLViewerTexture::EBoostLevel boost_priority = LLGLTexture::BOOST_NONE, // Get the requested level immediately upon creation. S8 texture_type = LLViewerTexture::FETCHED_TEXTURE, LLGLint internal_format = 0, LLGLenum primary_format = 0, @@ -741,7 +621,7 @@ public: static LLViewerFetchedTexture* getFetchedTextureFromFile(const std::string& filename, BOOL usemipmap = TRUE, - LLViewerTexture::EBoostLevel boost_priority = LLViewerTexture::BOOST_NONE, + LLViewerTexture::EBoostLevel boost_priority = LLGLTexture::BOOST_NONE, S8 texture_type = LLViewerTexture::FETCHED_TEXTURE, LLGLint internal_format = 0, LLGLenum primary_format = 0, @@ -750,7 +630,7 @@ public: static LLViewerFetchedTexture* getFetchedTextureFromUrl(const std::string& url, BOOL usemipmap = TRUE, - LLViewerTexture::EBoostLevel boost_priority = LLViewerTexture::BOOST_NONE, + LLViewerTexture::EBoostLevel boost_priority = LLGLTexture::BOOST_NONE, S8 texture_type = LLViewerTexture::FETCHED_TEXTURE, LLGLint internal_format = 0, LLGLenum primary_format = 0, |