diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2024-02-20 16:10:05 -0800 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2024-02-20 16:23:41 -0800 |
commit | bbc7d63a79b9744acaff51315e5e9a9d7299bd12 (patch) | |
tree | 48a53a596d9cbc5c343dfcd001c320ed0c93b598 /indra | |
parent | ab9ec50df9dda3ac52752d44b7d5529ed26db7bf (diff) |
secondlife/viewer-issues#72: Clean up material preview when hidden or floater closed
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 15 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 5415f9bd9a..d9001bc16a 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -538,6 +538,8 @@ void LLFloaterTexturePicker::onClose(bool app_quitting) } stopUsingPipette(); sLastPickerMode = mModeSelector->getValue().asInteger(); + // *NOTE: Vertex buffer for sphere preview is still cached + mGLTFPreview = nullptr; } // virtual @@ -1760,6 +1762,19 @@ void LLTextureCtrl::setFilterPermissionMasks(PermissionMask mask) setDnDFilterPermMask(mask); } +void LLTextureCtrl::onVisibilityChange(BOOL new_visibility) +{ + if (!new_visibility) + { + // *NOTE: Vertex buffer for sphere preview is still cached + mGLTFPreview = nullptr; + } + else + { + llassert(!mGLTFPreview); + } +} + void LLTextureCtrl::setVisible( BOOL visible ) { if( !visible ) diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 05ea185b1b..a19c8b6e3d 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -160,6 +160,8 @@ public: virtual void setVisible( BOOL visible ); virtual void setEnabled( BOOL enabled ); + void onVisibilityChange(BOOL new_visibility) override; + void setValid(BOOL valid); // LLUICtrl interface |