Commit 514df7f7 by Jamie Madill

Remove uses of std::unique_ptr in perftests.

This is disallowed in Chromium because it isn't currently portable. We can put it back later if the rules change. BUG=angleproject:956 Change-Id: I5be28590f494719b8cc995739dde26726283fced Reviewed-on: https://chromium-review.googlesource.com/262777Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org>
parent 2d1eea09
......@@ -15,9 +15,15 @@ ANGLEPerfTest::ANGLEPerfTest(const std::string &name, const std::string &suffix)
: mName(name),
mSuffix(suffix),
mRunning(false),
mTimer(nullptr),
mNumFrames(0)
{
mTimer.reset(CreateTimer());
mTimer = CreateTimer();
}
ANGLEPerfTest::~ANGLEPerfTest()
{
SafeDelete(mTimer);
}
void ANGLEPerfTest::run()
......@@ -81,8 +87,16 @@ ANGLERenderTest::ANGLERenderTest(const std::string &name, const RenderTestParams
: ANGLEPerfTest(name, testParams.suffix()),
mTestParams(testParams),
mDrawIterations(10),
mRunTimeSeconds(5.0)
mRunTimeSeconds(5.0),
mEGLWindow(nullptr),
mOSWindow(nullptr)
{
}
ANGLERenderTest::~ANGLERenderTest()
{
SafeDelete(mOSWindow);
SafeDelete(mEGLWindow);
}
void ANGLERenderTest::SetUp()
......@@ -92,11 +106,11 @@ void ANGLERenderTest::SetUp()
EGL_DONT_CARE,
mTestParams.deviceType);
mOSWindow.reset(CreateOSWindow());
mEGLWindow.reset(new EGLWindow(mTestParams.widowWidth,
mTestParams.windowHeight,
mTestParams.glesMajorVersion,
platformParams));
mOSWindow = CreateOSWindow();
mEGLWindow = new EGLWindow(mTestParams.widowWidth,
mTestParams.windowHeight,
mTestParams.glesMajorVersion,
platformParams);
mEGLWindow->setSwapInterval(0);
if (!mOSWindow->initialize(mName, mEGLWindow->getWidth(), mEGLWindow->getHeight()))
......@@ -105,7 +119,7 @@ void ANGLERenderTest::SetUp()
return;
}
if (!mEGLWindow->initializeGL(mOSWindow.get()))
if (!mEGLWindow->initializeGL(mOSWindow))
{
FAIL() << "Failed initializing EGLWindow";
return;
......@@ -180,5 +194,5 @@ bool ANGLERenderTest::popEvent(Event *event)
OSWindow *ANGLERenderTest::getWindow()
{
return mOSWindow.get();
return mOSWindow;
}
......@@ -11,11 +11,10 @@
#define PERF_TESTS_ANGLE_PERF_TEST_H_
#include <gtest/gtest.h>
#include <memory>
#include <string>
#include <vector>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <string>
#include "EGLWindow.h"
#include "OSWindow.h"
......@@ -28,7 +27,7 @@ class ANGLEPerfTest : public testing::Test, angle::NonCopyable
{
public:
ANGLEPerfTest(const std::string &name, const std::string &suffix);
virtual ~ANGLEPerfTest() { };
virtual ~ANGLEPerfTest();
virtual void step(float dt, double totalTime) = 0;
......@@ -43,7 +42,7 @@ class ANGLEPerfTest : public testing::Test, angle::NonCopyable
std::string mSuffix;
bool mRunning;
std::unique_ptr<Timer> mTimer;
Timer *mTimer;
int mNumFrames;
};
......@@ -62,6 +61,7 @@ class ANGLERenderTest : public ANGLEPerfTest
{
public:
ANGLERenderTest(const std::string &name, const RenderTestParams &testParams);
~ANGLERenderTest();
virtual bool initializeBenchmark() { return true; }
virtual void destroyBenchmark() { }
......@@ -88,8 +88,8 @@ class ANGLERenderTest : public ANGLEPerfTest
void step(float dt, double totalTime) override;
void draw();
std::unique_ptr<EGLWindow> mEGLWindow;
std::unique_ptr<OSWindow> mOSWindow;
EGLWindow *mEGLWindow;
OSWindow *mOSWindow;
};
#endif // PERF_TESTS_ANGLE_PERF_TEST_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment