merge QAR-1579: texture-cleanup-1.

master
Xiaohong Bao 2009-07-10 22:02:26 +00:00
parent e4dc104e32
commit 77f56a3f3d
180 changed files with 6142 additions and 1414 deletions

View File

@ -72,6 +72,7 @@ public:
}
};
class LLTexture ;
// We need to supply dummy images
class TestImageProvider : public LLImageProviderInterface
{
@ -92,7 +93,7 @@ public:
LLPointer<LLUIImage> makeImage()
{
LLPointer<LLImageGL> image_gl;
LLPointer<LLTexture> image_gl;
LLPointer<LLUIImage> image = new LLUIImage( std::string(), image_gl);
return image;
}

View File

@ -36,6 +36,7 @@ set(llrender_SOURCE_FILES
llpostprocess.cpp
llrendersphere.cpp
llshadermgr.cpp
lltexture.cpp
llvertexbuffer.cpp
)
@ -58,6 +59,7 @@ set(llrender_HEADER_FILES
llrender.h
llrendersphere.h
llshadermgr.h
lltexture.h
llvertexbuffer.h
)

View File

@ -43,6 +43,7 @@
#include "llrender.h"
#include "llstl.h"
#include "v4color.h"
#include "lltexture.h"
// Third party library includes
#include <boost/tokenizer.hpp>
@ -1114,15 +1115,15 @@ void LLFontGL::clearEmbeddedChars()
mEmbeddedChars.clear();
}
void LLFontGL::addEmbeddedChar( llwchar wc, LLImageGL* image, const std::string& label ) const
void LLFontGL::addEmbeddedChar( llwchar wc, LLTexture* image, const std::string& label ) const
{
LLWString wlabel = utf8str_to_wstring(label);
addEmbeddedChar(wc, image, wlabel);
}
void LLFontGL::addEmbeddedChar( llwchar wc, LLImageGL* image, const LLWString& wlabel ) const
void LLFontGL::addEmbeddedChar( llwchar wc, LLTexture* image, const LLWString& wlabel ) const
{
embedded_data_t* ext_data = new embedded_data_t(image, wlabel);
embedded_data_t* ext_data = new embedded_data_t(image->getGLTexture(), wlabel);
mEmbeddedChars[wc] = ext_data;
}

View File

@ -206,8 +206,8 @@ public:
LLImageGL *getImageGL() const;
void addEmbeddedChar( llwchar wc, LLImageGL* image, const std::string& label) const;
void addEmbeddedChar( llwchar wc, LLImageGL* image, const LLWString& label) const;
void addEmbeddedChar( llwchar wc, LLTexture* image, const std::string& label) const;
void addEmbeddedChar( llwchar wc, LLTexture* image, const LLWString& label) const;
void removeEmbeddedChar( llwchar wc ) const;
static std::string nameFromFont(const LLFontGL* fontp);

View File

@ -46,7 +46,6 @@
//----------------------------------------------------------------------------
const F32 MIN_TEXTURE_LIFETIME = 10.f;
//statics
@ -61,7 +60,7 @@ S32 LLImageGL::sCount = 0;
BOOL LLImageGL::sGlobalUseAnisotropic = FALSE;
F32 LLImageGL::sLastFrameTime = 0.f;
LLImageGL* LLImageGL::sDefaultGLTexture = NULL ;
std::set<LLImageGL*> LLImageGL::sImageList;
//**************************************************************************************
@ -263,28 +262,6 @@ void LLImageGL::restoreGL()
}
//----------------------------------------------------------------------------
//static
BOOL LLImageGL::create(LLPointer<LLImageGL>& dest, BOOL usemipmaps)
{
dest = new LLImageGL(usemipmaps);
return TRUE;
}
BOOL LLImageGL::create(LLPointer<LLImageGL>& dest, U32 width, U32 height, U8 components, BOOL usemipmaps)
{
dest = new LLImageGL(width, height, components, usemipmaps);
return TRUE;
}
BOOL LLImageGL::create(LLPointer<LLImageGL>& dest, const LLImageRaw* imageraw, BOOL usemipmaps)
{
dest = new LLImageGL(imageraw, usemipmaps);
return TRUE;
}
//----------------------------------------------------------------------------
LLImageGL::LLImageGL(BOOL usemipmaps)
: mSaveData(0)
{
@ -331,7 +308,6 @@ void LLImageGL::init(BOOL usemipmaps)
#endif
mPickMask = NULL;
mTextureState = NO_DELETE ;
mTextureMemory = 0;
mLastBindTime = 0.f;
@ -351,8 +327,7 @@ void LLImageGL::init(BOOL usemipmaps)
mComponents = 0;
mMaxDiscardLevel = MAX_DISCARD_LEVEL;
mCurrentDiscardLevel = -1;
mDontDiscard = FALSE;
mCurrentDiscardLevel = -1;
mFormatInternal = -1;
mFormatPrimary = (LLGLenum) 0;
@ -462,7 +437,7 @@ void LLImageGL::dump()
//----------------------------------------------------------------------------
void LLImageGL::updateBindStats(void) const
BOOL LLImageGL::updateBindStats(S32 tex_mem) const
{
if (mTexName != 0)
{
@ -474,38 +449,18 @@ void LLImageGL::updateBindStats(void) const
{
// we haven't accounted for this texture yet this frame
sUniqueCount++;
updateBoundTexMem(mTextureMemory);
updateBoundTexMem(tex_mem);
mLastBindTime = sLastFrameTime;
if(LLFastTimer::sMetricLog)
{
updateTestStats() ;
}
return TRUE ;
}
}
return FALSE ;
}
//virtual
void LLImageGL::updateTestStats(void) const
F32 LLImageGL::getTimePassedSinceLastBound()
{
}
//virtual
bool LLImageGL::bindError(const S32 stage) const
{
return false;
}
//virtual
bool LLImageGL::bindDefaultImage(const S32 stage) const
{
return false;
}
//virtual
void LLImageGL::forceImmediateUpdate()
{
return ;
return sLastFrameTime - mLastBindTime ;
}
void LLImageGL::setExplicitFormat( LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes )
@ -1052,7 +1007,6 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
mTextureMemory = getMipBytes(discard_level);
sGlobalTextureMemoryInBytes += mTextureMemory;
setActive() ;
// mark this as bound at this point, so we don't throw it out immediately
mLastBindTime = sLastFrameTime;
@ -1068,12 +1022,7 @@ BOOL LLImageGL::setDiscardLevel(S32 discard_level)
discard_level = llclamp(discard_level, 0, (S32)mMaxDiscardLevel);
if (mDontDiscard)
{
// don't discard!
return FALSE;
}
else if (discard_level == mCurrentDiscardLevel)
if (discard_level == mCurrentDiscardLevel)
{
// nothing to do
return FALSE;
@ -1255,8 +1204,7 @@ void LLImageGL::destroyGLTexture()
sGlobalTextureMemoryInBytes -= mTextureMemory;
mTextureMemory = 0;
LLImageGL::deleteTextures(1, &mTexName);
mTextureState = DELETED ;
LLImageGL::deleteTextures(1, &mTexName);
mTexName = 0;
mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel.
mGLTextureCreated = FALSE ;
@ -1440,57 +1388,6 @@ void LLImageGL::analyzeAlpha(const void* data_in, S32 w, S32 h)
}
}
BOOL LLImageGL::isDeleted()
{
return mTextureState == DELETED ;
}
BOOL LLImageGL::isInactive()
{
return mTextureState == INACTIVE ;
}
BOOL LLImageGL::isDeletionCandidate()
{
return mTextureState == DELETION_CANDIDATE ;
}
void LLImageGL::setDeletionCandidate()
{
if(mTexName && (mTextureState == INACTIVE))
{
mTextureState = DELETION_CANDIDATE ;
}
}
void LLImageGL::forceActive()
{
mTextureState = ACTIVE ;
}
void LLImageGL::setActive()
{
if(mTextureState != NO_DELETE)
{
mTextureState = ACTIVE ;
}
}
//set the texture inactive
void LLImageGL::setInactive()
{
if(mTexName && (mTextureState == ACTIVE) && !getBoundRecently())
{
mTextureState = INACTIVE ;
}
}
//set the texture to stay in memory
void LLImageGL::setNoDelete()
{
mTextureState = NO_DELETE ;
}
//----------------------------------------------------------------------------
void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
{

View File

@ -57,8 +57,8 @@ public:
static S32 dataFormatBytes(S32 dataformat, S32 width, S32 height);
static S32 dataFormatComponents(S32 dataformat);
void updateBindStats(void) const;
virtual void updateTestStats(void) const;
BOOL updateBindStats(S32 tex_mem) const ;
F32 getTimePassedSinceLastBound();
// needs to be called every frame
static void updateStats(F32 current_time);
@ -72,12 +72,6 @@ public:
static bool checkSize(S32 width, S32 height);
// Not currently necessary for LLImageGL, but required in some derived classes,
// so include for compatability
static BOOL create(LLPointer<LLImageGL>& dest, BOOL usemipmaps = TRUE);
static BOOL create(LLPointer<LLImageGL>& dest, U32 width, U32 height, U8 components, BOOL usemipmaps = TRUE);
static BOOL create(LLPointer<LLImageGL>& dest, const LLImageRaw* imageraw, BOOL usemipmaps = TRUE);
public:
LLImageGL(BOOL usemipmaps = TRUE);
LLImageGL(U32 width, U32 height, U8 components, BOOL usemipmaps = TRUE);
@ -90,11 +84,9 @@ protected:
public:
virtual void dump(); // debugging info to llinfos
virtual bool bindError(const S32 stage = 0) const;
virtual bool bindDefaultImage(const S32 stage = 0) const;
virtual void forceImmediateUpdate() ;
void setSize(S32 width, S32 height, S32 ncomponents);
void setComponents(S32 ncomponents) { mComponents = (S8)ncomponents ;}
// These 3 functions currently wrap glGenTextures(), glDeleteTextures(), and glTexImage2D()
// for tracking purposes and will be deprecated in the future
@ -116,7 +108,6 @@ public:
void destroyGLTexture();
void setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format = 0, BOOL swap_bytes = FALSE);
void dontDiscard() { mDontDiscard = 1; mTextureState = NO_DELETE; }
S32 getDiscardLevel() const { return mCurrentDiscardLevel; }
S32 getMaxDiscardLevel() const { return mMaxDiscardLevel; }
@ -145,9 +136,7 @@ public:
void setGLTextureCreated (bool initialized) { mGLTextureCreated = initialized; }
BOOL getUseMipMaps() const { return mUseMipMaps; }
void setUseMipMaps(BOOL usemips) { mUseMipMaps = usemips; }
BOOL getUseDiscard() const { return mUseMipMaps && !mDontDiscard; }
BOOL getDontDiscard() const { return mDontDiscard; }
void setUseMipMaps(BOOL usemips) { mUseMipMaps = usemips; }
BOOL isValidForSculpt(S32 discard_level, S32 image_width, S32 image_height, S32 ncomponents) ;
@ -168,16 +157,6 @@ public:
void setFilteringOption(LLTexUnit::eTextureFilterOptions option);
LLTexUnit::eTextureFilterOptions getFilteringOption(void) const { return mFilterOption; }
BOOL isDeleted() ;
BOOL isInactive() ;
BOOL isDeletionCandidate();
void setDeletionCandidate() ;
void setInactive() ;
void setActive() ;
void forceActive() ;
void setNoDelete() ;
protected:
void init(BOOL usemipmaps);
virtual void cleanup(); // Clean up the LLImageGL so it can be reinitialized. Be careful when using this in derived class destructors
@ -210,28 +189,15 @@ protected:
S8 mComponents;
S8 mMaxDiscardLevel;
S8 mDontDiscard; // Keep full res version of this image (for UI, etc)
bool mTexOptionsDirty;
LLTexUnit::eTextureAddressMode mAddressMode; // Defaults to TAM_WRAP
LLTexUnit::eTextureFilterOptions mFilterOption; // Defaults to TFO_TRILINEAR
LLGLint mFormatInternal; // = GL internalformat
LLGLenum mFormatPrimary; // = GL format (pixel data format)
LLGLenum mFormatType;
BOOL mFormatSwapBytes;// if true, use glPixelStorei(GL_UNPACK_SWAP_BYTES, 1)
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.
} LLGLTexureState;
LLGLTexureState mTextureState ;
// STATICS
public:
@ -249,6 +215,7 @@ public:
static U32 sBindCount; // Tracks number of texture binds for current frame
static U32 sUniqueCount; // Tracks number of unique texture binds for current frame
static BOOL sGlobalUseAnisotropic;
static LLImageGL* sDefaultGLTexture ;
#if DEBUG_MISS
BOOL mMissed; // Missed on last bind?

View File

