From c180fe2ae2b5d2e00149f9902717e02ed7042143 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 19 Nov 2012 22:28:12 -0700 Subject: for SH-3561: capture the frame buffer contents and compare pixel differences between frames. --- indra/newview/llscenemonitor.h | 87 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 indra/newview/llscenemonitor.h (limited to 'indra/newview/llscenemonitor.h') diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h new file mode 100644 index 0000000000..941039cefd --- /dev/null +++ b/indra/newview/llscenemonitor.h @@ -0,0 +1,87 @@ +/** + * @file llscenemonitor.h + * @brief monitor the process of scene loading + * + * $LicenseInfo:firstyear=2003&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLSCENE_MONITOR_H +#define LL_LLSCENE_MONITOR_H + +#include "llsingleton.h" +#include "llmath.h" +#include "llfloater.h" +#include "llcharacter.h" + +class LLCharacter; +class LLRenderTarget; + +class LLSceneMonitor : public LLSingleton +{ +public: + LLSceneMonitor(); + ~LLSceneMonitor(); + + void destroyClass(); + + void freezeAvatar(LLCharacter* avatarp); + void setEnabled(bool enabled); + + void capture(); //capture the main frame buffer + void compare(); //compare the stored two buffers. + + LLRenderTarget* getDiffTarget() const; + bool isEnabled()const {return mEnabled;} + +private: + void freezeScene(); + void unfreezeScene(); + void reset(); + bool preCapture(); + void postCapture(); + +private: + BOOL mEnabled; + BOOL mNeedsUpdateDiff; + LLRenderTarget* mFrames[2]; + LLRenderTarget* mDiff; + LLRenderTarget* mCurTarget; + + std::vector mAvatarPauseHandles; +}; + +class LLSceneMonitorView : public LLFloater +{ +public: + LLSceneMonitorView(const LLRect& rect); + + virtual void draw(); + virtual void setVisible(BOOL visible); + +protected: + virtual void onClickCloseBtn(); +}; + +extern LLSceneMonitorView* gSceneMonitorView; + +#endif + -- cgit v1.2.3 From 6ae6abae26200c80a15d2e2d899ae6970602ff04 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 21 Nov 2012 13:29:15 -0700 Subject: more for SH-3571: display frame-to-frame pixel differences on screen --- indra/newview/llscenemonitor.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llscenemonitor.h') diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h index 941039cefd..648429f97b 100644 --- a/indra/newview/llscenemonitor.h +++ b/indra/newview/llscenemonitor.h @@ -44,7 +44,7 @@ public: void destroyClass(); void freezeAvatar(LLCharacter* avatarp); - void setEnabled(bool enabled); + void setDebugViewerVisible(BOOL visible); void capture(); //capture the main frame buffer void compare(); //compare the stored two buffers. @@ -62,6 +62,8 @@ private: private: BOOL mEnabled; BOOL mNeedsUpdateDiff; + BOOL mDebugViewerVisible; + LLRenderTarget* mFrames[2]; LLRenderTarget* mDiff; LLRenderTarget* mCurTarget; -- cgit v1.2.3 From 21409a3aaaef71102195d65fc35cebdb5d941a26 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 30 Nov 2012 22:50:06 -0700 Subject: for SH-3350 and SH-3353: Report frame-to-frame visual deltas as an LLStat --- indra/newview/llscenemonitor.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'indra/newview/llscenemonitor.h') diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h index 648429f97b..db5ac3eeef 100644 --- a/indra/newview/llscenemonitor.h +++ b/indra/newview/llscenemonitor.h @@ -48,8 +48,14 @@ public: void capture(); //capture the main frame buffer void compare(); //compare the stored two buffers. + void queryDiff(); + void fetchQueryResult(); + void calcDiffAggregate(); + void setDiffTolerance(F32 tol) {mDiffTolerance = tol;} - LLRenderTarget* getDiffTarget() const; + const LLRenderTarget* getDiffTarget() const {return mDiff;} + F32 getDiffTolerance() const {return mDiffTolerance;} + F32 getDiffResult() const { return mDiffResult;} bool isEnabled()const {return mEnabled;} private: @@ -57,17 +63,22 @@ private: void unfreezeScene(); void reset(); bool preCapture(); - void postCapture(); - + private: BOOL mEnabled; BOOL mNeedsUpdateDiff; + BOOL mHasNewDiff; + BOOL mHasNewQueryResult; BOOL mDebugViewerVisible; LLRenderTarget* mFrames[2]; LLRenderTarget* mDiff; LLRenderTarget* mCurTarget; + GLuint mQueryObject; //used for glQuery + F32 mDiffResult; //aggregate results of mDiff. + F32 mDiffTolerance; //pixels are filtered out when R+G+B < mDiffTolerance + std::vector mAvatarPauseHandles; }; -- cgit v1.2.3 From 0270ce079c2090cd25244516648ac1691db00a0d Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Sun, 2 Dec 2012 22:12:43 -0700 Subject: more for SH-3350, add debug texts --- indra/newview/llscenemonitor.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llscenemonitor.h') diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h index db5ac3eeef..ce25467a21 100644 --- a/indra/newview/llscenemonitor.h +++ b/indra/newview/llscenemonitor.h @@ -56,6 +56,8 @@ public: const LLRenderTarget* getDiffTarget() const {return mDiff;} F32 getDiffTolerance() const {return mDiffTolerance;} F32 getDiffResult() const { return mDiffResult;} + F32 getSamplingTime() const { return mSamplingTime;} + F32 getDiffPixelRatio() const { return mDiffPixelRatio;} bool isEnabled()const {return mEnabled;} private: @@ -79,6 +81,9 @@ private: F32 mDiffResult; //aggregate results of mDiff. F32 mDiffTolerance; //pixels are filtered out when R+G+B < mDiffTolerance + F32 mSamplingTime; //time interval to capture frames, in seconds + F32 mDiffPixelRatio; //ratio of pixels used for comparison against the original mDiff size along one dimension + std::vector mAvatarPauseHandles; }; -- cgit v1.2.3 From 1fbd45672fcb1e5bfc194712fc7d0d4847a651cd Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 19 Dec 2012 23:21:31 -0700 Subject: fix for SH-3640: Can not edit objects --- indra/newview/llscenemonitor.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llscenemonitor.h') diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h index ce25467a21..02e3d57d46 100644 --- a/indra/newview/llscenemonitor.h +++ b/indra/newview/llscenemonitor.h @@ -59,6 +59,7 @@ public: F32 getSamplingTime() const { return mSamplingTime;} F32 getDiffPixelRatio() const { return mDiffPixelRatio;} bool isEnabled()const {return mEnabled;} + bool needsUpdate() const; private: void freezeScene(); -- cgit v1.2.3