PageRenderTime 61ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/lltextureview.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 115 lines | 70 code | 16 blank | 29 comment | 0 complexity | 911789c8a868cb982a0a821604847c58 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lltextureview.h
  3. * @brief LLTextureView class header file
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLTEXTUREVIEW_H
  27. #define LL_LLTEXTUREVIEW_H
  28. #include "llcontainerview.h"
  29. class LLViewerFetchedTexture;
  30. class LLTextureBar;
  31. class LLGLTexMemBar;
  32. class LLAvatarTexBar;
  33. class LLTextureView : public LLContainerView
  34. {
  35. friend class LLTextureBar;
  36. friend class LLGLTexMemBar;
  37. friend class LLAvatarTexBar;
  38. protected:
  39. LLTextureView(const Params&);
  40. friend class LLUICtrlFactory;
  41. public:
  42. ~LLTextureView();
  43. /*virtual*/ void draw();
  44. /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
  45. /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
  46. /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
  47. static void addDebugImage(LLViewerFetchedTexture* image) { sDebugImages.insert(image); }
  48. static void removeDebugImage(LLViewerFetchedTexture* image) { sDebugImages.insert(image); }
  49. static void clearDebugImages() { sDebugImages.clear(); }
  50. private:
  51. BOOL addBar(LLViewerFetchedTexture *image, BOOL hilight = FALSE);
  52. void removeAllBars();
  53. private:
  54. BOOL mFreezeView;
  55. BOOL mOrderFetch;
  56. BOOL mPrintList;
  57. LLTextBox *mInfoTextp;
  58. std::vector<LLTextureBar*> mTextureBars;
  59. U32 mNumTextureBars;
  60. LLGLTexMemBar* mGLTexMemBar;
  61. LLAvatarTexBar* mAvatarTexBar;
  62. public:
  63. static std::set<LLViewerFetchedTexture*> sDebugImages;
  64. };
  65. class LLGLTexSizeBar;
  66. class LLTextureSizeView : public LLContainerView
  67. {
  68. protected:
  69. LLTextureSizeView(const Params&);
  70. friend class LLUICtrlFactory;
  71. public:
  72. ~LLTextureSizeView();
  73. /*virtual*/ void draw();
  74. /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) ;
  75. void setType(S32 type) {mType = type ;}
  76. enum
  77. {
  78. TEXTURE_MEM_OVER_SIZE,
  79. TEXTURE_MEM_OVER_CATEGORY
  80. };
  81. private:
  82. //draw background for TEXTURE_MEM_OVER_SIZE
  83. F32 drawTextureSizeDistributionGraph() ;
  84. //draw real-time texture mem bar over size
  85. void drawTextureSizeGraph();
  86. //draw background for TEXTURE_MEM_OVER_CATEGORY
  87. F32 drawTextureCategoryDistributionGraph() ;
  88. //draw real-time texture mem bar over category
  89. void drawTextureCategoryGraph();
  90. private:
  91. std::vector<LLGLTexSizeBar*> mTextureSizeBar ;
  92. LLRect mTextureSizeBarRect ;
  93. S32 mTextureSizeBarWidth ;
  94. S32 mType ;
  95. };
  96. extern LLTextureView *gTextureView;
  97. extern LLTextureSizeView *gTextureSizeView;
  98. extern LLTextureSizeView *gTextureCategoryView;
  99. #endif // LL_TEXTURE_VIEW_H