@ -38,6 +38,7 @@
#include "llcubemap.h"
#include "llimagegl.h"
#include "llrendertarget.h"
#include "lltexture.h"
LLRender gGL;
@ -177,20 +178,21 @@ void LLTexUnit::disable(void)
}
}
bool LLTexUnit::bind(LLImageGL* texture, bool forceBind)
bool LLTexUnit::bind(LLTexture* texture, bool forceBind)
{
stop_glerror();
if (mIndex < 0) return false;
gGL.flush();
if (texture == NULL)
LLImageGL* gl_tex = NULL ;
if (texture == NULL || !(gl_tex = texture->getGLTexture()))
{
llwarns << "NULL LLTexUnit::bind texture" << llendl;
return false;
}
if (!texture->getTexName()) //if texture does not exist
if (!gl_tex->getTexName()) //if texture does not exist
{
//if deleted, will re-generate it immediately
texture->forceImmediateUpdate() ;
@ -198,14 +200,57 @@ bool LLTexUnit::bind(LLImageGL* texture, bool forceBind)
return texture->bindDefaultImage(mIndex);
}
if ((mCurrTexture != gl_tex->getTexName()) || forceBind)
{
activate();
enable(gl_tex->getTarget());
mCurrTexture = gl_tex->getTexName();
glBindTexture(sGLTextureType[gl_tex->getTarget()], mCurrTexture);
if(gl_tex->updateBindStats(gl_tex->mTextureMemory))
{
texture->setActive() ;
texture->updateBindStatsForTester() ;
}
mHasMipMaps = gl_tex->mHasMipMaps;
if (gl_tex->mTexOptionsDirty)
{
gl_tex->mTexOptionsDirty = false;
setTextureAddressMode(gl_tex->mAddressMode);
setTextureFilteringOption(gl_tex->mFilterOption);
}
}
return true;
}
bool LLTexUnit::bind(LLImageGL* texture, bool forceBind)
{
stop_glerror();
if (mIndex < 0) return false;
if(!texture)
{
llwarns << "NULL LLTexUnit::bind texture" << llendl;
return false;
}
if(!texture->getTexName())
{
if(LLImageGL::sDefaultGLTexture && LLImageGL::sDefaultGLTexture->getTexName())
{
return bind(LLImageGL::sDefaultGLTexture) ;
}
return false ;
}
gGL.flush();
if ((mCurrTexture != texture->getTexName()) || forceBind)
{
activate();
enable(texture->getTarget());
mCurrTexture = texture->getTexName();
glBindTexture(sGLTextureType[texture->getTarget()], mCurrTexture);
texture->updateBindStats();
texture->setActive() ;
texture->updateBindStats(texture->mTextureMemory);
mHasMipMaps = texture->mHasMipMaps;
if (texture->mTexOptionsDirty)
{
@ -238,7 +283,7 @@ bool LLTexUnit::bind(LLCubeMap* cubeMap)
mCurrTexture = cubeMap->mImages[0]->getTexName();
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, mCurrTexture);
mHasMipMaps = cubeMap->mImages[0]->mHasMipMaps;
cubeMap->mImages[0]->updateBindStats();
cubeMap->mImages[0]->updateBindStats(cubeMap->mImages[0]->mTextureMemory);
if (cubeMap->mImages[0]->mTexOptionsDirty)
{
cubeMap->mImages[0]->mTexOptionsDirty = false;
@ -279,15 +324,21 @@ bool LLTexUnit::bind(LLRenderTarget* renderTarget, bool bindDepth)
bool LLTexUnit::bindManual(eTextureType type, U32 texture, bool hasMips)
{
if (mIndex < 0 || mCurrTexture == texture) return false;
if (mIndex < 0)
{
return false;
}
gGL.flush();
activate();
enable(type);
mCurrTexture = texture;
glBindTexture(sGLTextureType[type], texture);
mHasMipMaps = hasMips;
if(mCurrTexture != texture)
{
gGL.flush();
activate();
enable(type);
mCurrTexture = texture;
glBindTexture(sGLTextureType[type], texture);
mHasMipMaps = hasMips;
}
return true;
}

View File

@ -51,6 +51,7 @@ class LLVertexBuffer;
class LLCubeMap;
class LLImageGL;
class LLRenderTarget;
class LLTexture ;
class LLTexUnit
{
@ -149,6 +150,7 @@ public:
// Binds the LLImageGL to this texture unit
// (automatically enables the unit for the LLImageGL's texture type)
bool bind(LLImageGL* texture, bool forceBind = false);
bool bind(LLTexture* texture, bool forceBind = false);
// Binds a cubemap to this texture unit
// (automatically enables the texture unit for cubemaps)

View File

@ -0,0 +1,37 @@
/**
* @file lltexture.cpp
*
* $LicenseInfo:firstyear=2000&license=viewergpl$
*
* Copyright (c) 2000-2009, Linden Research, Inc.
*
* 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
*
* 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
*
* 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.
*
* 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$
*/
#include "linden_common.h"
#include "lltexture.h"
//virtual
LLTexture::~LLTexture()
{
}

View File

@ -0,0 +1,77 @@
/**
* @file lltexture.h
* @brief LLTexture definition
*
* This class acts as a wrapper for OpenGL calls.
* The goal of this class is to minimize the number of api calls due to legacy rendering
* code, to define an interface for a multiple rendering API abstraction of the UI
* rendering, and to abstract out direct rendering calls in a way that is cleaner and easier to maintain.
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* 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
*
* 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
*
* 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.
*
* 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$
*/
#ifndef LL_TEXTURE_H
#define LL_TEXTURE_H
#include "llrefcount.h"
class LLImageGL ;
class LLTexUnit ;
class LLFontGL ;
//
//this is an abstract class as the parent for the class LLViewerTexture
//through the following virtual functions, the class LLViewerTexture can be reached from /llrender.
//
class LLTexture : public LLRefCount
{
friend class LLTexUnit ;
friend class LLFontGL ;
protected:
virtual ~LLTexture();
public:
LLTexture(){}
//
//interfaces to access LLViewerTexture
//
virtual bool bindDefaultImage(const S32 stage = 0) const = 0 ;
virtual void forceImmediateUpdate() = 0 ;
virtual void setActive() = 0 ;
virtual S32 getWidth(S32 discard_level = -1) const = 0 ;
virtual S32 getHeight(S32 discard_level = -1) const = 0 ;
private:
//note: do not make this function public.
virtual LLImageGL* getGLTexture() const = 0 ;
virtual void updateBindStatsForTester() = 0 ;
};
#endif

View File

@ -39,7 +39,6 @@
#include "llbutton.h"
#include "lluictrl.h"
#include "llctrlselectioninterface.h"
#include "llimagegl.h"
#include "llrect.h"
#include "llscrolllistctrl.h"
#include "lllineeditor.h"

View File

@ -37,7 +37,6 @@
#include "v4color.h"
#include "lluictrl.h"
#include "stdenums.h"
#include "llimagegl.h"
class LLTextBox;
class LLUICtrlFactory;

View File

@ -40,7 +40,6 @@
#include "llfocusmgr.h"
#include "llkeyboard.h" // for the MASK constants
#include "llcontrol.h"
#include "llimagegl.h"
#include "lluictrlfactory.h"
#include <sstream>

View File

@ -39,7 +39,6 @@
#include "llgl.h"
#include "llui.h"
#include "llfontgl.h"
#include "llimagegl.h"
#include "lltimer.h"
#include "llglheaders.h"

View File

@ -35,7 +35,6 @@
#include "stdtypes.h"
#include "llview.h"
#include "llimagegl.h"
#include "llcoord.h"

View File

@ -44,7 +44,6 @@
#include "llfontgl.h"
#include "llui.h"
#include "llstring.h" // LLWString
//#include "llimagegl.h"
#include "lleditmenuhandler.h"
#include "llframetimer.h"

View File

@ -40,7 +40,6 @@
#include "llfocusmgr.h"
#include "llkeyboard.h" // for the MASK constants
#include "llcontrol.h"
#include "llimagegl.h"
#include "lluictrlfactory.h"
static LLDefaultChildRegistry::Register<LLSlider> r1("slider_bar");

View File

@ -36,8 +36,6 @@
#include "llf32uictrl.h"
#include "v4color.h"
class LLImageGL;
class LLSlider : public LLF32UICtrl
{
public:

View File

@ -55,7 +55,6 @@
#include "llundo.h"
#include "llviewborder.h"
#include "llcontrol.h"
#include "llimagegl.h"
#include "llwindow.h"
#include "lltextparser.h"
#include <queue>

View File

@ -43,7 +43,6 @@
#include "v4color.h"
#include "llrender.h"
#include "llrect.h"
#include "llimagegl.h"
#include "lldir.h"
#include "llfontgl.h"
@ -424,7 +423,7 @@ void gl_corners_2d(S32 left, S32 top, S32 right, S32 bottom, S32 length, F32 max
}
void gl_draw_image( S32 x, S32 y, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect )
void gl_draw_image( S32 x, S32 y, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect )
{
if (NULL == image)
{
@ -434,7 +433,7 @@ void gl_draw_image( S32 x, S32 y, LLImageGL* image, const LLColor4& color, const
gl_draw_scaled_rotated_image( x, y, image->getWidth(0), image->getHeight(0), 0.f, image, color, uv_rect );
}
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
{
if (NULL == image)
{
@ -444,7 +443,7 @@ void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLImageGL* image,
gl_draw_scaled_rotated_image( x, y, width, height, 0.f, image, color, uv_rect );
}
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLImageGL* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect)
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect)
{
if (NULL == image)
{
@ -460,7 +459,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border
gl_draw_scaled_image_with_border(x, y, width, height, image, color, solid_color, uv_rect, scale_rect);
}
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect, const LLRectf& scale_rect)
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect, const LLRectf& scale_rect)
{
stop_glerror();
@ -646,12 +645,12 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLIma
}
}
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
{
gl_draw_scaled_rotated_image( x, y, image->getWidth(0), image->getHeight(0), degrees, image, color, uv_rect );
}
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
{
if (NULL == image)
{
@ -697,7 +696,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
}
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color, const LLRectf& uv_rect)
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
{
if (NULL == image)
{

View File

@ -58,7 +58,6 @@
class LLColor4;
class LLHtmlHelp;
class LLImageGL;
class LLVector3;
class LLVector2;
class LLUIImage;
@ -99,14 +98,14 @@ void gl_washer_2d(F32 outer_radius, F32 inner_radius, S32 steps, const LLColor4&
void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, F32 end_radians, S32 steps, const LLColor4& inner_color, const LLColor4& outer_color);
void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LLColor4& inner_color, const LLColor4& outer_color);
void gl_draw_image(S32 x, S32 y, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLImageGL* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_image(S32 x, S32 y, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
// Flip vertical, used for LLFloaterHTML
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageGL* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_rect_2d_xor(S32 left, S32 top, S32 right, S32 bottom);
void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase = 0.f );

View File

@ -39,7 +39,7 @@
#include "lluiimage.h"
#include "llui.h"
LLUIImage::LLUIImage(const std::string& name, LLPointer<LLImageGL> image) :
LLUIImage::LLUIImage(const std::string& name, LLPointer<LLTexture> image) :
mName(name),
mImage(image),
mScaleRegion(0.f, 1.f, 1.f, 0.f),

View File

@ -33,26 +33,28 @@
#ifndef LL_LLUIIMAGE_H
#define LL_LLUIIMAGE_H
//#include "llgl.h"
#include "llimagegl.h"
#include "v4color.h"
#include "llpointer.h"
#include "llrefcount.h"
#include "llrefcount.h"
#include "llrect.h"
#include <boost/function.hpp>
#include "llinitparam.h"
#include "lltexture.h"
extern const LLColor4 UI_VERTEX_COLOR;
class LLUIImage : public LLRefCount
{
public:
LLUIImage(const std::string& name, LLPointer<LLImageGL> image);
LLUIImage(const std::string& name, LLPointer<LLTexture> image);
virtual ~LLUIImage();
void setClipRegion(const LLRectf& region);
void setScaleRegion(const LLRectf& region);
LLPointer<LLImageGL> getImage() { return mImage; }
const LLPointer<LLImageGL>& getImage() const { return mImage; }
LLPointer<LLTexture> getImage() { return mImage; }
const LLPointer<LLTexture>& getImage() const { return mImage; }
void draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color = UI_VERTEX_COLOR) const;
void draw(S32 x, S32 y, const LLColor4& color = UI_VERTEX_COLOR) const;
@ -79,7 +81,7 @@ protected:
std::string mName;
LLRectf mScaleRegion;
LLRectf mClipRegion;
LLPointer<LLImageGL> mImage;
LLPointer<LLTexture> mImage;
BOOL mUniformScaling;
BOOL mNoClip;
};

View File

@ -386,9 +386,7 @@ set(viewer_SOURCE_FILES
llviewerdisplay.cpp
llviewerfloaterreg.cpp
llviewergenericmessage.cpp
llviewergesture.cpp
llviewerimage.cpp
llviewerimagelist.cpp
llviewergesture.cpp
llviewerinventory.cpp
llviewerjointattachment.cpp
llviewerjoint.cpp
@ -416,7 +414,9 @@ set(viewer_SOURCE_FILES
llviewershadermgr.cpp
llviewerstats.cpp
llviewertexteditor.cpp
llviewertexture.cpp
llviewertextureanim.cpp
llviewertexturelist.cpp
llviewerthrottle.cpp
llviewervisualparam.cpp
llviewerwindow.cpp
@ -815,9 +815,7 @@ set(viewer_HEADER_FILES
llviewerdisplay.h
llviewerfloaterreg.h
llviewergenericmessage.h
llviewergesture.h
llviewerimage.h
llviewerimagelist.h
llviewergesture.h
llviewerinventory.h
llviewerjoint.h
llviewerjointattachment.h
@ -843,7 +841,9 @@ set(viewer_HEADER_FILES
llviewershadermgr.h
llviewerstats.h
llviewertexteditor.h
llviewertexture.h
llviewertextureanim.h
llviewertexturelist.h
llviewerthrottle.h
llviewervisualparam.h
llviewerwindow.h

View File

@ -42,7 +42,7 @@
#include "lltexteditor.h"
#include "llalertdialog.h"
#include "llerrorcontrol.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llgroupmgr.h"
#include "llagent.h"
#include "llagentwearables.h"
@ -1440,10 +1440,10 @@ bool LLAppViewer::cleanup()
LLMetricPerformanceTester::cleanClass() ;
//Note:
//LLViewerMedia::cleanupClass() has to be put before gImageList.shutdown()
//LLViewerMedia::cleanupClass() has to be put before gTextureList.shutdown()
//because some new image might be generated during cleaning up media. --bao
LLViewerMedia::cleanupClass();
gImageList.shutdown(); // shutdown again in case a callback added something
gTextureList.shutdown(); // shutdown again in case a callback added something
LLUIImageList::getInstance()->cleanUp();
// This should eventually be done in LLAppViewer

View File

@ -48,7 +48,7 @@
#include "lltextbox.h"
#include "llfloatercolorpicker.h"
#include "llviewborder.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llfocusmgr.h"
static LLDefaultChildRegistry::Register<LLColorSwatchCtrl> r("color_swatch");
@ -227,7 +227,7 @@ void LLColorSwatchCtrl::draw()
{
if (!mFallbackImageName.empty())
{
LLPointer<LLViewerImage> fallback_image = gImageList.getImageFromFile(mFallbackImageName);
LLPointer<LLViewerTexture> fallback_image = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName, TRUE, FALSE, LLViewerTexture::LOD_TEXTURE);
if( fallback_image->getComponents() == 4 )
{
gl_rect_2d_checkerboard( interior );

View File

@ -36,7 +36,7 @@
#include "lluictrl.h"
#include "v4color.h"
#include "llfloater.h"
#include "llviewerimage.h"
#include "llviewertexture.h"
#include "lltextbox.h"
//
@ -45,7 +45,7 @@
class LLColor4;
class LLTextBox;
class LLFloaterColorPicker;
class LLViewerImage;
class LLViewerTexture;
class LLColorSwatchCtrl
: public LLUICtrl

View File

@ -229,7 +229,7 @@ S32 LLDrawable::findReferences(LLDrawable *drawablep)
return count;
}
LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerImage *texturep)
LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep)
{
LLMemType mt(LLMemType::MTYPE_DRAWABLE);
@ -253,7 +253,7 @@ LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerImage *texturep)
return face;
}
LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerImage *texturep)
LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep)
{
LLMemType mt(LLMemType::MTYPE_DRAWABLE);
@ -275,7 +275,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerImage *texturep)
}
void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerImage *texturep)
void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerTexture *texturep)
{
if (newFaces == (S32)mFaces.size())
{
@ -298,7 +298,7 @@ void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerImag
llassert_always(mFaces.size() == newFaces);
}
void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewerImage *texturep)
void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewerTexture *texturep)
{
if (newFaces <= (S32)mFaces.size() && newFaces >= (S32)mFaces.size()/2)
{
@ -673,7 +673,7 @@ BOOL LLDrawable::updateMoveDamped()
return done_moving;
}
void LLDrawable::updateDistance(LLCamera& camera)
void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
{
//switch LOD with the spatial group to avoid artifacts
//LLSpatialGroup* sg = getSpatialGroup();
@ -695,7 +695,7 @@ void LLDrawable::updateDistance(LLCamera& camera)
for (S32 i = 0; i < getNumFaces(); i++)
{
LLFace* facep = getFace(i);
if (facep->getPoolType() == LLDrawPool::POOL_ALPHA)
if (force_update || facep->getPoolType() == LLDrawPool::POOL_ALPHA)
{
LLVector3 box = (facep->mExtents[1] - facep->mExtents[0]) * 0.25f;
LLVector3 v = (facep->mCenterLocal-camera.getOrigin());
@ -736,11 +736,7 @@ void LLDrawable::updateTexture()
if (getVOVolume())
{
if (!isActive())
{
//gPipeline.markMoved(this);
}
else
if (isActive())
{
if (isRoot())
{
@ -1273,7 +1269,7 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>*
}
}
void LLSpatialBridge::updateDistance(LLCamera& camera_in)
void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
{
if (mDrawable == NULL)
{
@ -1283,7 +1279,7 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in)
LLCamera camera = transformCamera(camera_in);
mDrawable->updateDistance(camera);
mDrawable->updateDistance(camera, force_update);
if (mDrawable->getVObj())
{
@ -1300,7 +1296,7 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in)
if (!drawable->isAvatar())
{
drawable->updateDistance(camera);
drawable->updateDistance(camera, force_update);
}
}
}

View File

@ -58,7 +58,7 @@ class LLSpatialGroup;
class LLSpatialBridge;
class LLSpatialPartition;
class LLVOVolume;
class LLViewerImage;
class LLViewerTexture;
// Can have multiple silhouettes for each object
const U32 SILHOUETTE_HIGHLIGHT = 0;
@ -125,11 +125,11 @@ public:
inline S32 getNumFaces() const;
//void removeFace(const S32 i); // SJB: Avoid using this, it's slow
LLFace* addFace(LLFacePool *poolp, LLViewerImage *texturep);
LLFace* addFace(const LLTextureEntry *te, LLViewerImage *texturep);
LLFace* addFace(LLFacePool *poolp, LLViewerTexture *texturep);
LLFace* addFace(const LLTextureEntry *te, LLViewerTexture *texturep);
void deleteFaces(S32 offset, S32 count);
void setNumFaces(const S32 numFaces, LLFacePool *poolp, LLViewerImage *texturep);
void setNumFacesFast(const S32 numFaces, LLFacePool *poolp, LLViewerImage *texturep);
void setNumFaces(const S32 numFaces, LLFacePool *poolp, LLViewerTexture *texturep);
void setNumFacesFast(const S32 numFaces, LLFacePool *poolp, LLViewerTexture *texturep);
void mergeFaces(LLDrawable* src);
void init();

View File

@ -60,7 +60,7 @@ S32 LLDrawPool::sNumDrawPools = 0;
//=============================
// Draw Pool Implementation
//=============================
LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerImage *tex0)
LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerTexture *tex0)
{
LLDrawPool *poolp = NULL;
switch (type)
@ -129,7 +129,7 @@ LLDrawPool::~LLDrawPool()
}
LLViewerImage *LLDrawPool::getDebugTexture()
LLViewerTexture *LLDrawPool::getDebugTexture()
{
return NULL;
}
@ -244,7 +244,7 @@ void LLFacePool::destroy()
}
}
void LLFacePool::dirtyTextures(const std::set<LLViewerImage*>& textures)
void LLFacePool::dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures)
{
}
@ -279,7 +279,7 @@ S32 LLFacePool::drawLoopSetTex(face_array_t& face_list, S32 stage)
iter != face_list.end(); iter++)
{
LLFace *facep = *iter;
gGL.getTexUnit(stage)->bind(facep->getTexture());
gGL.getTexUnit(stage)->bind(facep->getTexture()) ;
gGL.getTexUnit(0)->activate();
res += facep->renderIndexed();
}
@ -295,13 +295,6 @@ void LLFacePool::drawLoop()
}
}
void LLFacePool::renderFaceSelected(LLFace *facep,
LLImageGL *image,
const LLColor4 &color,
const S32 index_offset, const S32 index_count)
{
}
void LLFacePool::enqueue(LLFace* facep)
{
mDrawFace.push_back(facep);
@ -330,7 +323,7 @@ void LLFacePool::resetDrawOrders()
mDrawFace.resize(0);
}
LLViewerImage *LLFacePool::getTexture()
LLViewerTexture *LLFacePool::getTexture()
{
return NULL;
}
@ -481,7 +474,7 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
{
if (params.mTexture.notNull())
{
gGL.getTexUnit(0)->bind(params.mTexture.get());
gGL.getTexUnit(0)->bind(params.mTexture) ;
if (params.mTextureMatrix)
{
glMatrixMode(GL_TEXTURE);

View File

@ -39,8 +39,8 @@
#include "llvertexbuffer.h"
class LLFace;
class LLImageGL;
class LLViewerImage;
class LLViewerTexture;
class LLViewerFetchedTexture;
class LLSpatialGroup;
class LLDrawInfo;
@ -77,7 +77,7 @@ public:
S32 getId() const { return mId; }
U32 getType() const { return mType; }
virtual LLViewerImage *getDebugTexture();
virtual LLViewerTexture *getDebugTexture();
virtual void beginRenderPass( S32 pass );
virtual void endRenderPass( S32 pass );
virtual S32 getNumPasses();
@ -103,9 +103,9 @@ public:
virtual BOOL verify() const { return TRUE; } // Verify that all data in the draw pool is correct!
virtual S32 getVertexShaderLevel() const { return mVertexShaderLevel; }
static LLDrawPool* createPool(const U32 type, LLViewerImage *tex0 = NULL);
static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL);
virtual LLDrawPool *instancePool() = 0; // Create an empty new instance of the pool.
virtual LLViewerImage* getTexture() = 0;
virtual LLViewerTexture* getTexture() = 0;
virtual BOOL isFacePool() { return FALSE; }
virtual void resetDrawOrders() = 0;
@ -139,8 +139,8 @@ public:
LLRenderPass(const U32 type);
virtual ~LLRenderPass();
/*virtual*/ LLDrawPool* instancePool();
/*virtual*/ LLViewerImage* getDebugTexture() { return NULL; }
LLViewerImage* getTexture() { return NULL; }
/*virtual*/ LLViewerTexture* getDebugTexture() { return NULL; }
LLViewerTexture* getTexture() { return NULL; }
BOOL isDead() { return FALSE; }
void resetDrawOrders() { }
@ -169,11 +169,9 @@ public:
virtual void renderForSelect() = 0;
BOOL isDead() { return mReferences.empty(); }
virtual void renderFaceSelected(LLFace *facep, LLImageGL *image, const LLColor4 &color,
const S32 index_offset = 0, const S32 index_count = 0);
virtual LLViewerImage *getTexture();
virtual void dirtyTextures(const std::set<LLViewerImage*>& textures);
virtual LLViewerTexture *getTexture();
virtual void dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures);
virtual void enqueue(LLFace *face);
virtual BOOL addFace(LLFace *face);

View File

@ -46,7 +46,7 @@
#include "lldrawable.h"
#include "llface.h"
#include "llviewercamera.h"
#include "llviewerimagelist.h" // For debugging
#include "llviewertexturelist.h" // For debugging
#include "llviewerobjectlist.h" // For debugging
#include "llviewerwindow.h"
#include "pipeline.h"
@ -218,8 +218,8 @@ void LLDrawPoolAlpha::render(S32 pass)
}
gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
glColor4f(1,0,0,1);
LLViewerImage::sSmokeImagep->addTextureStats(1024.f*1024.f);
gGL.getTexUnit(0)->bind(LLViewerImage::sSmokeImagep.get());
LLViewerFetchedTexture::sSmokeImagep->addTextureStats(1024.f*1024.f);
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sSmokeImagep) ;
renderAlphaHighlight(LLVertexBuffer::MAP_VERTEX |
LLVertexBuffer::MAP_TEXCOORD0);
}
@ -294,7 +294,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask)
if (params.mTexture.notNull())
{
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->bind(params.mTexture.get());
gGL.getTexUnit(0)->bind(params.mTexture) ;
params.mTexture->addTextureStats(params.mVSize);
if (params.mTextureMatrix)
{

View File

@ -633,7 +633,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
if (pass==1 && (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES) || LLViewerPartSim::getMaxPartCount() <= 0))
{
// debug code to draw a sphere in place of avatar
gGL.getTexUnit(0)->bind(LLViewerImage::sWhiteImagep.get());
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
gGL.setColorMask(true, true);
LLVector3 pos = avatarp->getPositionAgent();
gGL.color4f(1.0f, 1.0f, 1.0f, 0.7f);
@ -819,7 +819,7 @@ void LLDrawPoolAvatar::renderForSelect()
//-----------------------------------------------------------------------------
// getDebugTexture()
//-----------------------------------------------------------------------------
LLViewerImage *LLDrawPoolAvatar::getDebugTexture()
LLViewerTexture *LLDrawPoolAvatar::getDebugTexture()
{
if (mReferences.empty())
{

View File

@ -105,7 +105,7 @@ public:
void endDeferredRigid();
void endDeferredSkinned();
/*virtual*/ LLViewerImage *getDebugTexture();
/*virtual*/ LLViewerTexture *getDebugTexture();
/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
void renderAvatars(LLVOAvatar *single_avatar, S32 pass = -1); // renders only one avatar if single_avatar is not null.

View File

@ -37,7 +37,6 @@
#include "llstl.h"
#include "llviewercontrol.h"
#include "lldir.h"
#include "llimagegl.h"
#include "m3math.h"
#include "m4math.h"
#include "v4math.h"
@ -51,7 +50,7 @@
#include "llsky.h"
#include "lltextureentry.h"
#include "llviewercamera.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "pipeline.h"
#include "llspatialpartition.h"
#include "llviewershadermgr.h"
@ -143,9 +142,10 @@ void LLStandardBumpmap::restoreGL()
// llinfos << "Loading bumpmap: " << bump_image_id << " from viewerart" << llendl;
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mLabel = label;
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage =
gImageList.getImage(LLUUID(bump_image_id),
LLViewerTextureManager::getFetchedTexture(LLUUID(bump_image_id),
TRUE,
FALSE,
LLViewerTexture::LOD_TEXTURE,
0,
0);
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setLoadedCallback(LLBumpImageList::onSourceStandardLoaded, 0, TRUE, FALSE, NULL );
@ -569,22 +569,23 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL
// static
BOOL LLDrawPoolBump::bindBumpMap(LLDrawInfo& params, S32 channel)
{
LLImageGL* bump = NULL;
LLViewerTexture* bump = NULL;
U8 bump_code = params.mBump;
LLViewerImage* tex = params.mTexture;
LLViewerFetchedTexture* tex = LLViewerTextureManager::staticCastToFetchedTexture(params.mTexture) ;
if(!tex)
{
//if the texture is not a fetched texture
return FALSE;
}
switch( bump_code )
{
case BE_NO_BUMP:
bump = NULL;
case BE_NO_BUMP:
break;
case BE_BRIGHTNESS:
case BE_DARKNESS:
if( tex )
{
bump = gBumpImageList.getBrightnessDarknessImage( tex, bump_code );
}
bump = gBumpImageList.getBrightnessDarknessImage( tex, bump_code );
break;
default:
@ -812,7 +813,7 @@ LLBumpImageList::~LLBumpImageList()
void LLBumpImageList::addTextureStats(U8 bump, const LLUUID& base_image_id, F32 virtual_size)
{
bump &= TEM_BUMP_MASK;
LLViewerImage* bump_image = gStandardBumpmapList[bump].mImage;
LLViewerFetchedTexture* bump_image = gStandardBumpmapList[bump].mImage;
if( bump_image )
{
bump_image->addTextureStats(virtual_size);
@ -826,11 +827,11 @@ void LLBumpImageList::updateImages()
for (bump_image_map_t::iterator iter = mBrightnessEntries.begin(); iter != mBrightnessEntries.end(); )
{
bump_image_map_t::iterator curiter = iter++;
LLImageGL* image = curiter->second;
LLViewerTexture* image = curiter->second;
if( image )
{
BOOL destroy = TRUE;
if( image->getHasGLTexture())
if( image->hasValidGLTexture())
{
if( image->getBoundRecently() )
{
@ -853,11 +854,11 @@ void LLBumpImageList::updateImages()
for (bump_image_map_t::iterator iter = mDarknessEntries.begin(); iter != mDarknessEntries.end(); )
{
bump_image_map_t::iterator curiter = iter++;
LLImageGL* image = curiter->second;
LLViewerTexture* image = curiter->second;
if( image )
{
BOOL destroy = TRUE;
if( image->getHasGLTexture())
if( image->hasValidGLTexture())
{
if( image->getBoundRecently() )
{
@ -881,16 +882,16 @@ void LLBumpImageList::updateImages()
// Note: the caller SHOULD NOT keep the pointer that this function returns. It may be updated as more data arrives.
LLImageGL* LLBumpImageList::getBrightnessDarknessImage(LLViewerImage* src_image, U8 bump_code )
LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedTexture* src_image, U8 bump_code )
{
llassert( (bump_code == BE_BRIGHTNESS) || (bump_code == BE_DARKNESS) );
LLImageGL* bump = NULL;
LLViewerTexture* bump = NULL;
const F32 BRIGHTNESS_DARKNESS_PIXEL_AREA_THRESHOLD = 1000;
if( src_image->mMaxVirtualSize > BRIGHTNESS_DARKNESS_PIXEL_AREA_THRESHOLD )
if( src_image->getMaxVirtualSize() > BRIGHTNESS_DARKNESS_PIXEL_AREA_THRESHOLD )
{
bump_image_map_t* entries_list = NULL;
void (*callback_func)( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) = NULL;
void (*callback_func)( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) = NULL;
switch( bump_code )
{
@ -917,14 +918,8 @@ LLImageGL* LLBumpImageList::getBrightnessDarknessImage(LLViewerImage* src_image,
LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,1);
raw->clear(0x77, 0x77, 0x77, 0xFF);
//------------------------------
bump = new LLImageGL( raw, TRUE);
//immediately assign bump to a global smart pointer in case some local smart pointer
//accidently releases it.
(*entries_list)[src_image->getID()] = bump;
//------------------------------
bump->setExplicitFormat(GL_ALPHA8, GL_ALPHA);
(*entries_list)[src_image->getID()] = LLViewerTextureManager::getLocalTexture( raw.get(), TRUE);
(*entries_list)[src_image->getID()]->setExplicitFormat(GL_ALPHA8, GL_ALPHA);
// Note: this may create an LLImageGL immediately
src_image->setLoadedCallback( callback_func, 0, TRUE, FALSE, new LLUUID(src_image->getID()) );
@ -940,7 +935,7 @@ LLImageGL* LLBumpImageList::getBrightnessDarknessImage(LLViewerImage* src_image,
// static
void LLBumpImageList::onSourceBrightnessLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
void LLBumpImageList::onSourceBrightnessLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
{
LLUUID* source_asset_id = (LLUUID*)userdata;
LLBumpImageList::onSourceLoaded( success, src_vi, src, *source_asset_id, BE_BRIGHTNESS );
@ -951,7 +946,7 @@ void LLBumpImageList::onSourceBrightnessLoaded( BOOL success, LLViewerImage *src
}
// static
void LLBumpImageList::onSourceDarknessLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
void LLBumpImageList::onSourceDarknessLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
{
LLUUID* source_asset_id = (LLUUID*)userdata;
LLBumpImageList::onSourceLoaded( success, src_vi, src, *source_asset_id, BE_DARKNESS );
@ -961,7 +956,7 @@ void LLBumpImageList::onSourceDarknessLoaded( BOOL success, LLViewerImage *src_v
}
}
void LLBumpImageList::onSourceStandardLoaded( BOOL success, LLViewerImage* src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
void LLBumpImageList::onSourceStandardLoaded( BOOL success, LLViewerFetchedTexture* src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
{
if (success && LLPipeline::sRenderDeferred)
{
@ -1028,7 +1023,7 @@ void LLBumpImageList::generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nr
}
// static
void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLUUID& source_asset_id, EBumpEffect bump_code )
void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLImageRaw* src, LLUUID& source_asset_id, EBumpEffect bump_code )
{
if( success )
{
@ -1147,7 +1142,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerImage *src_vi, LLIma
//---------------------------------------------------
//immediately assign bump to a global smart pointer in case some local smart pointer
//accidently releases it.
LLPointer<LLImageGL> bump = new LLImageGL( TRUE);
LLPointer<LLViewerTexture> bump = LLViewerTextureManager::getLocalTexture( TRUE);
if (!LLPipeline::sRenderDeferred)
{
@ -1220,7 +1215,7 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
{
if (params.mTexture.notNull())
{
gGL.getTexUnit(diffuse_channel)->bind(params.mTexture.get());
gGL.getTexUnit(diffuse_channel)->bind(params.mTexture) ;
params.mTexture->addTextureStats(params.mVSize);
}
else

View File

@ -41,6 +41,7 @@
class LLImageRaw;
class LLSpatialGroup;
class LLDrawInfo;
class LLViewerFetchedTexture;
class LLDrawPoolBump : public LLRenderPass
{
@ -110,7 +111,7 @@ public:
LLStandardBumpmap( const std::string& label ) : mLabel(label) {}
std::string mLabel;
LLPointer<LLViewerImage> mImage;
LLPointer<LLViewerFetchedTexture> mImage;
static U32 sStandardBumpmapCount; // Number of valid values in gStandardBumpmapList[]
@ -140,21 +141,20 @@ public:
void updateImages();
LLImageGL* getBrightnessDarknessImage(LLViewerImage* src_image, U8 bump_code);
// LLImageGL* getTestImage();
LLViewerTexture* getBrightnessDarknessImage(LLViewerFetchedTexture* src_image, U8 bump_code);
void addTextureStats(U8 bump, const LLUUID& base_image_id, F32 virtual_size);
static void onSourceBrightnessLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void onSourceDarknessLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void onSourceStandardLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void onSourceBrightnessLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void onSourceDarknessLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void onSourceStandardLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
static void generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nrm_image);
private:
static void onSourceLoaded( BOOL success, LLViewerImage *src_vi, LLImageRaw* src, LLUUID& source_asset_id, EBumpEffect bump );
static void onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLImageRaw* src, LLUUID& source_asset_id, EBumpEffect bump );
private:
typedef std::map<LLUUID, LLPointer<LLImageGL> > bump_image_map_t;
typedef std::map<LLUUID, LLPointer<LLViewerTexture> > bump_image_map_t;
bump_image_map_t mBrightnessEntries;
bump_image_map_t mDarknessEntries;
};

View File

@ -41,7 +41,7 @@
#include "llface.h"
#include "llsky.h"
#include "llviewercamera.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewerregion.h"
#include "llvosky.h"
#include "llworld.h" // To get water height

View File

@ -49,7 +49,7 @@
#include "llviewerparceloverlay.h"
#include "llvosurfacepatch.h"
#include "llviewercamera.h"
#include "llviewerimagelist.h" // To get alpha gradients
#include "llviewertexturelist.h" // To get alpha gradients
#include "llworld.h"
#include "pipeline.h"
#include "llviewershadermgr.h"
@ -62,28 +62,32 @@ S32 LLDrawPoolTerrain::sDetailMode = 1;
F32 LLDrawPoolTerrain::sDetailScale = DETAIL_SCALE;
static LLGLSLShader* sShader = NULL;
LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerImage *texturep) :
LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
LLFacePool(POOL_TERRAIN),
mTexturep(texturep)
{
// Hack!
sDetailScale = 1.f/gSavedSettings.getF32("RenderTerrainScale");
sDetailMode = gSavedSettings.getS32("RenderTerrainDetail");
mAlphaRampImagep = gImageList.getImageFromFile("alpha_gradient.tga",
TRUE, TRUE, GL_ALPHA8, GL_ALPHA,
mAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga",
TRUE, TRUE,
LLViewerTexture::FETCHED_TEXTURE,
GL_ALPHA8, GL_ALPHA,
LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb"));
gGL.getTexUnit(0)->bind(mAlphaRampImagep.get());
gGL.getTexUnit(0)->bind(mAlphaRampImagep);
mAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
m2DAlphaRampImagep = gImageList.getImageFromFile("alpha_gradient_2d.j2c",
TRUE, TRUE, GL_ALPHA8, GL_ALPHA,
m2DAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c",
TRUE, TRUE,
LLViewerTexture::FETCHED_TEXTURE,
GL_ALPHA8, GL_ALPHA,
LLUUID("38b86f85-2575-52a9-a531-23108d8da837"));
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep);
m2DAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
mTexturep->setBoostLevel(LLViewerImage::BOOST_TERRAIN);
mTexturep->setBoostLevel(LLViewerTexture::BOOST_TERRAIN);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
}
@ -170,7 +174,7 @@ void LLDrawPoolTerrain::render(S32 pass)
LLVLComposition *compp = regionp->getComposition();
for (S32 i = 0; i < 4; i++)
{
compp->mDetailTextures[i]->setBoostLevel(LLViewerImage::BOOST_TERRAIN);
compp->mDetailTextures[i]->setBoostLevel(LLViewerTexture::BOOST_TERRAIN);
compp->mDetailTextures[i]->addTextureStats(1024.f*1024.f); // assume large pixel area
}
@ -289,10 +293,10 @@ void LLDrawPoolTerrain::renderFullShader()
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
LLViewerImage *detail_texture0p = compp->mDetailTextures[0];
LLViewerImage *detail_texture1p = compp->mDetailTextures[1];
LLViewerImage *detail_texture2p = compp->mDetailTextures[2];
LLViewerImage *detail_texture3p = compp->mDetailTextures[3];
LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal();
F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale;
@ -363,7 +367,7 @@ void LLDrawPoolTerrain::renderFullShader()
// Alpha Ramp
//
S32 alpha_ramp = sShader->enableTexture(LLViewerShaderMgr::TERRAIN_ALPHARAMP);
gGL.getTexUnit(alpha_ramp)->bind(m2DAlphaRampImagep.get());
gGL.getTexUnit(alpha_ramp)->bind(m2DAlphaRampImagep);
// GL_BLEND disabled by default
drawLoop();
@ -429,10 +433,10 @@ void LLDrawPoolTerrain::renderFull4TU()
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
LLViewerImage *detail_texture0p = compp->mDetailTextures[0];
LLViewerImage *detail_texture1p = compp->mDetailTextures[1];
LLViewerImage *detail_texture2p = compp->mDetailTextures[2];
LLViewerImage *detail_texture3p = compp->mDetailTextures[3];
LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal();
F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale;
@ -527,7 +531,7 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 1: Generate alpha ramp for detail2/detail3 transition
//
gGL.getTexUnit(1)->bind(m2DAlphaRampImagep.get());
gGL.getTexUnit(1)->bind(m2DAlphaRampImagep);
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(1)->activate();
@ -559,7 +563,7 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 3: Generate alpha ramp for detail1/detail2 transition
//
gGL.getTexUnit(3)->bind(m2DAlphaRampImagep.get());
gGL.getTexUnit(3)->bind(m2DAlphaRampImagep);
gGL.getTexUnit(3)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(3)->activate();
@ -630,10 +634,10 @@ void LLDrawPoolTerrain::renderFull2TU()
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
LLViewerImage *detail_texture0p = compp->mDetailTextures[0];
LLViewerImage *detail_texture1p = compp->mDetailTextures[1];
LLViewerImage *detail_texture2p = compp->mDetailTextures[2];
LLViewerImage *detail_texture3p = compp->mDetailTextures[3];
LLViewerTexture *detail_texture0p = compp->mDetailTextures[0];
LLViewerTexture *detail_texture1p = compp->mDetailTextures[1];
LLViewerTexture *detail_texture2p = compp->mDetailTextures[2];
LLViewerTexture *detail_texture3p = compp->mDetailTextures[3];
LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal();
F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale;
@ -671,7 +675,7 @@ void LLDrawPoolTerrain::renderFull2TU()
//
// Stage 0: Generate alpha ramp for detail0/detail1 transition
//
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
@ -709,7 +713,7 @@ void LLDrawPoolTerrain::renderFull2TU()
//
// Stage 0: Generate alpha ramp for detail1/detail2 transition
//
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep);
// Set the texture matrix
glMatrixMode(GL_TEXTURE);
@ -749,7 +753,7 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 0: Generate alpha ramp for detail2/detail3 transition
//
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
gGL.getTexUnit(0)->bind(m2DAlphaRampImagep);
// Set the texture matrix
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
@ -822,7 +826,7 @@ void LLDrawPoolTerrain::renderSimple()
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(0)->bind(mTexturep.get());
gGL.getTexUnit(0)->bind(mTexturep);
LLVector3 origin_agent = mDrawFace[0]->getDrawable()->getVObj()->getRegion()->getOriginAgent();
F32 tscale = 1.f/256.f;
@ -872,7 +876,7 @@ void LLDrawPoolTerrain::renderOwnership()
LLSurface *surfacep = surface_patchp->getSurface();
LLViewerRegion *regionp = surfacep->getRegion();
LLViewerParcelOverlay *overlayp = regionp->getParcelOverlay();
LLImageGL *texturep = overlayp->getTexture();
LLViewerTexture *texturep = overlayp->getTexture();
gGL.getTexUnit(0)->bind(texturep);
@ -920,9 +924,10 @@ void LLDrawPoolTerrain::renderForSelect()
}
}
void LLDrawPoolTerrain::dirtyTextures(const std::set<LLViewerImage*>& textures)
void LLDrawPoolTerrain::dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures)
{
if (textures.find(mTexturep) != textures.end())
LLViewerFetchedTexture* tex = LLViewerTextureManager::staticCastToFetchedTexture(mTexturep) ;
if (tex && textures.find(tex) != textures.end())
{
for (std::vector<LLFace*>::iterator iter = mReferences.begin();
iter != mReferences.end(); iter++)
@ -933,12 +938,12 @@ void LLDrawPoolTerrain::dirtyTextures(const std::set<LLViewerImage*>& textures)
}
}
LLViewerImage *LLDrawPoolTerrain::getTexture()
LLViewerTexture *LLDrawPoolTerrain::getTexture()
{
return mTexturep;
}
LLViewerImage *LLDrawPoolTerrain::getDebugTexture()
LLViewerTexture *LLDrawPoolTerrain::getDebugTexture()
{
return mTexturep;
}

View File

@ -37,7 +37,7 @@
class LLDrawPoolTerrain : public LLFacePool
{
LLPointer<LLViewerImage> mTexturep;
LLPointer<LLViewerTexture> mTexturep;
public:
enum
{
@ -53,7 +53,7 @@ public:
virtual U32 getVertexDataMask();
static S32 getDetailMode();
LLDrawPoolTerrain(LLViewerImage *texturep);
LLDrawPoolTerrain(LLViewerTexture *texturep);
virtual ~LLDrawPoolTerrain();
/*virtual*/ LLDrawPool *instancePool();
@ -73,14 +73,14 @@ public:
/*virtual*/ void beginRenderPass( S32 pass );
/*virtual*/ void endRenderPass( S32 pass );
/*virtual*/ void renderForSelect();
/*virtual*/ void dirtyTextures(const std::set<LLViewerImage*>& textures);
/*virtual*/ LLViewerImage *getTexture();
/*virtual*/ LLViewerImage *getDebugTexture();
/*virtual*/ void dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures);
/*virtual*/ LLViewerTexture *getTexture();
/*virtual*/ LLViewerTexture *getDebugTexture();
/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
LLPointer<LLViewerImage> mAlphaRampImagep;
LLPointer<LLViewerImage> m2DAlphaRampImagep;
LLPointer<LLViewerImage> mAlphaNoiseImagep;
LLPointer<LLViewerTexture> mAlphaRampImagep;
LLPointer<LLViewerTexture> m2DAlphaRampImagep;
LLPointer<LLViewerTexture> mAlphaNoiseImagep;
static S32 sDetailMode;
static F32 sDetailScale; // meters per texture

View File

@ -47,11 +47,11 @@
S32 LLDrawPoolTree::sDiffTex = 0;
static LLGLSLShader* shader = NULL;
LLDrawPoolTree::LLDrawPoolTree(LLViewerImage *texturep) :
LLDrawPoolTree::LLDrawPoolTree(LLViewerTexture *texturep) :
LLFacePool(POOL_TREE),
mTexturep(texturep)
{
gGL.getTexUnit(0)->bind(mTexturep.get());
gGL.getTexUnit(0)->bind(mTexturep);
mTexturep->setAddressMode(LLTexUnit::TAM_WRAP);
}
@ -246,7 +246,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
LLGLState normalize(GL_NORMALIZE, TRUE);
// Bind the texture for this tree.
gGL.getTexUnit(sDiffTex)->bind(mTexturep.get());
gGL.getTexUnit(sDiffTex)->bind(mTexturep);
U32 indices_drawn = 0;
@ -376,12 +376,12 @@ BOOL LLDrawPoolTree::verify() const
return TRUE;
}
LLViewerImage *LLDrawPoolTree::getTexture()
LLViewerTexture *LLDrawPoolTree::getTexture()
{
return mTexturep;
}
LLViewerImage *LLDrawPoolTree::getDebugTexture()
LLViewerTexture *LLDrawPoolTree::getDebugTexture()
{
return mTexturep;
}

View File

@ -37,7 +37,7 @@
class LLDrawPoolTree : public LLFacePool
{
LLPointer<LLViewerImage> mTexturep;
LLPointer<LLViewerTexture> mTexturep;
public:
enum
{
@ -48,7 +48,7 @@ public:
virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
LLDrawPoolTree(LLViewerImage *texturep);
LLDrawPoolTree(LLViewerTexture *texturep);
/*virtual*/ LLDrawPool *instancePool();
@ -70,8 +70,8 @@ public:
/*virtual*/ S32 getNumPasses() { return 1; }
/*virtual*/ void renderForSelect();
/*virtual*/ BOOL verify() const;
/*virtual*/ LLViewerImage *getTexture();
/*virtual*/ LLViewerImage *getDebugTexture();
/*virtual*/ LLViewerTexture *getTexture();
/*virtual*/ LLViewerTexture *getDebugTexture();
/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
static S32 sDiffTex;

View File

@ -45,7 +45,7 @@
#include "lldrawable.h"
#include "llface.h"
#include "llsky.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewerregion.h"
#include "llvosky.h"
#include "llvowater.h"
@ -69,17 +69,17 @@ LLVector3 LLDrawPoolWater::sLightDir;
LLDrawPoolWater::LLDrawPoolWater() :
LLFacePool(POOL_WATER)
{
mHBTex[0] = gImageList.getImage(gSunTextureID, TRUE, TRUE);
gGL.getTexUnit(0)->bind(mHBTex[0].get());
mHBTex[0] = LLViewerTextureManager::getFetchedTexture(gSunTextureID, TRUE, TRUE);
gGL.getTexUnit(0)->bind(mHBTex[0]) ;
mHBTex[0]->setAddressMode(LLTexUnit::TAM_CLAMP);
mHBTex[1] = gImageList.getImage(gMoonTextureID, TRUE, TRUE);
gGL.getTexUnit(0)->bind(mHBTex[1].get());
mHBTex[1] = LLViewerTextureManager::getFetchedTexture(gMoonTextureID, TRUE, TRUE);
gGL.getTexUnit(0)->bind(mHBTex[1]);
mHBTex[1]->setAddressMode(LLTexUnit::TAM_CLAMP);
mWaterImagep = gImageList.getImage(WATER_TEST);
mWaterImagep = LLViewerTextureManager::getFetchedTexture(WATER_TEST);
mWaterImagep->setNoDelete() ;
mWaterNormp = gImageList.getImage(DEFAULT_WATER_NORMAL);
mWaterNormp = LLViewerTextureManager::getFetchedTexture(DEFAULT_WATER_NORMAL);
mWaterNormp->setNoDelete() ;
restoreGL();
@ -184,7 +184,7 @@ void LLDrawPoolWater::render(S32 pass)
mWaterImagep->addTextureStats(1024.f*1024.f);
gGL.getTexUnit(1)->activate();
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(1)->bind(mWaterImagep.get());
gGL.getTexUnit(1)->bind(mWaterImagep) ;
LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis();
F32 up_dot = camera_up * LLVector3::z_axis;
@ -329,7 +329,7 @@ void LLDrawPoolWater::renderReflection(LLFace* face)
LLGLSNoFog noFog;
gGL.getTexUnit(0)->bind(mHBTex[dr].get());
gGL.getTexUnit(0)->bind(mHBTex[dr]);
LLOverrideFaceColor override(this, face->getFaceColor().mV);
face->renderIndexed();
@ -419,11 +419,11 @@ void LLDrawPoolWater::shade()
// change mWaterNormp if needed
if (mWaterNormp->getID() != param_mgr->getNormalMapID())
{
mWaterNormp = gImageList.getImage(param_mgr->getNormalMapID());
mWaterNormp = LLViewerTextureManager::getFetchedTexture(param_mgr->getNormalMapID());
}
mWaterNormp->addTextureStats(1024.f*1024.f);
gGL.getTexUnit(bumpTex)->bind(mWaterNormp.get());
gGL.getTexUnit(bumpTex)->bind(mWaterNormp) ;
if (gSavedSettings.getBOOL("RenderWaterMipNormal"))
{
mWaterNormp->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);
@ -587,20 +587,9 @@ void LLDrawPoolWater::renderForSelect()
return;
}
void LLDrawPoolWater::renderFaceSelected(LLFace *facep,
LLImageGL *image,
const LLColor4 &color,
const S32 index_offset, const S32 index_count)
LLViewerTexture *LLDrawPoolWater::getDebugTexture()
{
// Can't select water
return;
}
LLViewerImage *LLDrawPoolWater::getDebugTexture()
{
return LLViewerImage::sSmokeImagep;
return LLViewerFetchedTexture::sSmokeImagep;
}
LLColor3 LLDrawPoolWater::getDebugColor() const

View File

@ -43,9 +43,9 @@ class LLWaterSurface;
class LLDrawPoolWater: public LLFacePool
{
protected:
LLPointer<LLViewerImage> mHBTex[2];
LLPointer<LLViewerImage> mWaterImagep;
LLPointer<LLViewerImage> mWaterNormp;
LLPointer<LLViewerTexture> mHBTex[2];
LLPointer<LLViewerTexture> mWaterImagep;
LLPointer<LLViewerTexture> mWaterNormp;
const LLWaterSurface *mWaterSurface;
public:
@ -78,12 +78,10 @@ public:
/*virtual*/ S32 getNumPasses();
/*virtual*/ void render(S32 pass = 0);
/*virtual*/ void renderFaceSelected(LLFace *facep, LLImageGL *image, const LLColor4 &color,
const S32 index_offset = 0, const S32 index_count = 0);
/*virtual*/ void prerender();
/*virtual*/ void renderForSelect();
/*virtual*/ LLViewerImage *getDebugTexture();
/*virtual*/ LLViewerTexture *getDebugTexture();
/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
void renderReflection(LLFace* face);

View File

@ -47,7 +47,7 @@
#include "llface.h"
#include "llrender.h"
LLPointer<LLImageGL> LLDrawPoolWLSky::sCloudNoiseTexture = NULL;
LLPointer<LLViewerTexture> LLDrawPoolWLSky::sCloudNoiseTexture = NULL;
LLPointer<LLImageRaw> LLDrawPoolWLSky::sCloudNoiseRawImage = NULL;
@ -71,7 +71,7 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
cloudNoiseFile->decode(sCloudNoiseRawImage, 0.0f);
LLImageGL::create(sCloudNoiseTexture, sCloudNoiseRawImage, TRUE);
sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
LLWLParamManager::instance()->propagateParameters();
}
@ -83,7 +83,7 @@ LLDrawPoolWLSky::~LLDrawPoolWLSky()
sCloudNoiseRawImage = NULL;
}
LLViewerImage *LLDrawPoolWLSky::getDebugTexture()
LLViewerTexture *LLDrawPoolWLSky::getDebugTexture()
{
return NULL;
}
@ -224,7 +224,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
LLFace * face = gSky.mVOSkyp->mFace[LLVOSky::FACE_SUN];
if (gSky.mVOSkyp->getSun().getDraw() && face->getGeomCount())
{
LLImageGL * tex = face->getTexture();
LLViewerTexture * tex = face->getTexture();
gGL.getTexUnit(0)->bind(tex);
LLColor4 color(gSky.mVOSkyp->getSun().getInterpColor());
LLFacePool::LLOverrideFaceColor color_override(this, color);
@ -239,8 +239,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
// *NOTE: even though we already bound this texture above for the
// stars register combiners, we bind again here for defensive reasons,
// since LLImageGL::bind detects that it's a noop, and optimizes it out.
LLImageGL * tex = face->getTexture();
gGL.getTexUnit(0)->bind(tex);
gGL.getTexUnit(0)->bind(face->getTexture());
LLColor4 color(gSky.mVOSkyp->getMoon().getInterpColor());
F32 a = gSky.mVOSkyp->getMoon().getDirection().mV[2];
if (a > 0.f)
@ -280,9 +279,8 @@ void LLDrawPoolWLSky::render(S32 pass)
// *NOTE: have to bind a texture here since register combiners blending in
// renderStars() requires something to be bound and we might as well only
// bind the moon's texture once.
LLImageGL * tex = gSky.mVOSkyp->mFace[LLVOSky::FACE_MOON]->getTexture();
gGL.getTexUnit(0)->bind(tex);
// bind the moon's texture once.
gGL.getTexUnit(0)->bind(gSky.mVOSkyp->mFace[LLVOSky::FACE_MOON]->getTexture());
renderHeavenlyBodies();
@ -306,7 +304,7 @@ LLDrawPoolWLSky *LLDrawPoolWLSky::instancePool()
return new LLDrawPoolWLSky();
}
LLViewerImage* LLDrawPoolWLSky::getTexture()
LLViewerTexture* LLDrawPoolWLSky::getTexture()
{
return NULL;
}
@ -324,5 +322,5 @@ void LLDrawPoolWLSky::cleanupGL()
//static
void LLDrawPoolWLSky::restoreGL()
{
LLImageGL::create(sCloudNoiseTexture, sCloudNoiseRawImage, TRUE);
sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
}

View File

@ -55,7 +55,7 @@ public:
/*virtual*/ void endPostDeferredPass(S32 pass) { endRenderPass(pass); }
/*virtual*/ void renderPostDeferred(S32 pass) { render(pass); }
/*virtual*/ LLViewerImage *getDebugTexture();
/*virtual*/ LLViewerTexture *getDebugTexture();
/*virtual*/ void beginRenderPass( S32 pass );
/*virtual*/ void endRenderPass( S32 pass );
/*virtual*/ S32 getNumPasses() { return 1; }
@ -65,11 +65,11 @@ public:
/*virtual*/ BOOL verify() const { return TRUE; } // Verify that all data in the draw pool is correct!
/*virtual*/ S32 getVertexShaderLevel() const { return mVertexShaderLevel; }
//static LLDrawPool* createPool(const U32 type, LLViewerImage *tex0 = NULL);
//static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL);
// Create an empty new instance of the pool.
/*virtual*/ LLDrawPoolWLSky *instancePool(); ///< covariant override
/*virtual*/ LLViewerImage* getTexture();
/*virtual*/ LLViewerTexture* getTexture();
/*virtual*/ BOOL isFacePool() { return FALSE; }
/*virtual*/ void resetDrawOrders();
@ -83,7 +83,7 @@ private:
void renderHeavenlyBodies();
private:
static LLPointer<LLImageGL> sCloudNoiseTexture;
static LLPointer<LLViewerTexture> sCloudNoiseTexture;
static LLPointer<LLImageRaw> sCloudNoiseRawImage;
};

View File

@ -1,6 +1,6 @@
/**
* @file lldynamictexture.cpp
* @brief Implementation of LLDynamicTexture class
* @brief Implementation of LLViewerDynamicTexture class
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
@ -42,24 +42,20 @@
#include "llviewerwindow.h"
#include "llviewercamera.h"
#include "llviewercontrol.h"
#include "llviewerimage.h"
#include "llviewertexture.h"
#include "llvertexbuffer.h"
#include "llviewerdisplay.h"
#include "llrender.h"
// static
LLDynamicTexture::instance_list_t LLDynamicTexture::sInstances[ LLDynamicTexture::ORDER_COUNT ];
S32 LLDynamicTexture::sNumRenders = 0;
LLViewerDynamicTexture::instance_list_t LLViewerDynamicTexture::sInstances[ LLViewerDynamicTexture::ORDER_COUNT ];
S32 LLViewerDynamicTexture::sNumRenders = 0;
//-----------------------------------------------------------------------------
// LLDynamicTexture()
// LLViewerDynamicTexture()
//-----------------------------------------------------------------------------
LLDynamicTexture::LLDynamicTexture(S32 width, S32 height, S32 components, EOrder order, BOOL clamp) :
mWidth(width),
mHeight(height),
mComponents(components),
mTexture(NULL),
mLastBindTime(0),
LLViewerDynamicTexture::LLViewerDynamicTexture(S32 width, S32 height, S32 components, EOrder order, BOOL clamp) :
LLViewerTexture(width, height, components, FALSE),
mClamp(clamp)
{
llassert((1 <= components) && (components <= 4));
@ -67,64 +63,56 @@ LLDynamicTexture::LLDynamicTexture(S32 width, S32 height, S32 components, EOrder
generateGLTexture();
llassert( 0 <= order && order < ORDER_COUNT );
LLDynamicTexture::sInstances[ order ].insert(this);
LLViewerDynamicTexture::sInstances[ order ].insert(this);
}
//-----------------------------------------------------------------------------
// LLDynamicTexture()
// LLViewerDynamicTexture()
//-----------------------------------------------------------------------------
LLDynamicTexture::~LLDynamicTexture()
LLViewerDynamicTexture::~LLViewerDynamicTexture()
{
releaseGLTexture();
for( S32 order = 0; order < ORDER_COUNT; order++ )
{
LLDynamicTexture::sInstances[order].erase(this); // will fail in all but one case.
LLViewerDynamicTexture::sInstances[order].erase(this); // will fail in all but one case.
}
}
//-----------------------------------------------------------------------------
// releaseGLTexture()
//-----------------------------------------------------------------------------
void LLDynamicTexture::releaseGLTexture()
//virtual
S8 LLViewerDynamicTexture::getType() const
{
if (mTexture.notNull())
{
// llinfos << "RELEASING " << (mWidth*mHeight*mComponents)/1024 << "K" << llendl;
mTexture = NULL;
}
return LLViewerTexture::DYNAMIC_TEXTURE ;
}
//-----------------------------------------------------------------------------
// generateGLTexture()
//-----------------------------------------------------------------------------
void LLDynamicTexture::generateGLTexture()
void LLViewerDynamicTexture::generateGLTexture()
{
LLViewerTexture::generateGLTexture() ;
generateGLTexture(-1, 0, 0, FALSE);
}
void LLDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes)
void LLViewerDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes)
{
if (mComponents < 1 || mComponents > 4)
{
llerrs << "Bad number of components in dynamic texture: " << mComponents << llendl;
}
releaseGLTexture();
LLPointer<LLImageRaw> raw_image = new LLImageRaw(mWidth, mHeight, mComponents);
mTexture = new LLViewerImage(mWidth, mHeight, mComponents, FALSE);
LLPointer<LLImageRaw> raw_image = new LLImageRaw(mFullWidth, mFullHeight, mComponents);
if (internal_format >= 0)
{
mTexture->setExplicitFormat(internal_format, primary_format, type_format, swap_bytes);
setExplicitFormat(internal_format, primary_format, type_format, swap_bytes);
}
// llinfos << "ALLOCATING " << (mWidth*mHeight*mComponents)/1024 << "K" << llendl;
mTexture->createGLTexture(0, raw_image);
mTexture->setAddressMode((mClamp) ? LLTexUnit::TAM_CLAMP : LLTexUnit::TAM_WRAP);
mTexture->setGLTextureCreated(false);
createGLTexture(0, raw_image);
setAddressMode((mClamp) ? LLTexUnit::TAM_CLAMP : LLTexUnit::TAM_WRAP);
mGLTexturep->setGLTextureCreated(false);
}
//-----------------------------------------------------------------------------
// render()
//-----------------------------------------------------------------------------
BOOL LLDynamicTexture::render()
BOOL LLViewerDynamicTexture::render()
{
return FALSE;
}
@ -132,13 +120,13 @@ BOOL LLDynamicTexture::render()
//-----------------------------------------------------------------------------
// preRender()
//-----------------------------------------------------------------------------
void LLDynamicTexture::preRender(BOOL clear_depth)
void LLViewerDynamicTexture::preRender(BOOL clear_depth)
{
{
// force rendering to on-screen portion of frame buffer
LLCoordScreen window_pos;
gViewerWindow->getWindow()->getPosition( &window_pos );
mOrigin.set(0, gViewerWindow->getWindowDisplayHeight() - mHeight); // top left corner
mOrigin.set(0, gViewerWindow->getWindowDisplayHeight() - mFullHeight); // top left corner
if (window_pos.mX < 0)
{
@ -159,7 +147,7 @@ void LLDynamicTexture::preRender(BOOL clear_depth)
mCamera.setView(LLViewerCamera::getInstance()->getView());
mCamera.setNear(LLViewerCamera::getInstance()->getNear());
glViewport(mOrigin.mX, mOrigin.mY, mWidth, mHeight);
glViewport(mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight);
if (clear_depth)
{
glClear(GL_DEPTH_BUFFER_BIT);
@ -169,12 +157,16 @@ void LLDynamicTexture::preRender(BOOL clear_depth)
//-----------------------------------------------------------------------------
// postRender()
//-----------------------------------------------------------------------------
void LLDynamicTexture::postRender(BOOL success)
void LLViewerDynamicTexture::postRender(BOOL success)
{
{
if (success)
{
success = mTexture->setSubImageFromFrameBuffer(0, 0, mOrigin.mX, mOrigin.mY, mWidth, mHeight);
if(mGLTexturep.isNull())
{
generateGLTexture() ;
}
success = mGLTexturep->setSubImageFromFrameBuffer(0, 0, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight);
}
}
@ -194,7 +186,7 @@ void LLDynamicTexture::postRender(BOOL success)
// updateDynamicTextures()
// Calls update on each dynamic texture. Calls each group in order: "first," then "middle," then "last."
//-----------------------------------------------------------------------------
BOOL LLDynamicTexture::updateAllInstances()
BOOL LLViewerDynamicTexture::updateAllInstances()
{
sNumRenders = 0;
if (gGLManager.mIsDisabled)
@ -206,10 +198,10 @@ BOOL LLDynamicTexture::updateAllInstances()
BOOL ret = FALSE ;
for( S32 order = 0; order < ORDER_COUNT; order++ )
{
for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin();
iter != LLDynamicTexture::sInstances[order].end(); ++iter)
for (instance_list_t::iterator iter = LLViewerDynamicTexture::sInstances[order].begin();
iter != LLViewerDynamicTexture::sInstances[order].end(); ++iter)
{
LLDynamicTexture *dynamicTexture = *iter;
LLViewerDynamicTexture *dynamicTexture = *iter;
if (dynamicTexture->needsRender())
{
glClear(GL_DEPTH_BUFFER_BIT);
@ -236,30 +228,18 @@ BOOL LLDynamicTexture::updateAllInstances()
return ret;
}
//virtual
void LLDynamicTexture::restoreGLTexture()
{
generateGLTexture() ;
}
//virtual
void LLDynamicTexture::destroyGLTexture()
{
releaseGLTexture() ;
}
//-----------------------------------------------------------------------------
// static
// destroyGL()
//-----------------------------------------------------------------------------
void LLDynamicTexture::destroyGL()
void LLViewerDynamicTexture::destroyGL()
{
for( S32 order = 0; order < ORDER_COUNT; order++ )
{
for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin();
iter != LLDynamicTexture::sInstances[order].end(); ++iter)
for (instance_list_t::iterator iter = LLViewerDynamicTexture::sInstances[order].begin();
iter != LLViewerDynamicTexture::sInstances[order].end(); ++iter)
{
LLDynamicTexture *dynamicTexture = *iter;
LLViewerDynamicTexture *dynamicTexture = *iter;
dynamicTexture->destroyGLTexture() ;
}
}
@ -269,7 +249,7 @@ void LLDynamicTexture::destroyGL()
// static
// restoreGL()
//-----------------------------------------------------------------------------
void LLDynamicTexture::restoreGL()
void LLViewerDynamicTexture::restoreGL()
{
if (gGLManager.mIsDisabled)
{
@ -278,10 +258,10 @@ void LLDynamicTexture::restoreGL()
for( S32 order = 0; order < ORDER_COUNT; order++ )
{
for (instance_list_t::iterator iter = LLDynamicTexture::sInstances[order].begin();
iter != LLDynamicTexture::sInstances[order].end(); ++iter)
for (instance_list_t::iterator iter = LLViewerDynamicTexture::sInstances[order].begin();
iter != LLViewerDynamicTexture::sInstances[order].end(); ++iter)
{
LLDynamicTexture *dynamicTexture = *iter;
LLViewerDynamicTexture *dynamicTexture = *iter;
dynamicTexture->restoreGLTexture() ;
}
}

View File

@ -1,6 +1,6 @@
/**
* @file lldynamictexture.h
* @brief Implementation of LLDynamicTexture class
* @brief Implementation of LLViewerDynamicTexture class
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
@ -36,59 +36,51 @@
#include "llcamera.h"
#include "llgl.h"
#include "llcoord.h"
#include "llimagegl.h"
#include "llviewertexture.h"
class LLDynamicTexture
class LLViewerDynamicTexture : public LLViewerTexture
{
protected:
/*virtual*/ ~LLViewerDynamicTexture();
public:
enum EOrder { ORDER_FIRST = 0, ORDER_MIDDLE = 1, ORDER_LAST = 2, ORDER_RESET = 3, ORDER_COUNT = 4 };
LLDynamicTexture(S32 width,
LLViewerDynamicTexture(S32 width,
S32 height,
S32 components, // = 4,
EOrder order, // = ORDER_MIDDLE,
BOOL clamp);
virtual ~LLDynamicTexture();
/*virtual*/ S8 getType() const ;
S32 getOriginX() { return mOrigin.mX; }
S32 getOriginY() { return mOrigin.mY; }
S32 getWidth() { return mWidth; }
S32 getHeight() { return mHeight; }
S32 getComponents() { return mComponents; }
S32 getSize() { return mWidth * mHeight * mComponents; }
S32 getSize() { return mFullWidth * mFullHeight * mComponents; }
virtual BOOL needsRender() { return TRUE; }
virtual void preRender(BOOL clear_depth = TRUE);
virtual BOOL render();
virtual void postRender(BOOL success);
virtual void restoreGLTexture() ;
virtual void destroyGLTexture() ;
LLImageGL* getTexture(void) const { return mTexture; }
virtual void restoreGLTexture() {}
virtual void destroyGLTexture() {}
static BOOL updateAllInstances();
static void destroyGL();
static void restoreGL();
static void destroyGL() ;
static void restoreGL() ;
protected:
void releaseGLTexture();
void generateGLTexture();
void generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes = FALSE);
protected:
S32 mWidth;
S32 mHeight;
S32 mComponents;
LLPointer<LLImageGL> mTexture;
F32 mLastBindTime;
BOOL mClamp;
LLCoordGL mOrigin;
LLCamera mCamera;
typedef std::set<LLDynamicTexture*> instance_list_t;
static instance_list_t sInstances[ LLDynamicTexture::ORDER_COUNT ];
typedef std::set<LLViewerDynamicTexture*> instance_list_t;
static instance_list_t sInstances[ LLViewerDynamicTexture::ORDER_COUNT ];
static S32 sNumRenders;
};

View File

@ -47,7 +47,7 @@
#include "lllightconstants.h"
#include "llsky.h"
#include "llviewercamera.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llvosky.h"
#include "llvovolume.h"
#include "pipeline.h"
@ -179,6 +179,10 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp)
void LLFace::destroy()
{
if(mTexture.notNull())
{
mTexture->removeFace(this) ;
}
if (mDrawPoolp)
{
mDrawPoolp->removeFace(this);
@ -217,7 +221,7 @@ void LLFace::setWorldMatrix(const LLMatrix4 &mat)
llerrs << "Faces on this drawable are not independently modifiable\n" << llendl;
}
void LLFace::setPool(LLFacePool* new_pool, LLViewerImage *texturep)
void LLFace::setPool(LLFacePool* new_pool, LLViewerTexture *texturep)
{
LLMemType mt1(LLMemType::MTYPE_DRAWABLE);
@ -247,9 +251,28 @@ void LLFace::setPool(LLFacePool* new_pool, LLViewerImage *texturep)
}
mDrawPoolp = new_pool;
}
mTexture = texturep;
setTexture(texturep) ;
}
void LLFace::setTexture(LLViewerTexture* tex)
{
if(mTexture == tex)
{
return ;
}
if(mTexture.notNull())
{
mTexture->removeFace(this) ;
}
mTexture = tex ;
if(mTexture.notNull())
{
mTexture->addFace(this) ;
}
}
void LLFace::setTEOffset(const S32 te_offset)
{
@ -422,7 +445,7 @@ void LLFace::renderForSelect(U32 data_mask)
}
}
void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color)
void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
{
if(mDrawablep.isNull() || mVertexBuffer.isNull() || mDrawablep->getSpatialGroup() == NULL ||
mDrawablep->getSpatialGroup()->isState(LLSpatialGroup::GEOM_DIRTY))
@ -463,8 +486,8 @@ void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color)
/* removed in lieu of raycast uv detection
void LLFace::renderSelectedUV()
{
LLViewerImage* red_blue_imagep = gImageList.getImageFromFile("uv_test1.j2c", TRUE, TRUE);
LLViewerImage* green_imagep = gImageList.getImageFromFile("uv_test2.tga", TRUE, TRUE);
LLViewerTexture* red_blue_imagep = LLViewerTextureManager::getFetchedTextureFromFile("uv_test1.j2c", TRUE, TRUE);
LLViewerTexture* green_imagep = LLViewerTextureManager::getFetchedTextureFromFile("uv_test2.tga", TRUE, TRUE);
LLGLSUVSelect object_select;
@ -998,7 +1021,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
break;
case BE_BRIGHTNESS:
case BE_DARKNESS:
if( mTexture.notNull() && mTexture->getHasGLTexture())
if( mTexture.notNull() && mTexture->hasValidGLTexture())
{
// Offset by approximately one texel
S32 cur_discard = mTexture->getDiscardLevel();
@ -1150,6 +1173,21 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
BOOL LLFace::verify(const U32* indices_array) const
{
BOOL ok = TRUE;
if( mVertexBuffer.isNull() )
{
if( mGeomCount )
{
// This happens before teleports as faces are torn down.
// Stop the crash in DEV-31893 with a null pointer check,
// but present this info.
// To clean up the log, the geometry could be cleared, or the
// face could otherwise be marked for no ::verify.
llinfos << "Face with no vertex buffer and " << mGeomCount << " mGeomCount" << llendl;
}
return TRUE;
}
// First, check whether the face data fits within the pool's range.
if ((mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts())
{

View File

@ -45,15 +45,15 @@
#include "xform.h"
#include "lldarrayptr.h"
#include "llvertexbuffer.h"
#include "llviewerimage.h"
#include "llviewertexture.h"
#include "lldrawable.h"
class LLFacePool;
class LLVolume;
class LLViewerImage;
class LLViewerTexture;
class LLTextureEntry;
class LLVertexProgram;
class LLViewerImage;
class LLViewerTexture;
class LLGeometryManager;
const F32 MIN_ALPHA_SIZE = 1024.f;
@ -86,8 +86,8 @@ public:
U16 getGeomCount() const { return mGeomCount; } // vertex count for this face
U16 getGeomIndex() const { return mGeomIndex; } // index into draw pool
U16 getGeomStart() const { return mGeomIndex; } // index into draw pool
LLViewerImage* getTexture() const { return mTexture; }
void setTexture(LLViewerImage* tex) { mTexture = tex; }
LLViewerTexture* getTexture() const { return mTexture; }
void setTexture(LLViewerTexture* tex) ;
LLXformMatrix* getXform() const { return mXform; }
BOOL hasGeometry() const { return mGeomCount > 0; }
LLVector3 getPositionAgent() const;
@ -119,10 +119,10 @@ public:
LLVertexBuffer* getVertexBuffer() const { return mVertexBuffer; }
void setPoolType(U32 type) { mPoolType = type; }
S32 getTEOffset() { return mTEOffset; }
LLViewerImage* getTexture() { return mTexture; }
LLViewerTexture* getTexture() { return mTexture; }
void setViewerObject(LLViewerObject* object);
void setPool(LLFacePool *pool, LLViewerImage *texturep);
void setPool(LLFacePool *pool, LLViewerTexture *texturep);
void setDrawable(LLDrawable *drawable);
void setTEOffset(const S32 te_offset);
@ -171,7 +171,7 @@ public:
void renderSelectedUV();
void renderForSelect(U32 data_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0);
void renderSelected(LLImageGL *image, const LLColor4 &color);
void renderSelected(LLViewerTexture *image, const LLColor4 &color);
F32 getKey() const { return mDistance; }
@ -222,7 +222,7 @@ protected:
U32 mLastIndicesIndex;
LLXformMatrix* mXform;
LLPointer<LLViewerImage> mTexture;
LLPointer<LLViewerTexture> mTexture;
LLPointer<LLDrawable> mDrawablep;
LLPointer<LLViewerObject> mVObjp;
S32 mTEOffset;

View File

@ -44,7 +44,7 @@
#include "llsdserialize.h"
#include "llappviewer.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llui.h"
#include "llviewercontrol.h"
#include "llstat.h"

View File

@ -47,7 +47,7 @@
#include "llviewercontrol.h"
#include "llworld.h"
#include "lldrawpoolterrain.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llwindow.h"
#include "llui.h"
#include "llcontrol.h"

View File

@ -39,11 +39,10 @@
#include "llglheaders.h"
#include "llrendersphere.h"
#include "llviewerobject.h"
#include "llimagegl.h"
#include "llagent.h"
#include "llsky.h"
#include "llviewercamera.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewercontrol.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"

View File

@ -325,7 +325,6 @@ BOOL LLFloaterAnimPreview::postBuild()
}
else
{
delete mAnimPreview;
mAnimPreview = NULL;
mMotionID.setNull();
childSetValue("bad_animation_text", getString("failed_to_initialize"));
@ -367,7 +366,6 @@ BOOL LLFloaterAnimPreview::postBuild()
//-----------------------------------------------------------------------------
LLFloaterAnimPreview::~LLFloaterAnimPreview()
{
delete mAnimPreview;
mAnimPreview = NULL;
setEnabled(FALSE);
@ -387,7 +385,7 @@ void LLFloaterAnimPreview::draw()
{
gGL.color3f(1.f, 1.f, 1.f);
gGL.getTexUnit(0)->bind(mAnimPreview->getTexture());
gGL.getTexUnit(0)->bind(mAnimPreview);
gGL.begin( LLRender::QUADS );
{
@ -1017,7 +1015,7 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata)
//-----------------------------------------------------------------------------
// LLPreviewAnimation
//-----------------------------------------------------------------------------
LLPreviewAnimation::LLPreviewAnimation(S32 width, S32 height) : LLDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE)
LLPreviewAnimation::LLPreviewAnimation(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE)
{
mNeedsUpdate = TRUE;
mCameraDistance = PREVIEW_CAMERA_DISTANCE;
@ -1063,7 +1061,7 @@ BOOL LLPreviewAnimation::render()
glMatrixMode(GL_PROJECTION);
gGL.pushMatrix();
glLoadIdentity();
glOrtho(0.0f, mWidth, 0.0f, mHeight, -1.0f, 1.0f);
glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
gGL.pushMatrix();
@ -1073,7 +1071,7 @@ BOOL LLPreviewAnimation::render()
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4f(0.15f, 0.2f, 0.3f, 1.f);
gl_rect_2d_simple( mWidth, mHeight );
gl_rect_2d_simple( mFullWidth, mFullHeight );
glMatrixMode(GL_PROJECTION);
gGL.popMatrix();
@ -1095,7 +1093,7 @@ BOOL LLPreviewAnimation::render()
target_pos + (mCameraOffset * av_rot) ); // point of interest
LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom);
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE);
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE);
mCameraRelPos = LLViewerCamera::getInstance()->getOrigin() - avatarp->mHeadp->getWorldPosition();

View File

@ -41,12 +41,14 @@
class LLVOAvatar;
class LLViewerJointMesh;
class LLPreviewAnimation : public LLDynamicTexture
class LLPreviewAnimation : public LLViewerDynamicTexture
{
public:
LLPreviewAnimation(S32 width, S32 height);
protected:
virtual ~LLPreviewAnimation();
public:
LLPreviewAnimation(S32 width, S32 height);
BOOL render();
void requestUpdate();
void rotate(F32 yaw_radians, F32 pitch_radians);
@ -114,7 +116,7 @@ protected:
void draw();
void resetMotion();
LLPreviewAnimation* mAnimPreview;
LLPointer< LLPreviewAnimation > mAnimPreview;
S32 mLastMouseX;
S32 mLastMouseY;
LLButton* mPlayButton;

View File

@ -47,7 +47,7 @@
#include "llcombobox.h"
#include "llnotify.h"
#include "llsavedsettingsglue.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
#include "lluictrlfactory.h"
@ -186,7 +186,7 @@ void LLFloaterAuction::onClickSnapshot(void* data)
tga->encode(raw);
LLVFile::writeFile(tga->getData(), tga->getDataSize(), gVFS, self->mImageID, LLAssetType::AT_IMAGE_TGA);
raw->biasedScaleToPowerOfTwo(LLViewerImage::MAX_IMAGE_SIZE_DEFAULT);
raw->biasedScaleToPowerOfTwo(LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT);
llinfos << "Writing J2C..." << llendl;
@ -194,7 +194,7 @@ void LLFloaterAuction::onClickSnapshot(void* data)
j2c->encode(raw, 0.0f);
LLVFile::writeFile(j2c->getData(), j2c->getDataSize(), gVFS, self->mImageID, LLAssetType::AT_TEXTURE);
self->mImage = new LLImageGL((LLImageRaw*)raw, FALSE);
self->mImage = LLViewerTextureManager::getLocalTexture((LLImageRaw*)raw, FALSE);
gGL.getTexUnit(0)->bind(self->mImage);
self->mImage->setAddressMode(LLTexUnit::TAM_CLAMP);
}

View File

@ -37,7 +37,7 @@
#include "llfloater.h"
#include "lluuid.h"
#include "llpointer.h"
#include "llviewerimage.h"
#include "llviewertexture.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLFloaterAuction
@ -69,7 +69,7 @@ private:
private:
LLTransactionID mTransactionID;
LLAssetID mImageID;
LLPointer<LLImageGL> mImage;
LLPointer<LLViewerTexture> mImage;
LLSafeHandle<LLParcelSelection> mParcelp;
S32 mParcelID;
LLHost mParcelHost;

View File

@ -56,7 +56,6 @@
#include "llpointer.h"
#include "llimage.h"
#include "llmousehandler.h"
#include "llimagegl.h"
#include "llglheaders.h"
#include "llcheckboxctrl.h"
#include "lltextbox.h"
@ -161,7 +160,7 @@ void LLFloaterColorPicker::createUI ()
* ( bits + x + y * linesize + 2 ) = ( U8 )( bVal * 255.0f );
}
}
mRGBImage = new LLImageGL ( (LLImageRaw*)raw, FALSE );
mRGBImage = LLViewerTextureManager::getLocalTexture( (LLImageRaw*)raw, FALSE );
gGL.getTexUnit(0)->bind(mRGBImage);
mRGBImage->setAddressMode(LLTexUnit::TAM_CLAMP);

View File

@ -175,7 +175,7 @@ class LLFloaterColorPicker
const S32 mPaletteRegionHeight;
// image used to compose color grid
LLPointer<LLImageGL> mRGBImage;
LLPointer<LLViewerTexture> mRGBImage;
// current swatch in use
LLColorSwatchCtrl* mSwatch;

View File

@ -56,7 +56,7 @@
#include "lltrans.h"
#include "lluictrlfactory.h"
#include "llviewergesture.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewerinventory.h"
#include "llvoavatar.h"
#include "llviewercontrol.h"

View File

@ -38,7 +38,7 @@
#include "llfloaterpreference.h"
#include "llviewerwindow.h"
#include "llviewercontrol.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llfeaturemanager.h"
#include "llstartup.h"
#include "pipeline.h"
@ -47,7 +47,6 @@
#include "llradiogroup.h"
#include "lluictrlfactory.h"
#include "llwindow.h"
#include "llimagegl.h"
LLFloaterHardwareSettings* LLFloaterHardwareSettings::sHardwareSettings = NULL;
@ -91,8 +90,8 @@ void LLFloaterHardwareSettings::refresh()
void LLFloaterHardwareSettings::refreshEnabledState()
{
S32 min_tex_mem = LLViewerImageList::getMinVideoRamSetting();
S32 max_tex_mem = LLViewerImageList::getMaxVideoRamSetting();
S32 min_tex_mem = LLViewerTextureList::getMinVideoRamSetting();
S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting();
childSetMinValue("GrapicsCardTextureMemory", min_tex_mem);
childSetMaxValue("GrapicsCardTextureMemory", max_tex_mem);

View File

@ -56,7 +56,7 @@
#include "llvoavatar.h"
#include "pipeline.h"
#include "lluictrlfactory.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llstring.h"
//static
@ -142,9 +142,6 @@ LLFloaterImagePreview::~LLFloaterImagePreview()
clearAllPreviewTextures();
mRawImagep = NULL;
delete mAvatarPreview;
delete mSculptedPreview;
mImagep = NULL ;
}
@ -252,7 +249,7 @@ void LLFloaterImagePreview::draw()
}
else
{
mImagep = new LLImageGL(mRawImagep, FALSE) ;
mImagep = LLViewerTextureManager::getLocalTexture(mRawImagep.get(), FALSE) ;
gGL.getTexUnit(0)->unbind(mImagep->getTarget()) ;
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mImagep->getTexName());
@ -294,11 +291,11 @@ void LLFloaterImagePreview::draw()
if (selected == 9)
{
gGL.getTexUnit(0)->bind(mSculptedPreview->getTexture());
gGL.getTexUnit(0)->bind(mSculptedPreview);
}
else
{
gGL.getTexUnit(0)->bind(mAvatarPreview->getTexture());
gGL.getTexUnit(0)->bind(mAvatarPreview);
}
gGL.begin( LLRender::QUADS );
@ -606,7 +603,7 @@ void LLFloaterImagePreview::onMouseCaptureLostImagePreview(LLMouseHandler* handl
//-----------------------------------------------------------------------------
// LLImagePreviewAvatar
//-----------------------------------------------------------------------------
LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE)
LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE)
{
mNeedsUpdate = TRUE;
mTargetJoint = NULL;
@ -697,7 +694,7 @@ BOOL LLImagePreviewAvatar::render()
glMatrixMode(GL_PROJECTION);
gGL.pushMatrix();
glLoadIdentity();
glOrtho(0.0f, mWidth, 0.0f, mHeight, -1.0f, 1.0f);
glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
gGL.pushMatrix();
@ -706,7 +703,7 @@ BOOL LLImagePreviewAvatar::render()
LLGLSUIDefault def;
gGL.color4f(0.15f, 0.2f, 0.3f, 1.f);
gl_rect_2d_simple( mWidth, mHeight );
gl_rect_2d_simple( mFullWidth, mFullHeight );
glMatrixMode(GL_PROJECTION);
gGL.popMatrix();
@ -728,9 +725,9 @@ BOOL LLImagePreviewAvatar::render()
stop_glerror();
LLViewerCamera::getInstance()->setAspect((F32)mWidth / mHeight);
LLViewerCamera::getInstance()->setAspect((F32)mFullWidth / mFullHeight);
LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom);
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE);
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE);
LLVertexBuffer::unbind();
avatarp->updateLOD();
@ -788,7 +785,7 @@ void LLImagePreviewAvatar::pan(F32 right, F32 up)
// LLImagePreviewSculpted
//-----------------------------------------------------------------------------
LLImagePreviewSculpted::LLImagePreviewSculpted(S32 width, S32 height) : LLDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE)
LLImagePreviewSculpted::LLImagePreviewSculpted(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE)
{
mNeedsUpdate = TRUE;
mCameraDistance = 0.f;
@ -871,7 +868,7 @@ BOOL LLImagePreviewSculpted::render()
glMatrixMode(GL_PROJECTION);
gGL.pushMatrix();
glLoadIdentity();
glOrtho(0.0f, mWidth, 0.0f, mHeight, -1.0f, 1.0f);
glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
gGL.pushMatrix();
@ -879,7 +876,7 @@ BOOL LLImagePreviewSculpted::render()
gGL.color4f(0.15f, 0.2f, 0.3f, 1.f);
gl_rect_2d_simple( mWidth, mHeight );
gl_rect_2d_simple( mFullWidth, mFullHeight );
glMatrixMode(GL_PROJECTION);
gGL.popMatrix();
@ -902,9 +899,9 @@ BOOL LLImagePreviewSculpted::render()
stop_glerror();
LLViewerCamera::getInstance()->setAspect((F32) mWidth / mHeight);
LLViewerCamera::getInstance()->setAspect((F32) mFullWidth / mFullHeight);
LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom);
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE);
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE);
const LLVolumeFace &vf = mVolume->getVolumeFace(0);
U32 num_indices = vf.mIndices.size();

View File

@ -44,12 +44,14 @@ class LLVOAvatar;
class LLTextBox;
class LLVertexBuffer;
class LLImagePreviewSculpted : public LLDynamicTexture
class LLImagePreviewSculpted : public LLViewerDynamicTexture
{
public:
LLImagePreviewSculpted(S32 width, S32 height);
protected:
virtual ~LLImagePreviewSculpted();
public:
LLImagePreviewSculpted(S32 width, S32 height);
void setPreviewTarget(LLImageRaw *imagep, F32 distance);
void setTexture(U32 name) { mTextureName = name; }
@ -73,12 +75,14 @@ class LLImagePreviewSculpted : public LLDynamicTexture
};
class LLImagePreviewAvatar : public LLDynamicTexture
class LLImagePreviewAvatar : public LLViewerDynamicTexture
{
public:
LLImagePreviewAvatar(S32 width, S32 height);
protected:
virtual ~LLImagePreviewAvatar();
public:
LLImagePreviewAvatar(S32 width, S32 height);
void setPreviewTarget(const std::string& joint_name, const std::string& mesh_name, LLImageRaw* imagep, F32 distance, BOOL male);
void setTexture(U32 name) { mTextureName = name; }
void clearPreviewTexture(const std::string& mesh_name);
@ -127,13 +131,13 @@ protected:
bool loadImage(const std::string& filename);
LLPointer<LLImageRaw> mRawImagep;
LLImagePreviewAvatar* mAvatarPreview;
LLImagePreviewSculpted* mSculptedPreview;
LLPointer<LLImagePreviewAvatar> mAvatarPreview;
LLPointer<LLImagePreviewSculpted> mSculptedPreview;
S32 mLastMouseX;
S32 mLastMouseY;
LLRect mPreviewRect;
LLRectf mPreviewImageRect;
LLPointer<LLImageGL> mImagep ;
LLPointer<LLViewerTexture> mImagep ;
static S32 sUploadAmount;
};

View File

@ -77,7 +77,6 @@
#include "lltabcontainer.h"
#include "lltooldraganddrop.h"
#include "lluictrlfactory.h"
#include "llviewerimagelist.h"
#include "llviewerinventory.h"
#include "llviewermessage.h"
#include "llviewerobjectlist.h"

View File

@ -36,7 +36,7 @@
#include "lluictrlfactory.h"
#include "llviewerstats.h"
#include "llviewerimage.h"
#include "llviewertexture.h"
#include "llviewercontrol.h"
#include "llappviewer.h"
@ -185,7 +185,7 @@ void LLFloaterLagMeter::determineClient()
{
mClientCause->setText( getString("client_texture_loading_cause_msg", mStringArgs) );
}
else if((BYTES_TO_MEGA_BYTES(LLViewerImage::sBoundTextureMemoryInBytes)) > LLViewerImage::sMaxBoundTextureMemInMegaBytes)
else if((BYTES_TO_MEGA_BYTES(LLViewerTexture::sBoundTextureMemoryInBytes)) > LLViewerTexture::sMaxBoundTextureMemInMegaBytes)
{
mClientCause->setText( getString("client_texture_memory_cause_msg", mStringArgs) );
}

View File

@ -68,7 +68,7 @@
#include "lltexturectrl.h"
#include "lluiconstants.h"
#include "lluictrlfactory.h"
#include "llviewerimagelist.h" // LLUIImageList
#include "llviewertexturelist.h" // LLUIImageList
#include "llviewermessage.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"

View File

@ -39,6 +39,7 @@
#include "llfloater.h"
#include "llpointer.h" // LLPointer<>
//#include "llviewertexturelist.h"
#include "llsafehandle.h"
typedef std::set<LLUUID, lluuid_less> uuid_list_t;

View File

@ -61,7 +61,7 @@
#include "llimagej2c.h"
#include "llvfile.h"
#include "llvfs.h"
#include "llviewertexture.h"
#include "llassetuploadresponders.h"
#include <boost/regex.hpp> //boost.regex lib
@ -77,7 +77,7 @@ LLFloaterPostcard::instance_list_t LLFloaterPostcard::sInstances;
/// Class LLFloaterPostcard
///----------------------------------------------------------------------------
LLFloaterPostcard::LLFloaterPostcard(LLImageJPEG* jpeg, LLImageGL *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global)
LLFloaterPostcard::LLFloaterPostcard(LLImageJPEG* jpeg, LLViewerTexture *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global)
: LLFloater(),
mJPEGImage(jpeg),
mViewerImage(img),
@ -130,7 +130,7 @@ BOOL LLFloaterPostcard::postBuild()
// static
LLFloaterPostcard* LLFloaterPostcard::showFromSnapshot(LLImageJPEG *jpeg, LLImageGL *img, const LLVector2 &image_scale, const LLVector3d& pos_taken_global)
LLFloaterPostcard* LLFloaterPostcard::showFromSnapshot(LLImageJPEG *jpeg, LLViewerTexture *img, const LLVector2 &image_scale, const LLVector3d& pos_taken_global)
{
// Take the images from the caller
// It's now our job to clean them up
@ -181,7 +181,7 @@ void LLFloaterPostcard::draw()
rect.mBottom,
rect.getWidth(),
rect.getHeight(),
mViewerImage,
mViewerImage.get(),
LLColor4::white);
}
glMatrixMode(GL_TEXTURE);

View File

@ -41,20 +41,20 @@
class LLTextEditor;
class LLLineEditor;
class LLButton;
class LLImageGL;
class LLViewerTexture;
class LLImageJPEG;
class LLFloaterPostcard
: public LLFloater
{
public:
LLFloaterPostcard(LLImageJPEG* jpeg, LLImageGL *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global);
LLFloaterPostcard(LLImageJPEG* jpeg, LLViewerTexture *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global);
virtual ~LLFloaterPostcard();
virtual BOOL postBuild();
virtual void draw();
static LLFloaterPostcard* showFromSnapshot(LLImageJPEG *jpeg, LLImageGL *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global);
static LLFloaterPostcard* showFromSnapshot(LLImageJPEG *jpeg, LLViewerTexture *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global);
static void onClickCancel(void* data);
static void onClickSend(void* data);
@ -73,7 +73,7 @@ public:
protected:
LLPointer<LLImageJPEG> mJPEGImage;
LLPointer<LLImageGL> mViewerImage;
LLPointer<LLViewerTexture> mViewerImage;
LLTransactionID mTransactionID;
LLAssetID mAssetID;
LLVector2 mImageScale;

View File

@ -91,13 +91,8 @@
#include "llspinctrl.h"
#include "llstartup.h"
#include "lltextbox.h"
#include "llui.h"
#include "llviewerimage.h"
#include "llviewerimagelist.h"
#include "llviewerobjectlist.h"
#include "llvoavatar.h"
#include "llvovolume.h"
#include "llwindow.h"

View File

@ -76,8 +76,8 @@
#include "llviewercontrol.h"
#include "lluictrlfactory.h"
#include "llviewerinventory.h"
#include "llviewerimage.h"
#include "llviewerimagelist.h"
#include "llviewertexture.h"
#include "llviewertexturelist.h"
#include "llviewerregion.h"
#include "llviewerstats.h"
#include "llviewertexteditor.h"
@ -1144,11 +1144,11 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes()
if (!texture_ctrl) continue;
LLUUID image_asset_id = texture_ctrl->getImageAssetID();
LLViewerImage* img = gImageList.getImage(image_asset_id);
LLViewerTexture* img = LLViewerTextureManager::getFetchedTexture(image_asset_id);
S32 components = img->getComponents();
// Must ask for highest resolution version's width. JC
S32 width = img->getWidth(0);
S32 height = img->getHeight(0);
S32 width = img->getFullWidth();
S32 height = img->getFullHeight();
//llinfos << "texture detail " << i << " is " << width << "x" << height << "x" << components << llendl;

View File

@ -73,7 +73,7 @@
#include "lltoolmgr.h"
#include "llresourcedata.h" // for LLResourceData
#include "llviewerwindow.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llworldmap.h"
#include "llfilepicker.h"
#include "llfloateravatarpicker.h"
@ -825,7 +825,7 @@ void LLFloaterReporter::takeScreenshot()
llwarns << "Unable to take screenshot" << llendl;
return;
}
LLPointer<LLImageJ2C> upload_data = LLViewerImageList::convertToUploadFile(raw);
LLPointer<LLImageJ2C> upload_data = LLViewerTextureList::convertToUploadFile(raw);
// create a resource data
mResourceDatap->mInventoryType = LLInventoryType::IT_NONE;
@ -855,10 +855,10 @@ void LLFloaterReporter::takeScreenshot()
mResourceDatap->mAssetInfo.mType);
// store in the image list so it doesn't try to fetch from the server
LLPointer<LLViewerImage> image_in_list = new LLViewerImage(mResourceDatap->mAssetInfo.mUuid, TRUE);
LLPointer<LLViewerFetchedTexture> image_in_list =
LLViewerTextureManager::getFetchedTexture(mResourceDatap->mAssetInfo.mUuid, TRUE, FALSE, LLViewerTexture::FETCHED_TEXTURE);
image_in_list->createGLTexture(0, raw);
gImageList.addImage(image_in_list);
// the texture picker then uses that texture
LLTexturePicker* texture = getChild<LLTextureCtrl>("screenshot");
if (texture)

View File

@ -39,7 +39,7 @@
#include "v3math.h"
class LLMessageSystem;
class LLViewerImage;
class LLViewerTexture;
class LLInventoryItem;
class LLViewerObject;
class LLAgent;

View File

@ -45,7 +45,7 @@
#include "llviewertexteditor.h"
#include "llviewercontrol.h"
#include "llviewerobjectlist.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
//
// Statics
@ -131,7 +131,7 @@ void LLFloaterScriptDebug::addScriptLine(const std::string &utf8mesg, const std:
if (objectp)
{
objectp->setIcon(gImageList.getImageFromFile("script_error.j2c", TRUE, TRUE));
objectp->setIcon(LLViewerTextureManager::getFetchedTextureFromFile("script_error.j2c", TRUE, TRUE));
floater_label = llformat("%s(%.2f, %.2f)", user_name.c_str(), objectp->getPositionRegion().mV[VX], objectp->getPositionRegion().mV[VY]);
}
else

View File

@ -140,12 +140,12 @@ public:
LLFloaterSnapshot::ESnapshotFormat getSnapshotFormat() const { return mSnapshotFormat; }
BOOL getSnapshotUpToDate() const { return mSnapshotUpToDate; }
BOOL isSnapshotActive() { return mSnapshotActive; }
LLImageGL* getThumbnailImage() const { return mThumbnailImage ; }
LLViewerTexture* getThumbnailImage() const { return mThumbnailImage ; }
S32 getThumbnailWidth() const { return mThumbnailWidth ; }
S32 getThumbnailHeight() const { return mThumbnailHeight ; }
BOOL getThumbnailLock() const { return mThumbnailUpdateLock ; }
BOOL getThumbnailUpToDate() const { return mThumbnailUpToDate ;}
LLImageGL* getCurrentImage();
LLViewerTexture* getCurrentImage();
F32 getImageAspect();
F32 getAspect() ;
LLRect getImageRect();
@ -170,7 +170,7 @@ public:
private:
LLColor4 mColor;
LLPointer<LLImageGL> mViewerImage[2]; //used to represent the scene when the frame is frozen.
LLPointer<LLViewerTexture> mViewerImage[2]; //used to represent the scene when the frame is frozen.
LLRect mImageRect[2];
S32 mWidth[2];
S32 mHeight[2];
@ -178,7 +178,7 @@ private:
S32 mMaxImageSize ;
//thumbnail image
LLPointer<LLImageGL> mThumbnailImage ;
LLPointer<LLViewerTexture> mThumbnailImage ;
S32 mThumbnailWidth ;
S32 mThumbnailHeight ;
LLRect mPreviewRect ;
@ -278,7 +278,7 @@ void LLSnapshotLivePreview::setMaxImageSize(S32 size)
}
}
LLImageGL* LLSnapshotLivePreview::getCurrentImage()
LLViewerTexture* LLSnapshotLivePreview::getCurrentImage()
{
return mViewerImage[mCurImageIndex];
}
@ -723,7 +723,7 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
if(raw)
{
mThumbnailImage = new LLImageGL(raw, FALSE);
mThumbnailImage = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
mThumbnailUpToDate = TRUE ;
}
@ -871,8 +871,8 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
scaled->expandToPowerOfTwo(1024, FALSE);
}
previewp->mViewerImage[previewp->mCurImageIndex] = new LLImageGL(scaled, FALSE);
LLPointer<LLImageGL> curr_preview_image = previewp->mViewerImage[previewp->mCurImageIndex];
previewp->mViewerImage[previewp->mCurImageIndex] = LLViewerTextureManager::getLocalTexture(scaled.get(), FALSE);
LLPointer<LLViewerTexture> curr_preview_image = previewp->mViewerImage[previewp->mCurImageIndex];
gGL.getTexUnit(0)->bind(curr_preview_image);
if (previewp->getSnapshotType() != SNAPSHOT_TEXTURE)
{

View File

@ -47,8 +47,8 @@
#include "lltooldraganddrop.h"
#include "lltrans.h"
#include "llui.h"
#include "llviewerimage.h"
#include "llviewerimagelist.h"
#include "llviewertexture.h"
#include "llviewertexturelist.h"
#include "llviewerjointattachment.h"
#include "llviewermenu.h"
#include "lluictrlfactory.h"

View File

@ -55,7 +55,7 @@
#include "stdenums.h"
#include "llfontgl.h"
#include "lleditmenuhandler.h"
#include "llviewerimage.h"
#include "llviewertexture.h"
#include "lldepthstack.h"
#include "lltooldraganddrop.h"
// JAMESDEBUG - move this up

View File

@ -38,7 +38,6 @@
#include "llgl.h"
#include "llagent.h"
#include "llrendersphere.h"
#include "llimagegl.h"
#include "llviewerobjectlist.h"
#include "lldrawable.h"

View File

@ -43,7 +43,6 @@
#include "llgl.h"
#include "llglheaders.h"
#include "llhudrender.h"
#include "llimagegl.h"
#include "llrendersphere.h"
#include "llviewercamera.h"
#include "llvoavatar.h"

View File

@ -35,14 +35,13 @@
#include "llhudeffecttrail.h"
#include "llviewercontrol.h"
#include "llimagegl.h"
#include "message.h"
#include "llagent.h"
#include "llbox.h"
#include "lldrawable.h"
#include "llhudrender.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewerobjectlist.h"
#include "llviewerpartsim.h"
#include "llviewerpartsource.h"

View File

@ -40,7 +40,7 @@
#include "llviewerobject.h"
#include "lldrawable.h"
#include "llviewercamera.h"
#include "llviewerimage.h"
#include "llviewertexture.h"
#include "llviewerwindow.h"
//-----------------------------------------------------------------------------
@ -144,7 +144,7 @@ void LLHUDIcon::renderIcon(BOOL for_select)
alpha_factor *= clamp_rescale(time_elapsed, MAX_VISIBLE_TIME - FADE_OUT_TIME, MAX_VISIBLE_TIME, 1.f, 0.f);
}
F32 image_aspect = (F32)mImagep->mFullWidth / (F32)mImagep->mFullHeight;
F32 image_aspect = (F32)mImagep->getFullWidth() / (F32)mImagep->getFullHeight() ;
LLVector3 x_scale = image_aspect * (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * x_pixel_vec;
LLVector3 y_scale = (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * y_pixel_vec;
@ -164,7 +164,7 @@ void LLHUDIcon::renderIcon(BOOL for_select)
LLColor4 icon_color = LLColor4::white;
icon_color.mV[VALPHA] = alpha_factor;
gGL.color4fv(icon_color.mV);
gGL.getTexUnit(0)->bind(mImagep.get());
gGL.getTexUnit(0)->bind(mImagep);
}
gGL.begin(LLRender::QUADS);
@ -181,7 +181,7 @@ void LLHUDIcon::renderIcon(BOOL for_select)
gGL.end();
}
void LLHUDIcon::setImage(LLViewerImage* imagep)
void LLHUDIcon::setImage(LLViewerTexture* imagep)
{
mImagep = imagep;
mImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
@ -260,7 +260,7 @@ BOOL LLHUDIcon::lineSegmentIntersect(const LLVector3& start, const LLVector3& en
return FALSE;
}
F32 image_aspect = (F32)mImagep->mFullWidth / (F32)mImagep->mFullHeight;
F32 image_aspect = (F32)mImagep->getFullWidth() / (F32)mImagep->getFullHeight() ;
LLVector3 x_scale = image_aspect * (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * x_pixel_vec;
LLVector3 y_scale = (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * y_pixel_vec;

View File

@ -61,7 +61,7 @@ public:
/*virtual*/ void markDead();
/*virtual*/ F32 getDistance() const { return mDistance; }
void setImage(LLViewerImage* imagep);
void setImage(LLViewerTexture* imagep);
void setScale(F32 fraction_of_fov);
void restartLifeTimer() { mLifeTimer.reset(); }
@ -88,7 +88,7 @@ protected:
void renderIcon(BOOL for_select); // common render code
private:
LLPointer<LLViewerImage> mImagep;
LLPointer<LLViewerTexture> mImagep;
LLFrameTimer mAnimTimer;
LLFrameTimer mLifeTimer;
F32 mDistance;

View File

@ -40,7 +40,6 @@
#include "v3math.h"
#include "llquaternion.h"
#include "llfontgl.h"
#include "llimagegl.h"
#include "llglheaders.h"
#include "llviewerwindow.h"

View File

@ -45,10 +45,9 @@
#include "llfontgl.h"
#include "llglheaders.h"
#include "llhudrender.h"
#include "llimagegl.h"
#include "llui.h"
#include "llviewercamera.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewerobject.h"
#include "llvovolume.h"
#include "llviewerwindow.h"

View File

@ -75,7 +75,7 @@
#include "llscrollcontainer.h"
#include "llimview.h"
#include "lltooldraganddrop.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewerinventory.h"
#include "llviewerobjectlist.h"
#include "llviewerwindow.h"

View File

@ -42,8 +42,8 @@
// Project includes
#include "llui.h"
#include "llagent.h"
#include "llviewerimage.h"
#include "llviewerimagelist.h"
#include "llviewertexture.h"
#include "llviewertexturelist.h"
#include "llviewerwindow.h"
#include "llmoveview.h"
@ -552,7 +552,7 @@ void LLJoystickCameraRotate::draw()
}
// Draws image rotated by multiples of 90 degrees
void LLJoystickCameraRotate::drawRotatedImage( LLImageGL* image, S32 rotations )
void LLJoystickCameraRotate::drawRotatedImage( LLTexture* image, S32 rotations )
{
S32 width = image->getWidth();
S32 height = image->getHeight();

View File

@ -35,7 +35,7 @@
#include "llbutton.h"
#include "llcoord.h"
#include "llviewerimage.h"
#include "llviewertexture.h"
typedef enum e_joystick_quadrant
{
@ -150,7 +150,7 @@ public:
protected:
F32 getOrbitRate();
virtual void updateSlop();
void drawRotatedImage( LLImageGL* image, S32 rotations );
void drawRotatedImage( LLTexture* image, S32 rotations );
protected:
BOOL mInLeft;

View File

@ -40,7 +40,7 @@
#include "llrender.h"
#include "llprimitive.h"
#include "llview.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llagent.h"
#include "llviewercontrol.h"

View File

@ -78,7 +78,7 @@ const F32 PLANE_TICK_SIZE = 0.4f;
const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f;
const F32 SNAP_ARROW_SCALE = 0.7f;
static LLPointer<LLImageGL> sGridTex = NULL ;
static LLPointer<LLViewerTexture> sGridTex = NULL ;
const LLManip::EManipPart MANIPULATOR_IDS[9] =
{
@ -154,7 +154,7 @@ void LLManipTranslate::restoreGL()
U32 mip = 0;
destroyGL() ;
sGridTex = new LLImageGL() ;
sGridTex = LLViewerTextureManager::getLocalTexture() ;
if(!sGridTex->createGLTexture())
{
sGridTex = NULL ;

View File

@ -51,6 +51,9 @@
#include "llsurface.h"
#include "llviewercamera.h"
#include "llviewercontrol.h"
#include "llviewertexture.h"
#include "llviewertexturelist.h"
#include "llviewermenu.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
#include "llworld.h"
@ -664,7 +667,7 @@ void LLNetMap::createObjectImage()
mObjectRawImagep = new LLImageRaw(img_size, img_size, 4);
U8* data = mObjectRawImagep->getData();
memset( data, 0, img_size * img_size * 4 );
mObjectImagep = new LLImageGL( mObjectRawImagep, FALSE);
mObjectImagep = LLViewerTextureManager::getLocalTexture( mObjectRawImagep.get(), FALSE);
setScale(mScale);
}
mUpdateNow = TRUE;

View File

@ -39,11 +39,11 @@
#include "v3dmath.h"
#include "v4color.h"
#include "llimage.h"
#include "llimagegl.h"
class LLColor4U;
class LLCoordGL;
class LLTextBox;
class LLViewerTexture ;
class LLNetMap : public LLUICtrl
{
@ -106,7 +106,7 @@ private:
BOOL mUpdateNow;
LLVector3d mObjectImageCenterGlobal;
LLPointer<LLImageRaw> mObjectRawImagep;
LLPointer<LLImageGL> mObjectImagep;
LLPointer<LLViewerTexture> mObjectImagep;
LLUUID mClosestAgentToCursor;
LLUUID mClosestAgentAtLastRightClick;

View File

@ -49,7 +49,7 @@
#include "lltextbox.h"
#include "llui.h"
#include "llviewercontrol.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewerjoystick.h"
#include "llviewermedia.h"
#include "llviewermenu.h" // handle_reset_view()

View File

@ -411,7 +411,7 @@ void LLPanelFace::getState()
{
LLUUID get(LLViewerObject* object, S32 te)
{
LLViewerImage* image = object->getTEImage(te);
LLViewerTexture* image = object->getTEImage(te);
return image ? image->getID() : LLUUID::null;
}
} func;

View File

@ -49,7 +49,7 @@
#include "lltabcontainer.h"
#include "lltextbox.h"
#include "lltexteditor.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewerwindow.h"
#include "llfocusmgr.h"

View File

@ -57,7 +57,7 @@
#include "lluiconstants.h"
#include "llurlsimstring.h"
#include "llviewerbuild.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewermenu.h" // for handle_preferences()
#include "llviewernetwork.h"
#include "llviewerwindow.h" // to link into child list
@ -362,7 +362,7 @@ LLPanelLogin::~LLPanelLogin()
gResponsePtr->setParent( 0 );
//// We know we're done with the image, so be rid of it.
//gImageList.deleteImage( mLogoImage );
//gTextureList.deleteImage( mLogoImage );
}
// virtual

View File

@ -46,8 +46,8 @@
#include "lltextbox.h"
#include "lltextureview.h"
#include "llui.h"
#include "llviewerimage.h"
#include "llviewerimagelist.h"
#include "llviewertexture.h"
#include "llviewertexturelist.h"
#include "lluictrlfactory.h"
#include "llviewerwindow.h"
#include "lllineeditor.h"
@ -205,7 +205,7 @@ void LLPreviewTexture::draw()
LLFontGL::NORMAL,
LLFontGL::DROP_SHADOW);
F32 data_progress = mImage->mDownloadProgress;
F32 data_progress = mImage->getDownloadProgress() ;
// Draw the progress bar.
const S32 BAR_HEIGHT = 12;
@ -295,7 +295,7 @@ void LLPreviewTexture::onFocusReceived()
// static
void LLPreviewTexture::onFileLoadedForSave(BOOL success,
LLViewerImage *src_vi,
LLViewerFetchedTexture *src_vi,
LLImageRaw* src,
LLImageRaw* aux_src,
S32 discard_level,
@ -357,8 +357,8 @@ void LLPreviewTexture::updateDimensions()
mUpdateDimensions = FALSE;
S32 image_height = llmax(1, mImage->getHeight(0));
S32 image_width = llmax(1, mImage->getWidth(0));
S32 image_height = llmax(1, mImage->getFullHeight());
S32 image_width = llmax(1, mImage->getFullWidth());
// Attempt to make the image 1:1 on screen.
// If that fails, cut width by half.
S32 client_width = image_width;
@ -379,8 +379,8 @@ void LLPreviewTexture::updateDimensions()
S32 view_height = client_height + vert_pad;
// set text on dimensions display (should be moved out of here and into a callback of some sort)
childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->mFullWidth));
childSetTextArg("dimensions", "[HEIGHT]", llformat("%d", mImage->mFullHeight));
childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->getFullWidth()));
childSetTextArg("dimensions", "[HEIGHT]", llformat("%d", mImage->getFullHeight()));
// add space for dimensions
S32 info_height = 0;
@ -464,15 +464,15 @@ void LLPreviewTexture::updateDimensions()
void LLPreviewTexture::loadAsset()
{
mImage = gImageList.getImage(mImageID, MIPMAP_TRUE, FALSE);
mImage->setBoostLevel(LLViewerImage::BOOST_PREVIEW);
mImage = LLViewerTextureManager::getFetchedTexture(mImageID, MIPMAP_TRUE, FALSE, LLViewerTexture::LOD_TEXTURE);
mImage->setBoostLevel(LLViewerTexture::BOOST_PREVIEW);
mAssetStatus = PREVIEW_ASSET_LOADING;
updateDimensions();
}
LLPreview::EAssetStatus LLPreviewTexture::getAssetStatus()
{
if (mImage.notNull() && (mImage->mFullWidth * mImage->mFullHeight > 0))
if (mImage.notNull() && (mImage->getFullWidth() * mImage->getFullHeight() > 0))
{
mAssetStatus = PREVIEW_ASSET_LOADED;
}

View File

@ -36,7 +36,7 @@
#include "llpreview.h"
#include "llbutton.h"
#include "llframetimer.h"
#include "llviewerimage.h"
#include "llviewertexture.h"
class LLImageRaw;
@ -60,7 +60,7 @@ public:
static void saveToFile(void* userdata);
static void onFileLoadedForSave(
BOOL success,
LLViewerImage *src_vi,
LLViewerFetchedTexture *src_vi,
LLImageRaw* src,
LLImageRaw* aux_src,
S32 discard_level,
@ -75,7 +75,7 @@ protected:
private:
void updateDimensions();
LLUUID mImageID;
LLPointer<LLViewerImage> mImage;
LLPointer<LLViewerFetchedTexture> mImage;
BOOL mLoadingFullImage;
std::string mSaveFileName;
LLFrameTimer mSavedFileTimer;

View File

@ -40,7 +40,6 @@
#include "llrender.h"
#include "llui.h"
#include "llfontgl.h"
#include "llimagegl.h"
#include "lltimer.h"
#include "lltextbox.h"
#include "llglheaders.h"
@ -51,7 +50,7 @@
#include "llprogressbar.h"
#include "llstartup.h"
#include "llviewercontrol.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewerwindow.h"
#include "llappviewer.h"
#include "llweb.h"
@ -147,10 +146,10 @@ void LLProgressView::draw()
// Paint bitmap if we've got one
glPushMatrix();
if (gStartImageGL)
if (gStartTexture)
{
LLGLSUIDefault gls_ui;
gGL.getTexUnit(0)->bind(gStartImageGL);
gGL.getTexUnit(0)->bind(gStartTexture.get());
gGL.color4f(1.f, 1.f, 1.f, mFadeTimer.getStarted() ? clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, FADE_IN_TIME, 1.f, 0.f) : 1.f);
F32 image_aspect = (F32)gStartImageWidth / (F32)gStartImageHeight;
S32 width = getRect().getWidth();
@ -186,7 +185,7 @@ void LLProgressView::draw()
{
gFocusMgr.removeTopCtrlWithoutCallback(this);
LLPanel::setVisible(FALSE);
gStartImageGL = NULL;
gStartTexture = NULL;
}
return;
}

View File

@ -74,7 +74,7 @@
#include "llui.h"
#include "llviewercamera.h"
#include "llviewercontrol.h"
#include "llviewerimagelist.h"
#include "llviewertexturelist.h"
#include "llviewermenu.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
@ -1425,7 +1425,7 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid)
// Texture picker defaults aren't inventory items
// * Don't need to worry about permissions for them
// * Can just apply the texture and be done with it.
objectp->setTEImage(te, gImageList.getImage(mImageID, TRUE, FALSE));
objectp->setTEImage(te, LLViewerTextureManager::getFetchedTexture(mImageID, TRUE, FALSE, LLViewerTexture::LOD_TEXTURE));
}
return true;
}
@ -1581,7 +1581,7 @@ BOOL LLSelectMgr::selectionRevertTextures()
}
else
{
object->setTEImage(te, gImageList.getImage(id));
object->setTEImage(te, LLViewerTextureManager::getFetchedTexture(id, TRUE, FALSE, LLViewerTexture::LOD_TEXTURE));
}
}
}
@ -4544,7 +4544,7 @@ void LLSelectMgr::updateSilhouettes()
if (!mSilhouetteImagep)
{
mSilhouetteImagep = gImageList.getImageFromFile("silhouette.j2c", TRUE, TRUE);
mSilhouetteImagep = LLViewerTextureManager::getFetchedTextureFromFile("silhouette.j2c", TRUE, TRUE);
}
mHighlightedObjects->cleanupNodes();
@ -4814,7 +4814,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
return;
}
gGL.getTexUnit(0)->bind(mSilhouetteImagep.get());
gGL.getTexUnit(0)->bind(mSilhouetteImagep);
LLGLSPipelineSelection gls_select;
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f);
LLGLEnable blend(GL_BLEND);

View File

@ -54,7 +54,7 @@
#include "boost/iterator/filter_iterator.hpp"
class LLMessageSystem;
class LLViewerImage;
class LLViewerTexture;
class LLViewerObject;
class LLColor4;
class LLVector3;
@ -690,7 +690,7 @@ private:
static bool confirmDelete(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle handle);
private:
LLPointer<LLViewerImage> mSilhouetteImagep;
LLPointer<LLViewerTexture> mSilhouetteImagep;
LLObjectSelectionHandle mSelectedObjects;
LLObjectSelectionHandle mHoverObjects;
LLObjectSelectionHandle mHighlightedObjects;

View File

@ -2356,7 +2356,7 @@ void renderTexturePriority(LLDrawable* drawable)
LLGLDisable blend(GL_BLEND);
//LLViewerImage* imagep = facep->getTexture();
//LLViewerTexture* imagep = facep->getTexture();
//if (imagep)
{
@ -2386,7 +2386,7 @@ void renderTexturePriority(LLDrawable* drawable)
/*S32 boost = imagep->getBoostLevel();
if (boost)
{
F32 t = (F32) boost / (F32) (LLViewerImage::BOOST_MAX_LEVEL-1);
F32 t = (F32) boost / (F32) (LLViewerTexture::BOOST_MAX_LEVEL-1);
LLVector4 col = lerp(boost_cold, boost_hot, t);
LLGLEnable blend_on(GL_BLEND);
gGL.blendFunc(GL_SRC_ALPHA, GL_ONE);
@ -2896,7 +2896,7 @@ LLDrawable* LLSpatialPartition::lineSegmentIntersect(const LLVector3& start, con
}
LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset,
LLViewerImage* texture, LLVertexBuffer* buffer,
LLViewerTexture* texture, LLVertexBuffer* buffer,
BOOL fullbright, U8 bump, BOOL particle, F32 part_size)
:
mVertexBuffer(buffer),

Some files were not shown because too many files have changed in this diff Show More