PageRenderTime 30ms CodeModel.GetById 9ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #include "llviewerprecompiledheaders.h"
  27. #include "pipeline.h"
  28. #include "llagent.h"
  29. #include "lltexturefetch.h"
  30. #include "lltexturestats.h"
  31. #include "lltexturestatsuploader.h"
  32. #include "llviewerregion.h"
  33. void send_texture_stats_to_sim(const LLSD &texture_stats)
  34. {
  35. LLSD texture_stats_report;
  36. // Only send stats if the agent is connected to a region.
  37. if (!gAgent.getRegion())
  38. {
  39. return;
  40. }
  41. LLUUID agent_id = gAgent.getID();
  42. texture_stats_report["agent_id"] = agent_id;
  43. texture_stats_report["region_id"] = gAgent.getRegion()->getRegionID();
  44. texture_stats_report["stats_data"] = texture_stats;
  45. std::string texture_cap_url = gAgent.getRegion()->getCapability("TextureStats");
  46. LLTextureStatsUploader tsu;
  47. llinfos << "uploading texture stats data to simulator" << llendl;
  48. tsu.uploadStatsToSimulator(texture_cap_url, texture_stats);
  49. }