LLImageGL Class Reference

#include <llimagegl.h>

Inheritance diagram for LLImageGL:

Inheritance graph
[legend]
Collaboration diagram for LLImageGL:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LLImageGL (BOOL usemipmaps=TRUE)
 LLImageGL (U32 width, U32 height, U8 components, BOOL usemipmaps=TRUE)
 LLImageGL (const LLImageRaw *imageraw, BOOL usemipmaps=TRUE)
virtual void dump ()
virtual BOOL bind (const S32 stage=0) const
void setSize (S32 width, S32 height, S32 ncomponents)
BOOL createGLTexture (S32 discard_level, const LLImageRaw *imageraw, S32 usename=0)
BOOL createGLTexture (S32 discard_level, const U8 *data, BOOL data_hasmips=FALSE, S32 usename=0)
void setImage (const LLImageRaw *imageraw)
void setImage (const U8 *data_in, BOOL data_hasmips=FALSE)
BOOL setSubImage (const LLImageRaw *imageraw, S32 x_pos, S32 y_pos, S32 width, S32 height)
BOOL setSubImage (const U8 *datap, S32 data_width, S32 data_height, S32 x_pos, S32 y_pos, S32 width, S32 height)
BOOL setSubImageFromFrameBuffer (S32 fb_x, S32 fb_y, S32 x_pos, S32 y_pos, S32 width, S32 height)
BOOL setDiscardLevel (S32 discard_level)
BOOL readBackRaw (S32 discard_level, LLImageRaw *imageraw, bool compressed_ok)
void destroyGLTexture ()
void setClamp (BOOL clamps, BOOL clampt)
void setMipFilterNearest (BOOL nearest, BOOL min_nearest=FALSE)
void setExplicitFormat (LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format=0, BOOL swap_bytes=FALSE)
void dontDiscard ()
S32 getDiscardLevel () const
S32 getMaxDiscardLevel () const
S32 getWidth (S32 discard_level=-1) const
S32 getHeight (S32 discard_level=-1) const
U8 getComponents () const
S32 getBytes (S32 discard_level=-1) const
S32 getMipBytes (S32 discard_level=-1) const
BOOL getBoundRecently () const
LLGLenum getPrimaryFormat () const
BOOL getClampS () const
BOOL getClampT () const
BOOL getMipFilterNearest () const
BOOL getHasGLTexture () const
LLGLuint getTexName () const
BOOL getIsResident (BOOL test_now=FALSE)
void setTarget (const LLGLenum target, const LLGLenum bind_target)
BOOL getUseMipMaps () const
void setUseMipMaps (BOOL usemips)
BOOL getUseDiscard () const
BOOL getDontDiscard () const
BOOL isValidForSculpt (S32 discard_level, S32 image_width, S32 image_height, S32 ncomponents)
BOOL getMissed () const

Static Public Member Functions

static S32 dataFormatBits (S32 dataformat)
static S32 dataFormatBytes (S32 dataformat, S32 width, S32 height)
static S32 dataFormatComponents (S32 dataformat)
static void bindExternalTexture (LLGLuint gl_name, S32 stage, LLGLenum bind_target)
static void unbindTexture (S32 stage, LLGLenum target)
static void unbindTexture (S32 stage)
static void updateStats (F32 current_time)
static void destroyGL (BOOL save_state=TRUE)
static void restoreGL ()
static S32 updateBoundTexMem (const S32 delta)
static bool checkSize (S32 width, S32 height)
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 Attributes

S32 mTextureMemory
F32 mLastBindTime

Static Public Attributes

static std::set< LLImageGL * > sImageList
static S32 sCount = 0
static F32 sLastFrameTime = 0.f
static LLGLuint sCurrentBoundTextures [MAX_GL_TEXTURE_UNITS] = { 0 }
static S32 sGlobalTextureMemory = 0
static S32 sBoundTextureMemory = 0
static S32 sCurBoundTextureMemory = 0
static U32 sBindCount = 0
static U32 sUniqueCount = 0
static BOOL sGlobalUseAnisotropic = FALSE

