Commit 2f9b5e6f by Yuly Novikov Committed by Commit Bot

Change angle_util to be a shared library

So that there will be one instance of static thread synchronization variables in AndroidWindow. Previously there was one instance in lib_angle_deqp_gles2_tests__library and one in libangle_deqp_libgles2, resulting in AndroidWindow::initialize waiting forever. BUG=angleproject:1471 Change-Id: Ia529c91e34960eb352730c1bb89a91ce6336c8a0 Reviewed-on: https://chromium-review.googlesource.com/368983 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 6230dd54
...@@ -497,7 +497,7 @@ config("angle_util_config") { ...@@ -497,7 +497,7 @@ config("angle_util_config") {
} }
} }
static_library("angle_util") { shared_library("angle_util") {
sources = rebase_path(util_gypi.util_sources, ".", "util") sources = rebase_path(util_gypi.util_sources, ".", "util")
if (is_win) { if (is_win) {
...@@ -514,6 +514,10 @@ static_library("angle_util") { ...@@ -514,6 +514,10 @@ static_library("angle_util") {
if (is_mac) { if (is_mac) {
sources += rebase_path(util_gypi.util_osx_sources, ".", "util") sources += rebase_path(util_gypi.util_osx_sources, ".", "util")
libs = [
"AppKit.framework",
"QuartzCore.framework",
]
} }
if (use_x11) { if (use_x11) {
...@@ -538,6 +542,7 @@ static_library("angle_util") { ...@@ -538,6 +542,7 @@ static_library("angle_util") {
defines = [ defines = [
"GL_GLEXT_PROTOTYPES", "GL_GLEXT_PROTOTYPES",
"EGL_EGLEXT_PROTOTYPES", "EGL_EGLEXT_PROTOTYPES",
"LIBANGLE_UTIL_IMPLEMENTATION",
] ]
configs += [ configs += [
......
...@@ -10,13 +10,15 @@ ...@@ -10,13 +10,15 @@
#define LIBGLESV2_EXPORT_H_ #define LIBGLESV2_EXPORT_H_
#if defined(_WIN32) #if defined(_WIN32)
# if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) #if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) || \
defined(LIBANGLE_UTIL_IMPLEMENTATION)
# define ANGLE_EXPORT __declspec(dllexport) # define ANGLE_EXPORT __declspec(dllexport)
# else # else
# define ANGLE_EXPORT __declspec(dllimport) # define ANGLE_EXPORT __declspec(dllimport)
# endif # endif
#elif defined(__GNUC__) #elif defined(__GNUC__)
# if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) #if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) || \
defined(LIBANGLE_UTIL_IMPLEMENTATION)
# define ANGLE_EXPORT __attribute__((visibility ("default"))) # define ANGLE_EXPORT __attribute__((visibility ("default")))
# else # else
# define ANGLE_EXPORT # define ANGLE_EXPORT
......
...@@ -303,6 +303,7 @@ if (build_angle_deqp_tests) { ...@@ -303,6 +303,7 @@ if (build_angle_deqp_tests) {
shared_library(shared_library_name) { shared_library(shared_library_name) {
deps = [ deps = [
":angle_deqp_libtester", ":angle_deqp_libtester",
"//third_party/angle:angle_util",
] ]
configs -= deqp_undefine_configs configs -= deqp_undefine_configs
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <stdint.h> #include <stdint.h>
#include <string> #include <string>
#include <export.h>
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#include <GLES3/gl3.h> #include <GLES3/gl3.h>
...@@ -28,7 +29,7 @@ class OSWindow; ...@@ -28,7 +29,7 @@ class OSWindow;
#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE 0x6AC0 #define EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE 0x6AC0
#endif #endif
struct EGLPlatformParameters struct ANGLE_EXPORT EGLPlatformParameters
{ {
EGLint renderer; EGLint renderer;
EGLint majorVersion; EGLint majorVersion;
...@@ -46,10 +47,10 @@ struct EGLPlatformParameters ...@@ -46,10 +47,10 @@ struct EGLPlatformParameters
EGLint presentPath); EGLint presentPath);
}; };
bool operator<(const EGLPlatformParameters &a, const EGLPlatformParameters &b); ANGLE_EXPORT bool operator<(const EGLPlatformParameters &a, const EGLPlatformParameters &b);
bool operator==(const EGLPlatformParameters &a, const EGLPlatformParameters &b); ANGLE_EXPORT bool operator==(const EGLPlatformParameters &a, const EGLPlatformParameters &b);
class EGLWindow : angle::NonCopyable class ANGLE_EXPORT EGLWindow : angle::NonCopyable
{ {
public: public:
EGLWindow(EGLint glesMajorVersion, EGLWindow(EGLint glesMajorVersion,
......
...@@ -10,9 +10,11 @@ ...@@ -10,9 +10,11 @@
#ifndef UTIL_MATRIX_H #ifndef UTIL_MATRIX_H
#define UTIL_MATRIX_H #define UTIL_MATRIX_H
#include <export.h>
#include "Vector.h" #include "Vector.h"
struct Matrix4 struct ANGLE_EXPORT Matrix4
{ {
float data[16]; float data[16];
...@@ -49,13 +51,13 @@ struct Matrix4 ...@@ -49,13 +51,13 @@ struct Matrix4
static Vector3 transform(const Matrix4 &mat, const Vector4 &pt); static Vector3 transform(const Matrix4 &mat, const Vector4 &pt);
}; };
Matrix4 operator*(const Matrix4 &a, const Matrix4 &b); ANGLE_EXPORT Matrix4 operator*(const Matrix4 &a, const Matrix4 &b);
Matrix4 &operator*=(Matrix4 &a, const Matrix4 &b); ANGLE_EXPORT Matrix4 &operator*=(Matrix4 &a, const Matrix4 &b);
Matrix4 operator*(const Matrix4 &a, float b); ANGLE_EXPORT Matrix4 operator*(const Matrix4 &a, float b);
Matrix4 &operator*=(Matrix4 &a, float b); ANGLE_EXPORT Matrix4 &operator*=(Matrix4 &a, float b);
Vector4 operator*(const Matrix4 &a, const Vector4 &b); ANGLE_EXPORT Vector4 operator*(const Matrix4 &a, const Vector4 &b);
bool operator==(const Matrix4 &a, const Matrix4 &b); ANGLE_EXPORT bool operator==(const Matrix4 &a, const Matrix4 &b);
bool operator!=(const Matrix4 &a, const Matrix4 &b); ANGLE_EXPORT bool operator!=(const Matrix4 &a, const Matrix4 &b);
#endif // UTIL_MATRIX_H #endif // UTIL_MATRIX_H
...@@ -11,12 +11,13 @@ ...@@ -11,12 +11,13 @@
#include <stdlib.h> #include <stdlib.h>
#include <export.h>
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include "Event.h" #include "Event.h"
class OSPixmap class ANGLE_EXPORT OSPixmap
{ {
public: public:
OSPixmap() {} OSPixmap() {}
...@@ -27,6 +28,6 @@ class OSPixmap ...@@ -27,6 +28,6 @@ class OSPixmap
virtual EGLNativePixmapType getNativePixmap() const = 0; virtual EGLNativePixmapType getNativePixmap() const = 0;
}; };
OSPixmap *CreateOSPixmap(); ANGLE_EXPORT OSPixmap *CreateOSPixmap();
#endif // SAMPLE_UTIL_PIXMAP_H_ #endif // SAMPLE_UTIL_PIXMAP_H_
...@@ -11,12 +11,13 @@ ...@@ -11,12 +11,13 @@
#include <stdint.h> #include <stdint.h>
#include <string> #include <string>
#include <export.h>
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include "Event.h" #include "Event.h"
class OSWindow class ANGLE_EXPORT OSWindow
{ {
public: public:
OSWindow(); OSWindow();
...@@ -63,6 +64,6 @@ class OSWindow ...@@ -63,6 +64,6 @@ class OSWindow
std::list<Event> mEvents; std::list<Event> mEvents;
}; };
OSWindow *CreateOSWindow(); ANGLE_EXPORT OSWindow *CreateOSWindow();
#endif // SAMPLE_UTIL_WINDOW_H #endif // SAMPLE_UTIL_WINDOW_H
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
#ifndef SAMPLE_UTIL_TIMER_H #ifndef SAMPLE_UTIL_TIMER_H
#define SAMPLE_UTIL_TIMER_H #define SAMPLE_UTIL_TIMER_H
class Timer #include <export.h>
class ANGLE_EXPORT Timer
{ {
public: public:
virtual ~Timer() {} virtual ~Timer() {}
...@@ -16,6 +18,6 @@ class Timer ...@@ -16,6 +18,6 @@ class Timer
virtual double getElapsedTime() const = 0; virtual double getElapsedTime() const = 0;
}; };
Timer *CreateTimer(); ANGLE_EXPORT Timer *CreateTimer();
#endif // SAMPLE_UTIL_TIMER_H #endif // SAMPLE_UTIL_TIMER_H
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
#include <ostream> #include <ostream>
struct Vector2 #include <export.h>
struct ANGLE_EXPORT Vector2
{ {
Vector2(); Vector2();
Vector2(float x, float y); Vector2(float x, float y);
...@@ -31,9 +33,9 @@ struct Vector2 ...@@ -31,9 +33,9 @@ struct Vector2
float x, y; float x, y;
}; };
std::ostream &operator<<(std::ostream &stream, const Vector2 &vec); ANGLE_EXPORT std::ostream &operator<<(std::ostream &stream, const Vector2 &vec);
struct Vector3 struct ANGLE_EXPORT Vector3
{ {
Vector3(); Vector3();
Vector3(float x, float y, float z); Vector3(float x, float y, float z);
...@@ -52,14 +54,14 @@ struct Vector3 ...@@ -52,14 +54,14 @@ struct Vector3
float x, y, z; float x, y, z;
}; };
Vector3 operator*(const Vector3 &a, const Vector3 &b); ANGLE_EXPORT Vector3 operator*(const Vector3 &a, const Vector3 &b);
Vector3 operator*(const Vector3 &a, const float &b); ANGLE_EXPORT Vector3 operator*(const Vector3 &a, const float &b);
Vector3 operator/(const Vector3 &a, const Vector3 &b); ANGLE_EXPORT Vector3 operator/(const Vector3 &a, const Vector3 &b);
Vector3 operator/(const Vector3 &a, const float &b); ANGLE_EXPORT Vector3 operator/(const Vector3 &a, const float &b);
Vector3 operator+(const Vector3 &a, const Vector3 &b); ANGLE_EXPORT Vector3 operator+(const Vector3 &a, const Vector3 &b);
Vector3 operator-(const Vector3 &a, const Vector3 &b); ANGLE_EXPORT Vector3 operator-(const Vector3 &a, const Vector3 &b);
struct Vector4 struct ANGLE_EXPORT Vector4
{ {
Vector4(); Vector4();
Vector4(float x, float y, float z, float w); Vector4(float x, float y, float z, float w);
......
...@@ -13,10 +13,12 @@ ...@@ -13,10 +13,12 @@
// TODO(jmadill): Rework this if Chromium decides to ban <random> // TODO(jmadill): Rework this if Chromium decides to ban <random>
#include <random> #include <random>
#include <export.h>
namespace angle namespace angle
{ {
class RNG class ANGLE_EXPORT RNG
{ {
public: public:
// Seed from clock // Seed from clock
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#ifndef SAMPLE_UTIL_SHADER_UTILS_H #ifndef SAMPLE_UTIL_SHADER_UTILS_H
#define SAMPLE_UTIL_SHADER_UTILS_H #define SAMPLE_UTIL_SHADER_UTILS_H
#include <export.h>
#include <GLES3/gl3.h> #include <GLES3/gl3.h>
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
...@@ -18,15 +19,15 @@ ...@@ -18,15 +19,15 @@
#define SHADER_SOURCE(...) #__VA_ARGS__ #define SHADER_SOURCE(...) #__VA_ARGS__
GLuint CompileShader(GLenum type, const std::string &source); ANGLE_EXPORT GLuint CompileShader(GLenum type, const std::string &source);
GLuint CompileShaderFromFile(GLenum type, const std::string &sourcePath); ANGLE_EXPORT GLuint CompileShaderFromFile(GLenum type, const std::string &sourcePath);
GLuint CompileProgramWithTransformFeedback( ANGLE_EXPORT GLuint
const std::string &vsSource, CompileProgramWithTransformFeedback(const std::string &vsSource,
const std::string &fsSource, const std::string &fsSource,
const std::vector<std::string> &transformFeedbackVaryings, const std::vector<std::string> &transformFeedbackVaryings,
GLenum bufferMode); GLenum bufferMode);
GLuint CompileProgram(const std::string &vsSource, const std::string &fsSource); ANGLE_EXPORT GLuint CompileProgram(const std::string &vsSource, const std::string &fsSource);
GLuint CompileProgramFromFiles(const std::string &vsPath, const std::string &fsPath); ANGLE_EXPORT GLuint CompileProgramFromFiles(const std::string &vsPath, const std::string &fsPath);
#endif // SAMPLE_UTIL_SHADER_UTILS_H #endif // SAMPLE_UTIL_SHADER_UTILS_H
...@@ -11,31 +11,33 @@ ...@@ -11,31 +11,33 @@
#include <string> #include <string>
#include <export.h>
#include "common/angleutils.h" #include "common/angleutils.h"
namespace angle namespace angle
{ {
std::string GetExecutablePath(); ANGLE_EXPORT std::string GetExecutablePath();
std::string GetExecutableDirectory(); ANGLE_EXPORT std::string GetExecutableDirectory();
std::string GetSharedLibraryExtension(); ANGLE_EXPORT std::string GetSharedLibraryExtension();
// Cross platform equivalent of the Windows Sleep function // Cross platform equivalent of the Windows Sleep function
void Sleep(unsigned int milliseconds); ANGLE_EXPORT void Sleep(unsigned int milliseconds);
void SetLowPriorityProcess(); ANGLE_EXPORT void SetLowPriorityProcess();
// Write a debug message, either to a standard output or Debug window. // Write a debug message, either to a standard output or Debug window.
void WriteDebugMessage(const char *format, ...); ANGLE_EXPORT void WriteDebugMessage(const char *format, ...);
class Library : angle::NonCopyable class ANGLE_EXPORT Library : angle::NonCopyable
{ {
public: public:
virtual ~Library() {} virtual ~Library() {}
virtual void *getSymbol(const std::string &symbolName) = 0; virtual void *getSymbol(const std::string &symbolName) = 0;
}; };
Library *loadLibrary(const std::string &libraryName); ANGLE_EXPORT Library *loadLibrary(const std::string &libraryName);
} // namespace angle } // namespace angle
......
...@@ -14,9 +14,11 @@ ...@@ -14,9 +14,11 @@
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Xresource.h> #include <X11/Xresource.h>
#include <export.h>
#include "OSWindow.h" #include "OSWindow.h"
class X11Window : public OSWindow class ANGLE_EXPORT X11Window : public OSWindow
{ {
public: public:
X11Window(); X11Window();
......
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