summaryrefslogtreecommitdiff
path: root/indra/newview/llvlcomposition.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2009-11-06 06:52:24 +0000
committerXiaohong Bao <bao@lindenlab.com>2009-11-06 06:52:24 +0000
commit35e200881c38eb6c1bfd1f14ef440d4bc4da8c74 (patch)
tree8fceb759ef8f8259fd574c398ac02965566a05ff /indra/newview/llvlcomposition.cpp
parent2f2bdd83d6e078fb6cdcbb0ba0a9eaa38d45cc90 (diff)
merge QAR-1829: texture pipeline branch in viewer-2.0.0.3
Diffstat (limited to 'indra/newview/llvlcomposition.cpp')
-rw-r--r--indra/newview/llvlcomposition.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp
index d124cbcdce..999701ece1 100644
--- a/indra/newview/llvlcomposition.cpp
+++ b/indra/newview/llvlcomposition.cpp
@@ -279,7 +279,6 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
if (mRawImages[i].isNull())
{
// Read back a raw image for this discard level, if it exists
- mRawImages[i] = new LLImageRaw;
S32 min_dim = llmin(mDetailTextures[i]->getFullWidth(), mDetailTextures[i]->getFullHeight());
S32 ddiscard = 0;
while (min_dim > BASE_SIZE && ddiscard < MAX_DISCARD_LEVEL)
@@ -287,12 +286,18 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
ddiscard++;
min_dim /= 2;
}
- if (!mDetailTextures[i]->readBackRaw(ddiscard, mRawImages[i], false))
+
+ mDetailTextures[i]->reloadRawImage(ddiscard) ;
+ if(mDetailTextures[i]->getRawImageLevel() != ddiscard)//raw iamge is not ready, will enter here again later.
{
- llwarns << "Unable to read raw data for terrain detail texture: " << mDetailTextures[i]->getID() << llendl;
- mRawImages[i] = NULL;
+ mDetailTextures[i]->destroyRawImage() ;
+ lldebugs << "cached raw data for terrain detail texture is not ready yet: " << mDetailTextures[i]->getID() << llendl;
return FALSE;
}
+
+ mRawImages[i] = mDetailTextures[i]->getRawImage() ;
+ mDetailTextures[i]->destroyRawImage() ;
+
if (mDetailTextures[i]->getWidth(ddiscard) != BASE_SIZE ||
mDetailTextures[i]->getHeight(ddiscard) != BASE_SIZE ||
mDetailTextures[i]->getComponents() != 3)