Protected Member Functions

virtual ~LLImageGL ()
BOOL bindTextureInternal (const S32 stage=0) const
void init (BOOL usemipmaps)
virtual void cleanup ()

Protected Attributes

LLGLenum mTarget
LLGLenum mBindTarget
LLGLuint mTexName
LLGLboolean mIsResident
U16 mWidth
U16 mHeight
S8 mComponents
S8 mMaxDiscardLevel
S8 mCurrentDiscardLevel
S8 mDontDiscard
S8 mClampS
S8 mClampT
S8 mMipFilterNearest
LLGLint mFormatInternal
LLGLenum mFormatPrimary
LLGLenum mFormatType
BOOL mFormatSwapBytes

Private Attributes

LLPointer< LLImageRawmSaveData
S8 mUseMipMaps
S8 mHasMipMaps
S8 mHasExplicitFormat
S8 mAutoGenMips


Detailed Description

Definition at line 43 of file llimagegl.h.


Constructor & Destructor Documentation

LLImageGL::LLImageGL ( BOOL  usemipmaps = TRUE  ) 

Definition at line 253 of file llimagegl.cpp.

References init(), sCount, setSize(), and sImageList.

Referenced by create(), and LLViewerImage::initClass().

Here is the call graph for this function:

Here is the caller graph for this function:

LLImageGL::LLImageGL ( U32  width,
U32  height,
U8  components,
BOOL  usemipmaps = TRUE 
)

Definition at line 262 of file llimagegl.cpp.

References init(), llassert, sCount, setSize(), and sImageList.

Here is the call graph for this function:

LLImageGL::LLImageGL ( const LLImageRaw imageraw,
BOOL  usemipmaps = TRUE 
)

Definition at line 272 of file llimagegl.cpp.

References createGLTexture(), init(), sCount, setSize(), and sImageList.

Here is the call graph for this function:

LLImageGL::~LLImageGL (  )  [protected, virtual]

Definition at line 282 of file llimagegl.cpp.

References cleanup(), sCount, and sImageList.

Here is the call graph for this function:


Member Function Documentation

S32 LLImageGL::dataFormatBits ( S32  dataformat  )  [static]

Definition at line 69 of file llimagegl.cpp.

References llendl, and llerrs.

Referenced by dataFormatBytes().

Here is the caller graph for this function:

S32 LLImageGL::dataFormatBytes ( S32  dataformat,
S32  width,
S32  height 
) [static]

Definition at line 91 of file llimagegl.cpp.

References dataFormatBits(), and S32.

Referenced by getBytes(), getMipBytes(), and setImage().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 LLImageGL::dataFormatComponents ( S32  dataformat  )  [static]

Definition at line 105 of file llimagegl.cpp.

References llendl, and llerrs.

void LLImageGL::bindExternalTexture ( LLGLuint  gl_name,
S32  stage,
LLGLenum  bind_target 
) [static]

void LLImageGL::unbindTexture ( S32  stage,
LLGLenum  target 
) [static]

Definition at line 144 of file llimagegl.cpp.

References LLGLImmediate::flush(), gGL, and sCurrentBoundTextures.

