Commit 2d1eea09 by Jamie Madill

Remove shared_utils.h, use angle_common instead.

*re-land with fix for Chromium compile* This saves us from needing to replicate the same code in two places. BUG=angleproject:956 Change-Id: I68dffee715df03bd25685e3ed5c0506ffc41c3b9 Reviewed-on: https://chromium-review.googlesource.com/263258Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org>
parent f0d10f89
...@@ -52,13 +52,17 @@ ...@@ -52,13 +52,17 @@
'includes': [ '../build/common_defines.gypi', ], 'includes': [ '../build/common_defines.gypi', ],
'dependencies': 'dependencies':
[ [
'../src/angle.gyp:libEGL', '<(angle_path)/src/angle.gyp:libEGL',
'../src/angle.gyp:libGLESv2', '<(angle_path)/src/angle.gyp:libGLESv2',
'../util/util.gyp:angle_util', '<(angle_path)/util/util.gyp:angle_util',
],
'export_dependent_settings':
[
'<(angle_path)/util/util.gyp:angle_util',
], ],
'include_dirs': 'include_dirs':
[ [
'../include', '<(angle_path)/include',
'angle/sample_util', 'angle/sample_util',
], ],
'sources': 'sources':
...@@ -71,9 +75,7 @@ ...@@ -71,9 +75,7 @@
'msvs_disabled_warnings': [ 4201 ], 'msvs_disabled_warnings': [ 4201 ],
'include_dirs': 'include_dirs':
[ [
'../include',
'angle/sample_util', 'angle/sample_util',
'../util',
], ],
}, },
}, },
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "angle_gl.h" #include "angle_gl.h"
#include <algorithm> #include <algorithm>
#include "shared_utils.h" #include "common/angleutils.h"
#include "shader_utils.h" #include "shader_utils.h"
#include "testfixturetypes.h" #include "testfixturetypes.h"
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
#include "EGLWindow.h" #include "EGLWindow.h"
#include "OSWindow.h" #include "OSWindow.h"
#include "Timer.h" #include "Timer.h"
#include "shared_utils.h" #include "common/angleutils.h"
class Event; class Event;
class ANGLEPerfTest : public testing::Test class ANGLEPerfTest : public testing::Test, angle::NonCopyable
{ {
public: public:
ANGLEPerfTest(const std::string &name, const std::string &suffix); ANGLEPerfTest(const std::string &name, const std::string &suffix);
...@@ -32,8 +32,6 @@ class ANGLEPerfTest : public testing::Test ...@@ -32,8 +32,6 @@ class ANGLEPerfTest : public testing::Test
virtual void step(float dt, double totalTime) = 0; virtual void step(float dt, double totalTime) = 0;
DISALLOW_COPY_AND_ASSIGN(ANGLEPerfTest);
protected: protected:
void run(); void run();
void printResult(const std::string &trace, double value, const std::string &units, bool important) const; void printResult(const std::string &trace, double value, const std::string &units, bool important) const;
...@@ -84,8 +82,6 @@ class ANGLERenderTest : public ANGLEPerfTest ...@@ -84,8 +82,6 @@ class ANGLERenderTest : public ANGLEPerfTest
double mRunTimeSeconds; double mRunTimeSeconds;
private: private:
DISALLOW_COPY_AND_ASSIGN(ANGLERenderTest);
void SetUp() override; void SetUp() override;
void TearDown() override; void TearDown() override;
......
...@@ -43,8 +43,6 @@ class BufferSubDataBenchmark : public ANGLERenderTest, ...@@ -43,8 +43,6 @@ class BufferSubDataBenchmark : public ANGLERenderTest,
void drawBenchmark() override; void drawBenchmark() override;
private: private:
DISALLOW_COPY_AND_ASSIGN(BufferSubDataBenchmark);
GLuint mProgram; GLuint mProgram;
GLuint mBuffer; GLuint mBuffer;
uint8_t *mUpdateData; uint8_t *mUpdateData;
......
...@@ -42,8 +42,6 @@ class PointSpritesBenchmark : public ANGLERenderTest, ...@@ -42,8 +42,6 @@ class PointSpritesBenchmark : public ANGLERenderTest,
void drawBenchmark() override; void drawBenchmark() override;
private: private:
DISALLOW_COPY_AND_ASSIGN(PointSpritesBenchmark);
GLuint mProgram; GLuint mProgram;
GLuint mBuffer; GLuint mBuffer;
}; };
......
...@@ -40,7 +40,6 @@ class TexSubImageBenchmark : public ANGLERenderTest, ...@@ -40,7 +40,6 @@ class TexSubImageBenchmark : public ANGLERenderTest,
void drawBenchmark() override; void drawBenchmark() override;
private: private:
DISALLOW_COPY_AND_ASSIGN(TexSubImageBenchmark);
GLuint createTexture(); GLuint createTexture();
// Handle to a program object // Handle to a program object
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>
#include "shared_utils.h" #include "common/angleutils.h"
class OSWindow; class OSWindow;
...@@ -43,7 +43,7 @@ struct EGLPlatformParameters ...@@ -43,7 +43,7 @@ struct EGLPlatformParameters
EGLPlatformParameters(EGLint renderer, EGLint majorVersion, EGLint minorVersion, EGLint deviceType); EGLPlatformParameters(EGLint renderer, EGLint majorVersion, EGLint minorVersion, EGLint deviceType);
}; };
class EGLWindow class EGLWindow : angle::NonCopyable
{ {
public: public:
EGLWindow(size_t width, size_t height, EGLint glesMajorVersion, const EGLPlatformParameters &platform); EGLWindow(size_t width, size_t height, EGLint glesMajorVersion, const EGLPlatformParameters &platform);
...@@ -85,8 +85,6 @@ class EGLWindow ...@@ -85,8 +85,6 @@ class EGLWindow
void destroyGL(); void destroyGL();
private: private:
DISALLOW_COPY_AND_ASSIGN(EGLWindow);
EGLConfig mConfig; EGLConfig mConfig;
EGLDisplay mDisplay; EGLDisplay mDisplay;
EGLSurface mSurface; EGLSurface mSurface;
......
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#ifndef UTIL_SHARED_UTILS_H
#define UTIL_SHARED_UTILS_H
#define SHADER_SOURCE(...) #__VA_ARGS__
// A macro to disallow the copy constructor and operator= functions
// This must be used in the private: declarations for a class
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
template <typename T, size_t N>
inline size_t ArraySize(T(&)[N])
{
return N;
}
#endif // UTIL_SHARED_UTILS_H
...@@ -15,13 +15,18 @@ ...@@ -15,13 +15,18 @@
'includes': [ '../build/common_defines.gypi', ], 'includes': [ '../build/common_defines.gypi', ],
'dependencies': 'dependencies':
[ [
'../src/angle.gyp:libEGL', '<(angle_path)/src/angle.gyp:angle_common',
'../src/angle.gyp:libGLESv2', '<(angle_path)/src/angle.gyp:libEGL',
'<(angle_path)/src/angle.gyp:libGLESv2',
],
'export_dependent_settings':
[
'<(angle_path)/src/angle.gyp:angle_common',
], ],
'include_dirs': 'include_dirs':
[ [
'../include', '<(angle_path)/include',
'.', '<(angle_path)/util',
], ],
'sources': 'sources':
[ [
...@@ -32,7 +37,6 @@ ...@@ -32,7 +37,6 @@
'random_utils.h', 'random_utils.h',
'shader_utils.cpp', 'shader_utils.cpp',
'shader_utils.h', 'shader_utils.h',
'shared_utils.h',
'testfixturetypes.h', 'testfixturetypes.h',
'EGLWindow.cpp', 'EGLWindow.cpp',
'EGLWindow.h', 'EGLWindow.h',
...@@ -51,7 +55,8 @@ ...@@ -51,7 +55,8 @@
{ {
'include_dirs': 'include_dirs':
[ [
'.', '<(angle_path)/include',
'<(angle_path)/util',
], ],
}, },
}, },
......
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