PageRenderTime 25ms CodeModel.GetById 13ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/newview/lltexturestats.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 55 lines | 23 code | 6 blank | 26 comment | 1 complexity | 9c558e068992d9234b28717fb1aa654c MD5 | raw file
 1/** 
 2 * @file lltexturerstats.cpp
 3 * @brief texture stats helper methods
 4 *
 5 * $LicenseInfo:firstyear=2002&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#include "llviewerprecompiledheaders.h"
28
29#include "pipeline.h" 
30#include "llagent.h"
31#include "lltexturefetch.h" 
32#include "lltexturestats.h"
33#include "lltexturestatsuploader.h"
34#include "llviewerregion.h"
35
36void send_texture_stats_to_sim(const LLSD &texture_stats)
37{
38	LLSD texture_stats_report;
39	// Only send stats if the agent is connected to a region.
40	if (!gAgent.getRegion())
41	{
42		return;
43	}
44
45	LLUUID agent_id = gAgent.getID();
46	texture_stats_report["agent_id"] = agent_id;
47	texture_stats_report["region_id"] = gAgent.getRegion()->getRegionID();
48	texture_stats_report["stats_data"] = texture_stats;
49
50	std::string texture_cap_url = gAgent.getRegion()->getCapability("TextureStats");
51	LLTextureStatsUploader tsu;
52	llinfos << "uploading texture stats data to simulator" << llendl;
53	tsu.uploadStatsToSimulator(texture_cap_url, texture_stats);
54}
55