Referenced by LLDrawPoolBump::beginBump(), LLTexLayerSetBuffer::bindBumpTexture(), LLPipeline::blurReflectionMap(), createGLTexture(), destroyGL(), destroyGLTexture(), LLPipeline::doOcclusion(), LLVisualParamHint::draw(), LLFloaterImagePreview::draw(), LLViewerJointMesh::drawShape(), LLDrawPoolBump::endFullbrightShiny(), LLDrawPoolBump::endShiny(), LLPipeline::generateImpostor(), LLPipeline::generateReflectionMap(), LLPipeline::generateWaterReflection(), LLVOAvatar::getScratchTexName(), LLManipTranslate::highlightIntersection(), LLDrawPoolTerrain::LLDrawPoolTerrain(), LLGLSNoTexture::LLGLSNoTexture(), LLGLSNoTextureNoAlphaTest::LLGLSNoTextureNoAlphaTest(), LLGLSObjectSelect::LLGLSObjectSelect(), LLGLSTracker::LLGLSTracker(), LLTexLayerSetBuffer::LLTexLayerSetBuffer(), LLDynamicTexture::preRender(), LLDrawPoolBump::pushBatch(), LLRenderPass::pushBatch(), LLTexLayer::render(), LLTexLayerSet::render(), LLHUDEffectBeam::render(), LLDrawPoolWLSky::render(), LLDrawPoolWater::render(), LLDrawPoolGround::render(), render_disconnected_background(), LLTexLayer::renderAlphaMasks(), LLPipeline::renderBloom(), LLManipScale::renderBoxHandle(), LLSpatialPartition::renderDebug(), LLFace::renderForSelect(), LLDrawPoolTerrain::renderForSelect(), LLDrawPoolTerrain::renderFull2TU(), LLDrawPoolTerrain::renderFull4TU(), LLDrawPoolTerrain::renderFullShader(), LLHUDIcon::renderIcon(), LLTexLayer::renderImageRaw(), LLViewerWindow::renderSelections(), LLDrawPoolTerrain::renderSimple(), LLManipTranslate::renderSnapGuides(), LLHUDText::renderText(), LLDynamicTexture::unbindTexture(), unbindTexture(), and LLPipeline::updateCull().

Here is the call graph for this function:

void LLImageGL::unbindTexture ( S32  stage  )  [static]

Definition at line 165 of file llimagegl.cpp.

References unbindTexture().

Here is the call graph for this function:

void LLImageGL::updateStats ( F32  current_time  )  [static]

Definition at line 171 of file llimagegl.cpp.

References sBoundTextureMemory, sCurBoundTextureMemory, and sLastFrameTime.

Referenced by display().

Here is the caller graph for this function:

void LLImageGL::destroyGL ( BOOL  save_state = TRUE  )  [static]

Definition at line 188 of file llimagegl.cpp.

References destroyGLTexture(), gGLManager, mComponents, mCurrentDiscardLevel, LLGLManager::mNumTextureUnits, mSaveData, mTexName, readBackRaw(), S32, sImageList, stop_glerror, and unbindTexture().

Referenced by LLViewerImageList::destroyGL().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLImageGL::restoreGL (  )  [static]

Definition at line 212 of file llimagegl.cpp.

References createGLTexture(), getComponents(), mCurrentDiscardLevel, mSaveData, LLPointer< Type >::notNull(), NULL, sImageList, and stop_glerror.

Referenced by LLViewerImageList::restoreGL().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 LLImageGL::updateBoundTexMem ( const S32  delta  )  [static]

Definition at line 179 of file llimagegl.cpp.

References sCurBoundTextureMemory.

Referenced by LLTexLayerSetBuffer::bindBumpTexture(), LLVOAvatar::bindScratchTexture(), and bindTextureInternal().

Here is the caller graph for this function:

bool LLImageGL::checkSize ( S32  width,
S32  height 
) [static]

Definition at line 348 of file llimagegl.cpp.

References check_power_of_two().

Referenced by LLViewerImage::createTexture(), and setSize().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLImageGL::create ( LLPointer< LLImageGL > &  dest,
BOOL  usemipmaps = TRUE 
) [static]

Definition at line 233 of file llimagegl.cpp.

References LLImageGL(), and TRUE.

Referenced by LLDrawPoolWLSky::LLDrawPoolWLSky(), and LLDrawPoolWLSky::restoreGL().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLImageGL::create ( LLPointer< LLImageGL > &  dest,
U32  width,
U32  height,
U8  components,
BOOL  usemipmaps = TRUE 
) [static]

Definition at line 239 of file llimagegl.cpp.

References LLImageGL(), and TRUE.

Here is the call graph for this function:

BOOL LLImageGL::create ( LLPointer< LLImageGL > &  dest,
const LLImageRaw imageraw,
BOOL  usemipmaps = TRUE 
) [static]

