PageRenderTime 15ms CodeModel.GetById 10ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/lltextureinfo.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 74 lines | 40 code | 9 blank | 25 comment | 0 complexity | 54f0da106c4337ab994a7ac163e27b1f MD5 | raw file
 1/** 
 2 * @file lltextureinfo.h
 3 * @brief Object for managing texture information.
 4 *
 5 * $LicenseInfo:firstyear=2000&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_LLTEXTUREINFO_H
28#define LL_LLTEXTUREINFO_H
29
30#include "lluuid.h"
31#include "lltextureinfodetails.h"
32#include <map>
33
34class LLTextureInfo
35{
36public:
37	LLTextureInfo();
38	~LLTextureInfo();
39
40	void setUpLogging(bool writeToViewerLog, bool sendToSim, U32 textureLogThreshold);
41	bool has(const LLUUID& id);
42	void setRequestStartTime(const LLUUID& id, U64 startTime);
43	void setRequestSize(const LLUUID& id, U32 size);
44	void setRequestOffset(const LLUUID& id, U32 offset);
45	void setRequestType(const LLUUID& id, LLTextureInfoDetails::LLRequestType type);
46	void setRequestCompleteTimeAndLog(const LLUUID& id, U64 completeTime);
47	U32 getRequestStartTime(const LLUUID& id);
48	U32 getRequestSize(const LLUUID& id);
49	U32 getRequestOffset(const LLUUID& id);
50	LLTextureInfoDetails::LLRequestType getRequestType(const LLUUID& id);
51	U32 getRequestCompleteTime(const LLUUID& id);
52	void resetTextureStatistics();
53	U32 getTextureInfoMapSize();
54	LLSD getAverages();
55
56private:
57	void addRequest(const LLUUID& id);
58
59	std::map<LLUUID, LLTextureInfoDetails *> mTextures;
60
61	LLSD mAverages;
62
63	bool mLogTextureDownloadsToViewerLog;
64	bool mLogTextureDownloadsToSimulator;
65	S32 mTotalBytes;
66	S32 mTotalMilliseconds;
67	S32 mTextureDownloadsStarted;
68	S32 mTextureDownloadsCompleted;
69	std::string mTextureDownloadProtocol;
70	U32 mTextureLogThreshold; // in bytes
71	U64 mCurrentStatsBundleStartTime;
72};
73
74#endif // LL_LLTEXTUREINFO_H