diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-06-04 14:56:24 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-06-04 14:56:24 -0400 |
commit | 36a10312a5c7d9dec7124cf969039ff5d1ac24c0 (patch) | |
tree | 4242005f3a9568b4bd40cd1d6a5ec53e30102c27 | |
parent | cfc98d7e374d0e9a236ed4e1bd78faeecfb5ba2a (diff) |
EXT-7526 WIP Add baked texture information to texture view
More informative logic added in to track when an upload is actually happening.
Did some minor reformatting.
-rw-r--r-- | indra/newview/lltexlayer.cpp | 25 | ||||
-rw-r--r-- | indra/newview/lltexlayer.h | 7 | ||||
-rw-r--r-- | indra/newview/lltextureview.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 2 |
4 files changed, 35 insertions, 12 deletions
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index 871231a1f5..d001d692a3 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -322,6 +322,21 @@ BOOL LLTexLayerSetBuffer::isInitialized(void) const return mGLTexturep.notNull() && mGLTexturep->isGLTextureCreated(); } +BOOL LLTexLayerSetBuffer::uploadPending() const +{ + return mUploadPending; +} + +BOOL LLTexLayerSetBuffer::uploadNeeded() const +{ + return mNeedsUpload; +} + +BOOL LLTexLayerSetBuffer::uploadInProgress() const +{ + return !mUploadID.isNull(); +} + BOOL LLTexLayerSetBuffer::isReadyToUpload() const { if (!mNeedsUpload) return FALSE; // Don't need to upload if we haven't requested one. @@ -2288,10 +2303,12 @@ const std::string LLTexLayerSetBuffer::dumpTextureInfo() const const U32 num_low_res = mNumLowresUploads; const U32 upload_time = (U32)mNeedsUploadTimer.getElapsedTimeF32(); const std::string local_texture_info = gAgentAvatarp->debugDumpLocalTextureDataInfo(mTexLayerSet); - std::string status = "CREATING "; - if (!mNeedsUpload) status = " DONE "; - if (mUploadPending) status = "UPLOADING"; - std::string text = llformat("[ %s ] [ HiRes:%d LoRes:%d ] [ Timer:%d ] %s", + + std::string status = "CREATING "; + if (!uploadNeeded()) status = "DONE "; + if (uploadInProgress()) status = "UPLOADING"; + + std::string text = llformat("[%s] [HiRes:%d LoRes:%d] [Elapsed:%d] %s", status.c_str(), is_high_res, num_low_res, upload_time, diff --git a/indra/newview/lltexlayer.h b/indra/newview/lltexlayer.h index fa49b245bc..cb2e1faaa6 100644 --- a/indra/newview/lltexlayer.h +++ b/indra/newview/lltexlayer.h @@ -277,8 +277,9 @@ public: BOOL updateImmediate(); BOOL isInitialized(void) const; - BOOL uploadPending() const { return mUploadPending; } - BOOL uploadNeeded() const { return mNeedsUpload; } + BOOL uploadPending() const; // We are expecting a new texture to be uploaded at some point + BOOL uploadNeeded() const; // We need to upload a new texture + BOOL uploadInProgress() const; // We have started uploading a new texture and are awaiting the result /*virtual*/ BOOL needsRender(); void requestUpdate(); @@ -305,7 +306,7 @@ private: LLTexLayerSet* const mTexLayerSet; BOOL mNeedsUpdate; // whether we need to update our baked textures BOOL mNeedsUpload; // whether we need to send our baked textures to the server - U32 mNumLowresUploads; // mumber of times we've sent a lowres version of our baked textures to the server + U32 mNumLowresUploads; // number of times we've sent a lowres version of our baked textures to the server BOOL mUploadPending; // whether we have received back the new baked textures LLUUID mUploadID; // the current upload process (null if none). Used to avoid overlaps, e.g. when the user rapidly makes two changes outside of Face Edit. static S32 sGLByteCount; diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 9a946f4631..8ea4dbeb04 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -418,6 +418,7 @@ void LLAvatarTexBar::draw() const S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); const S32 v_offset = 0; + const S32 l_offset = 3; //---------------------------------------------------------------------------- LLGLSUIDefault gls_ui; @@ -440,12 +441,12 @@ void LLAvatarTexBar::draw() { text_color = LLColor4::red; } - if (layerset_buffer->uploadPending()) + if (layerset_buffer->uploadInProgress()) { text_color = LLColor4::magenta; } std::string text = layerset_buffer->dumpTextureInfo(); - LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*line_num, + LLFontGL::getFontMonospace()->renderUTF8(text, 0, l_offset, v_offset + line_height*line_num, text_color, LLFontGL::LEFT, LLFontGL::TOP); //, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT); line_num++; } @@ -457,7 +458,11 @@ void LLAvatarTexBar::draw() const std::string texture_timeout_str = texture_timeout ? llformat("%d",texture_timeout) : "Disabled"; const std::string override_tex_discard_level_str = override_tex_discard_level ? llformat("%d",override_tex_discard_level) : "Disabled"; std::string header_text = llformat("[ Timeout('AvatarBakedTextureTimeout'):%s ] [ LOD_Override('TextureDiscardLevel'):%s ]", texture_timeout_str.c_str(), override_tex_discard_level_str.c_str()); - LLFontGL::getFontMonospace()->renderUTF8(header_text, 0, 0, v_offset + line_height*line_num, + LLFontGL::getFontMonospace()->renderUTF8(header_text, 0, l_offset, v_offset + line_height*line_num, + header_color, LLFontGL::LEFT, LLFontGL::TOP); //, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT); + line_num++; + std::string section_text = "Avatar Textures Information:"; + LLFontGL::getFontMonospace()->renderUTF8(section_text, 0, 0, v_offset + line_height*line_num, header_color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT); } @@ -469,7 +474,7 @@ BOOL LLAvatarTexBar::handleMouseDown(S32 x, S32 y, MASK mask) LLRect LLAvatarTexBar::getRequiredRect() { LLRect rect; - rect.mTop = 85; + rect.mTop = 100; if (!gSavedSettings.getBOOL("DebugAvatarRezTime")) rect.mTop = 0; return rect; } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index e18b617120..4a04ec22c4 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1884,7 +1884,7 @@ const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLTexLayer if (layerset == mBakedTextureDatas[baked_index].mTexLayerSet) { const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second; - text += llformat("[%d] '%s' ( ",baked_index, baked_dict->mName.c_str()); + text += llformat("%d-%s ( ",baked_index, baked_dict->mName.c_str()); for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin(); local_tex_iter != baked_dict->mLocalTextures.end(); ++local_tex_iter) |