Definition at line 245 of file llimagegl.cpp.

References LLImageGL(), and TRUE.

Here is the call graph for this function:

BOOL LLImageGL::bindTextureInternal ( const S32  stage = 0  )  const [protected]

void LLImageGL::dump (  )  [virtual]

BOOL LLImageGL::bind ( const S32  stage = 0  )  const [virtual]

void LLImageGL::setSize ( S32  width,
S32  height,
S32  ncomponents 
)

Definition at line 353 of file llimagegl.cpp.

References checkSize(), destroyGLTexture(), llendl, llerrs, llformat(), MAX_DISCARD_LEVEL, mComponents, mHeight, mMaxDiscardLevel, mTexName, and mWidth.

Referenced by createGLTexture(), LLImageGL(), and LLViewerImage::reinit().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLImageGL::createGLTexture ( S32  discard_level,
const LLImageRaw imageraw,
S32  usename = 0 
)

BOOL LLImageGL::createGLTexture ( S32  discard_level,
const U8 data,
BOOL  data_hasmips = FALSE,
S32  usename = 0 
)

void LLImageGL::setImage ( const LLImageRaw imageraw  ) 

Definition at line 509 of file llimagegl.cpp.

References FALSE, getComponents(), LLImageBase::getComponents(), LLImageBase::getData(), getHeight(), LLImageBase::getHeight(), getWidth(), LLImageBase::getWidth(), llassert, and mCurrentDiscardLevel.

Referenced by createGLTexture(), and setSubImage().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLImageGL::setImage ( const U8 data_in,
BOOL  data_hasmips = FALSE 
)

BOOL LLImageGL::setSubImage ( const LLImageRaw imageraw,
S32  x_pos,
S32  y_pos,
S32  width,
S32  height 
)

Definition at line 807 of file llimagegl.cpp.

References LLImageBase::getData(), LLImageBase::getHeight(), and LLImageBase::getWidth().

Referenced by LLVLComposition::generateTexture(), and LLViewerMediaImpl::onMediaContentsChange().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLImageGL::setSubImage ( const U8 datap,
S32  data_width,
S32  data_height,
S32  x_pos,
S32  y_pos,
S32  width,
S32  height 
)

BOOL LLImageGL::setSubImageFromFrameBuffer ( S32  fb_x,
S32  fb_y,
S32  x_pos,
S32  y_pos,
S32  width,
S32  height 
)

Definition at line 813 of file llimagegl.cpp.

References bindTextureInternal(), FALSE, stop_glerror, and TRUE.

Here is the call graph for this function:

BOOL LLImageGL::setDiscardLevel ( S32  discard_level  ) 

Definition at line 966 of file llimagegl.cpp.

References createGLTexture(), dump(), FALSE, llassert, llclamp(), llendl, llerrs, mCurrentDiscardLevel, mDontDiscard, mMaxDiscardLevel, mUseMipMaps, readBackRaw(), and S32.

Referenced by LLViewerImage::processTextureStats().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLImageGL::readBackRaw ( S32  discard_level,
LLImageRaw imageraw,
bool  compressed_ok 
)

void LLImageGL::destroyGLTexture (  ) 

Definition at line 1129 of file llimagegl.cpp.

References gGLManager, i, LLGLManager::mNumTextureUnits, mTexName, mTextureMemory, sCurrentBoundTextures, sGlobalTextureMemory, stop_glerror, and unbindTexture().

Referenced by cleanup(), destroyGL(), LLViewerMediaImpl::initializePlaceholderImage(), setSize(), and LLBumpImageList::updateImages().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLImageGL::setClamp ( BOOL  clamps,
BOOL  clampt 
)

void LLImageGL::setMipFilterNearest ( BOOL  nearest,
BOOL  min_nearest = FALSE 
)

Definition at line 1168 of file llimagegl.cpp.

References gGLManager, mBindTarget, LLGLManager::mHasAnisotropic, mHasMipMaps, mMipFilterNearest, mTexName, sGlobalUseAnisotropic, and stop_glerror.

