PageRenderTime 339ms CodeModel.GetById 216ms app.highlight 7ms RepoModel.GetById 114ms 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
  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
 27#ifndef LL_LLTEXTUREVIEW_H
 28#define LL_LLTEXTUREVIEW_H
 29
 30#include "llcontainerview.h"
 31
 32class LLViewerFetchedTexture;
 33class LLTextureBar;
 34class LLGLTexMemBar;
 35class LLAvatarTexBar;
 36
 37class LLTextureView : public LLContainerView
 38{
 39	friend class LLTextureBar;
 40	friend class LLGLTexMemBar;
 41	friend class LLAvatarTexBar;
 42protected:
 43	LLTextureView(const Params&);
 44	friend class LLUICtrlFactory;
 45public:
 46	~LLTextureView();
 47
 48	/*virtual*/ void draw();
 49	/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
 50	/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
 51	/*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
 52
 53	static void addDebugImage(LLViewerFetchedTexture* image) { sDebugImages.insert(image); }
 54	static void removeDebugImage(LLViewerFetchedTexture* image) { sDebugImages.insert(image); }
 55	static void clearDebugImages() { sDebugImages.clear(); }
 56
 57private:
 58	BOOL addBar(LLViewerFetchedTexture *image, BOOL hilight = FALSE);
 59	void removeAllBars();
 60
 61private:
 62	BOOL mFreezeView;
 63	BOOL mOrderFetch;
 64	BOOL mPrintList;
 65	
 66	LLTextBox *mInfoTextp;
 67
 68	std::vector<LLTextureBar*> mTextureBars;
 69	U32 mNumTextureBars;
 70
 71	LLGLTexMemBar* mGLTexMemBar;
 72	LLAvatarTexBar* mAvatarTexBar;
 73public:
 74	static std::set<LLViewerFetchedTexture*> sDebugImages;
 75};
 76
 77class LLGLTexSizeBar;
 78class LLTextureSizeView : public LLContainerView
 79{
 80protected:
 81	LLTextureSizeView(const Params&);
 82	friend class LLUICtrlFactory;
 83public:	
 84	~LLTextureSizeView();
 85
 86	/*virtual*/ void draw();
 87	/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) ;
 88	
 89	void setType(S32 type) {mType = type ;}
 90	enum
 91	{
 92		TEXTURE_MEM_OVER_SIZE,
 93		TEXTURE_MEM_OVER_CATEGORY
 94	};
 95private:
 96	//draw background for TEXTURE_MEM_OVER_SIZE
 97	F32 drawTextureSizeDistributionGraph() ;
 98	//draw real-time texture mem bar over size
 99	void drawTextureSizeGraph();
100
101	//draw background for TEXTURE_MEM_OVER_CATEGORY
102	F32 drawTextureCategoryDistributionGraph() ;
103	//draw real-time texture mem bar over category
104	void drawTextureCategoryGraph();
105
106private:
107	std::vector<LLGLTexSizeBar*> mTextureSizeBar ;
108	LLRect mTextureSizeBarRect ;
109	S32    mTextureSizeBarWidth ;	
110	S32    mType ;
111};
112extern LLTextureView *gTextureView;
113extern LLTextureSizeView *gTextureSizeView;
114extern LLTextureSizeView *gTextureCategoryView;
115#endif // LL_TEXTURE_VIEW_H