Referenced by createGLTexture().

Here is the caller graph for this function:

void LLImageGL::setExplicitFormat ( LLGLint  internal_format,
LLGLenum  primary_format,
LLGLenum  type_format = 0,
BOOL  swap_bytes = FALSE 
)

void LLImageGL::dontDiscard (  )  [inline]

Definition at line 105 of file llimagegl.h.

References mDontDiscard.

Referenced by LLViewerImage::initClass().

Here is the caller graph for this function:

S32 LLImageGL::getDiscardLevel (  )  const [inline]

S32 LLImageGL::getMaxDiscardLevel (  )  const [inline]

Definition at line 108 of file llimagegl.h.

References mMaxDiscardLevel.

S32 LLImageGL::getWidth ( S32  discard_level = -1  )  const

S32 LLImageGL::getHeight ( S32  discard_level = -1  )  const

U8 LLImageGL::getComponents (  )  const [inline]

S32 LLImageGL::getBytes ( S32  discard_level = -1  )  const

Definition at line 1251 of file llimagegl.cpp.

References dataFormatBytes(), mCurrentDiscardLevel, mFormatPrimary, mHeight, mWidth, and S32.

Here is the call graph for this function:

S32 LLImageGL::getMipBytes ( S32  discard_level = -1  )  const

Definition at line 1264 of file llimagegl.cpp.

References dataFormatBytes(), mCurrentDiscardLevel, mFormatPrimary, mHeight, mUseMipMaps, mWidth, and S32.

Referenced by createGLTexture().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLImageGL::getBoundRecently (  )  const

Definition at line 1285 of file llimagegl.cpp.

References MIN_TEXTURE_LIFETIME, mLastBindTime, and sLastFrameTime.

Referenced by LLViewerImage::calcDecodePriority(), LLViewerImage::processTextureStats(), and LLBumpImageList::updateImages().

Here is the caller graph for this function:

LLGLenum LLImageGL::getPrimaryFormat (  )  const [inline]

Definition at line 116 of file llimagegl.h.

References mFormatPrimary.

Referenced by calc_shame(), and LLVolumeGeometryManager::rebuildGeom().

Here is the caller graph for this function:

BOOL LLImageGL::getClampS (  )  const [inline]

Definition at line 118 of file llimagegl.h.

References mClampS.

Referenced by LLTexLayer::render(), and LLTexLayer::renderAlphaMasks().

Here is the caller graph for this function:

BOOL LLImageGL::getClampT (  )  const [inline]

Definition at line 119 of file llimagegl.h.

References mClampT.

Referenced by LLTexLayer::render(), and LLTexLayer::renderAlphaMasks().

Here is the caller graph for this function:

BOOL LLImageGL::getMipFilterNearest (  )  const [inline]

Definition at line 120 of file llimagegl.h.

References mMipFilterNearest.

BOOL LLImageGL::getHasGLTexture (  )  const [inline]

LLGLuint LLImageGL::getTexName (  )  const [inline]

Definition at line 123 of file llimagegl.h.

References mTexName.

BOOL LLImageGL::getIsResident ( BOOL  test_now = FALSE  ) 

Definition at line 1212 of file llimagegl.cpp.

References FALSE, mIsResident, and mTexName.

Referenced by bindTextureInternal().

Here is the caller graph for this function:

void LLImageGL::setTarget ( const LLGLenum  target,
const LLGLenum  bind_target 
)

Definition at line 1290 of file llimagegl.cpp.

References mBindTarget, and mTarget.

BOOL LLImageGL::getUseMipMaps (  )  const [inline]

Definition at line 129 of file llimagegl.h.

References mUseMipMaps.

Referenced by LLViewerMediaImpl::onMediaContentsChange(), LLViewerImage::processTextureStats(), and LLViewerMediaImpl::updateMovieImage().

Here is the caller graph for this function:

void LLImageGL::setUseMipMaps ( BOOL  usemips  )  [inline]

Definition at line 130 of file llimagegl.h.

References mUseMipMaps.

Referenced by LLViewerMediaImpl::initializePlaceholderImage().

Here is the caller graph for this function:

BOOL LLImageGL::getUseDiscard (  )  const [inline]

Definition at line 131 of file llimagegl.h.

References mDontDiscard, and mUseMipMaps.

Referenced by LLViewerImageList::shutdown().

Here is the caller graph for this function:

BOOL LLImageGL::getDontDiscard (  )  const [inline]

Definition at line 132 of file llimagegl.h.

References mDontDiscard.

Referenced by LLViewerImage::calcDecodePriority().

Here is the caller graph for this function:

BOOL LLImageGL::isValidForSculpt ( S32  discard_level,
S32  image_width,
S32  image_height,
S32  ncomponents 
)

Definition at line 1018 of file llimagegl.cpp.

References assert_glerror(), mCurrentDiscardLevel, mTarget, and S32.

Here is the call graph for this function:

void LLImageGL::init ( BOOL  usemipmaps  )  [protected]

void LLImageGL::cleanup (  )  [protected, virtual]

Reimplemented in LLViewerImage.

Definition at line 323 of file llimagegl.cpp.

References destroyGLTexture(), gGLManager, LLGLManager::mIsDisabled, mSaveData, and NULL.

Referenced by LLViewerImage::cleanup(), and ~LLImageGL().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLImageGL::getMissed (  )  const [inline]

Definition at line 198 of file llimagegl.h.

References FALSE.


Member Data Documentation

Definition at line 146 of file llimagegl.h.

Referenced by cleanup(), destroyGL(), and restoreGL().

Definition at line 148 of file llimagegl.h.

Referenced by dump(), init(), setImage(), and setMipFilterNearest().

Definition at line 149 of file llimagegl.h.

Referenced by createGLTexture(), dump(), init(), and setExplicitFormat().

Definition at line 150 of file llimagegl.h.

Referenced by createGLTexture(), init(), and setImage().

Definition at line 153 of file llimagegl.h.

Referenced by dump(), init(), isValidForSculpt(), readBackRaw(), setImage(), setSubImage(), and setTarget().

Definition at line 158 of file llimagegl.h.

Referenced by dump(), getIsResident(), and init().

U16 LLImageGL::mWidth [protected]

U16 LLImageGL::mHeight [protected]

S8 LLImageGL::mClampS [protected]

Definition at line 168 of file llimagegl.h.

Referenced by createGLTexture(), getClampS(), init(), and setClamp().

S8 LLImageGL::mClampT [protected]

Definition at line 169 of file llimagegl.h.

Referenced by createGLTexture(), getClampT(), init(), and setClamp().

Definition at line 170 of file llimagegl.h.

Referenced by createGLTexture(), getMipFilterNearest(), init(), and setMipFilterNearest().

Definition at line 172 of file llimagegl.h.

Referenced by createGLTexture(), dump(), init(), setExplicitFormat(), and setImage().

Definition at line 175 of file llimagegl.h.

Referenced by dump(), init(), setExplicitFormat(), setImage(), and setSubImage().

std::set< LLImageGL * > LLImageGL::sImageList [static]

Definition at line 179 of file llimagegl.h.

Referenced by destroyGL(), LLImageGL(), restoreGL(), and ~LLImageGL().

S32 LLImageGL::sCount = 0 [static]

Definition at line 180 of file llimagegl.h.

Referenced by LLImageGL(), and ~LLImageGL().

Definition at line 189 of file llimagegl.h.

Referenced by updateBoundTexMem(), and updateStats().

U32 LLImageGL::sBindCount = 0 [static]

Definition at line 190 of file llimagegl.h.

Referenced by bindTextureInternal(), and LLDebugText::update().

Definition at line 191 of file llimagegl.h.

Referenced by bindTextureInternal(), and LLDebugText::update().


The documentation for this class was generated from the following files:

Generated on Fri May 16 08:49:40 2008 for SecondLife by  doxygen 1.5.5