Commit 8bc361e1 by Geoff Lang

Support compiling libANGLE as a static or shared library.

BUG=angle:733 Change-Id: If27d3330534bce0f5b691010ea7d97bcb7579122 Reviewed-on: https://chromium-review.googlesource.com/231052Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 4f4207f7
...@@ -155,9 +155,6 @@ if (is_win) { ...@@ -155,9 +155,6 @@ if (is_win) {
if (angle_enable_d3d11) { if (angle_enable_d3d11) {
defines += [ "ANGLE_ENABLE_D3D11" ] defines += [ "ANGLE_ENABLE_D3D11" ]
} }
if (is_debug) {
defines += [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ]
}
defines += [ defines += [
"GL_APICALL=", "GL_APICALL=",
"GL_GLEXT_PROTOTYPES=", "GL_GLEXT_PROTOTYPES=",
...@@ -165,7 +162,7 @@ if (is_win) { ...@@ -165,7 +162,7 @@ if (is_win) {
] ]
} }
static_library("libANGLE") { shared_library("libANGLE") {
sources = rebase_path(gles_gypi.libangle_sources, ".", "src") sources = rebase_path(gles_gypi.libangle_sources, ".", "src")
sources += rebase_path(gles_gypi.libangle_common_sources, ".", "src") sources += rebase_path(gles_gypi.libangle_common_sources, ".", "src")
...@@ -191,11 +188,13 @@ if (is_win) { ...@@ -191,11 +188,13 @@ if (is_win) {
if (is_debug) { if (is_debug) {
defines += [ defines += [
"ANGLE_GENERATE_SHADER_DEBUG_INFO", "ANGLE_GENERATE_SHADER_DEBUG_INFO",
"ANGLE_ENABLE_DEBUG_ANNOTATIONS",
] ]
libs += [ "d3d9.lib" ] libs += [ "d3d9.lib" ]
} }
defines += [ defines += [
"LIBANGLE_IMPLEMENTATION",
"ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " + "ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " +
"\"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }", "\"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }",
] ]
...@@ -223,6 +222,14 @@ if (is_win) { ...@@ -223,6 +222,14 @@ if (is_win) {
shared_library("libGLESv2") { shared_library("libGLESv2") {
sources = [ sources = [
"src/common/angleutils.cpp",
"src/common/angleutils.h",
"src/common/debug.cpp",
"src/common/debug.h",
"src/common/event_tracer.cpp",
"src/common/event_tracer.h",
"src/common/tls.cpp",
"src/common/tls.h",
"src/libGLESv2/libGLESv2.cpp", "src/libGLESv2/libGLESv2.cpp",
"src/libGLESv2/libGLESv2.def", "src/libGLESv2/libGLESv2.def",
"src/libGLESv2/libGLESv2.rc", "src/libGLESv2/libGLESv2.rc",
...@@ -240,6 +247,10 @@ if (is_win) { ...@@ -240,6 +247,10 @@ if (is_win) {
"//build/config/compiler:no_chromium_code", "//build/config/compiler:no_chromium_code",
] ]
defines = [
"LIBGLESV2_IMPLEMENTATION",
]
deps = [ deps = [
":includes", ":includes",
":libANGLE", ":libANGLE",
...@@ -248,6 +259,14 @@ if (is_win) { ...@@ -248,6 +259,14 @@ if (is_win) {
shared_library("libEGL") { shared_library("libEGL") {
sources = [ sources = [
"src/common/angleutils.cpp",
"src/common/angleutils.h",
"src/common/debug.cpp",
"src/common/debug.h",
"src/common/event_tracer.cpp",
"src/common/event_tracer.h",
"src/common/tls.cpp",
"src/common/tls.h",
"src/libEGL/libEGL.cpp", "src/libEGL/libEGL.cpp",
"src/libEGL/libEGL.def", "src/libEGL/libEGL.def",
"src/libEGL/libEGL.rc", "src/libEGL/libEGL.rc",
...@@ -265,6 +284,10 @@ if (is_win) { ...@@ -265,6 +284,10 @@ if (is_win) {
"//build/config/compiler:no_chromium_code", "//build/config/compiler:no_chromium_code",
] ]
defines = [
"LIBEGL_IMPLEMENTATION",
]
deps = [ deps = [
":includes", ":includes",
":libANGLE", ":libANGLE",
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
namespace gl namespace gl
{ {
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
// Wraps the D3D9/D3D11 debug annotation functions. // Wraps the D3D9/D3D11 debug annotation functions.
class DebugAnnotationWrapper class DebugAnnotationWrapper
{ {
...@@ -158,31 +157,24 @@ class D3D11DebugAnnotationWrapper : public DebugAnnotationWrapper ...@@ -158,31 +157,24 @@ class D3D11DebugAnnotationWrapper : public DebugAnnotationWrapper
}; };
#endif // ANGLE_ENABLE_D3D11 #endif // ANGLE_ENABLE_D3D11
static DebugAnnotationWrapper* g_DebugAnnotationWrapper = NULL; static DebugAnnotationWrapper *GetDebugAnnotationWrapper()
void InitializeDebugAnnotations()
{ {
#if defined(ANGLE_ENABLE_D3D9) #if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
g_DebugAnnotationWrapper = new D3D9DebugAnnotationWrapper(); # if defined(ANGLE_ENABLE_D3D9)
#elif defined(ANGLE_ENABLE_D3D11) static D3D9DebugAnnotationWrapper wrapper;
# elif defined(ANGLE_ENABLE_D3D11)
// If the project uses D3D9 then we can use the D3D9 debug annotations, even with the D3D11 renderer. // If the project uses D3D9 then we can use the D3D9 debug annotations, even with the D3D11 renderer.
// However, if D3D9 is unavailable (e.g. in Windows Store), then we use D3D11 debug annotations. // However, if D3D9 is unavailable (e.g. in Windows Store), then we use D3D11 debug annotations.
// The D3D11 debug annotations are methods on ID3DUserDefinedAnnotation, which is implemented by the DeviceContext. // The D3D11 debug annotations are methods on ID3DUserDefinedAnnotation, which is implemented by the DeviceContext.
// This doesn't have to be the same DeviceContext that the renderer uses, though. // This doesn't have to be the same DeviceContext that the renderer uses, though.
g_DebugAnnotationWrapper = new D3D11DebugAnnotationWrapper(); static D3D11DebugAnnotationWrapper wrapper;
# endif
return &wrapper;
#else
return nullptr;
#endif #endif
} }
void UninitializeDebugAnnotations()
{
if (g_DebugAnnotationWrapper != NULL)
{
SafeDelete(g_DebugAnnotationWrapper);
}
}
#endif // ANGLE_ENABLE_DEBUG_ANNOTATIONS
enum DebugTraceOutputType enum DebugTraceOutputType
{ {
DebugTraceOutputTypeNone, DebugTraceOutputTypeNone,
...@@ -192,27 +184,25 @@ enum DebugTraceOutputType ...@@ -192,27 +184,25 @@ enum DebugTraceOutputType
static void output(bool traceInDebugOnly, DebugTraceOutputType outputType, const char *format, va_list vararg) static void output(bool traceInDebugOnly, DebugTraceOutputType outputType, const char *format, va_list vararg)
{ {
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
static std::vector<char> buffer(512);
if (perfActive()) if (perfActive())
{ {
static std::vector<char> buffer(512);
size_t len = FormatStringIntoVector(format, vararg, buffer); size_t len = FormatStringIntoVector(format, vararg, buffer);
std::wstring formattedWideMessage(buffer.begin(), buffer.begin() + len); std::wstring formattedWideMessage(buffer.begin(), buffer.begin() + len);
DebugAnnotationWrapper *annotationWrapper = GetDebugAnnotationWrapper();
switch (outputType) switch (outputType)
{ {
case DebugTraceOutputTypeNone: case DebugTraceOutputTypeNone:
break; break;
case DebugTraceOutputTypeBeginEvent: case DebugTraceOutputTypeBeginEvent:
g_DebugAnnotationWrapper->beginEvent(formattedWideMessage); annotationWrapper->beginEvent(formattedWideMessage);
break; break;
case DebugTraceOutputTypeSetMarker: case DebugTraceOutputTypeSetMarker:
g_DebugAnnotationWrapper->setMarker(formattedWideMessage); annotationWrapper->setMarker(formattedWideMessage);
break; break;
} }
} }
#endif // ANGLE_ENABLE_DEBUG_ANNOTATIONS
#if defined(ANGLE_ENABLE_DEBUG_TRACE) #if defined(ANGLE_ENABLE_DEBUG_TRACE)
#if defined(NDEBUG) #if defined(NDEBUG)
...@@ -252,7 +242,7 @@ void trace(bool traceInDebugOnly, const char *format, ...) ...@@ -252,7 +242,7 @@ void trace(bool traceInDebugOnly, const char *format, ...)
bool perfActive() bool perfActive()
{ {
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS) #if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
static bool active = g_DebugAnnotationWrapper->getStatus(); static bool active = GetDebugAnnotationWrapper()->getStatus();
return active; return active;
#else #else
return false; return false;
...@@ -282,7 +272,7 @@ ScopedPerfEventHelper::~ScopedPerfEventHelper() ...@@ -282,7 +272,7 @@ ScopedPerfEventHelper::~ScopedPerfEventHelper()
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS) #if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
if (perfActive()) if (perfActive())
{ {
g_DebugAnnotationWrapper->endEvent(); GetDebugAnnotationWrapper()->endEvent();
} }
#endif #endif
} }
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#ifndef LIBANGLE_ATTRIBUTEMAP_H_ #ifndef LIBANGLE_ATTRIBUTEMAP_H_
#define LIBANGLE_ATTRIBUTEMAP_H_ #define LIBANGLE_ATTRIBUTEMAP_H_
#include "libANGLE/export.h"
#include <EGL/egl.h> #include <EGL/egl.h>
#include <map> #include <map>
...@@ -14,7 +16,7 @@ ...@@ -14,7 +16,7 @@
namespace egl namespace egl
{ {
class AttributeMap class ANGLE_EXPORT AttributeMap
{ {
public: public:
AttributeMap(); AttributeMap();
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#define LIBANGLE_BUFFER_H_ #define LIBANGLE_BUFFER_H_
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/export.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/renderer/IndexRangeCache.h" #include "libANGLE/renderer/IndexRangeCache.h"
...@@ -25,7 +26,7 @@ class BufferImpl; ...@@ -25,7 +26,7 @@ class BufferImpl;
namespace gl namespace gl
{ {
class Buffer : public RefCountObject class ANGLE_EXPORT Buffer : public RefCountObject
{ {
public: public:
Buffer(rx::BufferImpl *impl, GLuint id); Buffer(rx::BufferImpl *impl, GLuint id);
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#ifndef LIBANGLE_CAPS_H_ #ifndef LIBANGLE_CAPS_H_
#define LIBANGLE_CAPS_H_ #define LIBANGLE_CAPS_H_
#include "libANGLE/export.h"
#include "angle_gl.h" #include "angle_gl.h"
#include <set> #include <set>
...@@ -19,7 +21,7 @@ namespace gl ...@@ -19,7 +21,7 @@ namespace gl
typedef std::set<GLuint> SupportedSampleSet; typedef std::set<GLuint> SupportedSampleSet;
struct TextureCaps struct ANGLE_EXPORT TextureCaps
{ {
TextureCaps(); TextureCaps();
...@@ -42,7 +44,7 @@ struct TextureCaps ...@@ -42,7 +44,7 @@ struct TextureCaps
GLuint getNearestSamples(GLuint requestedSamples) const; GLuint getNearestSamples(GLuint requestedSamples) const;
}; };
class TextureCapsMap class ANGLE_EXPORT TextureCapsMap
{ {
public: public:
typedef std::unordered_map<GLenum, TextureCaps>::const_iterator const_iterator; typedef std::unordered_map<GLenum, TextureCaps>::const_iterator const_iterator;
...@@ -62,7 +64,7 @@ class TextureCapsMap ...@@ -62,7 +64,7 @@ class TextureCapsMap
InternalFormatToCapsMap mCapsMap; InternalFormatToCapsMap mCapsMap;
}; };
struct Extensions struct ANGLE_EXPORT Extensions
{ {
Extensions(); Extensions();
...@@ -205,7 +207,7 @@ struct Extensions ...@@ -205,7 +207,7 @@ struct Extensions
bool colorBufferFloat; bool colorBufferFloat;
}; };
struct Caps struct ANGLE_EXPORT Caps
{ {
Caps(); Caps();
......
...@@ -11,18 +11,20 @@ ...@@ -11,18 +11,20 @@
#ifndef INCLUDE_CONFIG_H_ #ifndef INCLUDE_CONFIG_H_
#define INCLUDE_CONFIG_H_ #define INCLUDE_CONFIG_H_
#include "libANGLE/renderer/Renderer.h"
#include "libANGLE/export.h"
#include "common/angleutils.h"
#include <EGL/egl.h> #include <EGL/egl.h>
#include <set> #include <set>
#include "libANGLE/renderer/Renderer.h"
#include "common/angleutils.h"
namespace egl namespace egl
{ {
class Display; class Display;
class Config class ANGLE_EXPORT Config
{ {
public: public:
Config(rx::ConfigDesc desc, EGLint minSwapInterval, EGLint maxSwapInterval, EGLint texWidth, EGLint texHeight); Config(rx::ConfigDesc desc, EGLint minSwapInterval, EGLint maxSwapInterval, EGLint texWidth, EGLint texHeight);
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "libANGLE/HandleAllocator.h" #include "libANGLE/HandleAllocator.h"
#include "libANGLE/VertexAttribute.h" #include "libANGLE/VertexAttribute.h"
#include "libANGLE/angletypes.h" #include "libANGLE/angletypes.h"
#include "libANGLE/export.h"
#include "angle_gl.h" #include "angle_gl.h"
...@@ -60,7 +61,7 @@ class VertexArray; ...@@ -60,7 +61,7 @@ class VertexArray;
class Sampler; class Sampler;
class TransformFeedback; class TransformFeedback;
class Context class ANGLE_EXPORT Context
{ {
public: public:
Context(int clientVersion, const Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess); Context(int clientVersion, const Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess);
......
...@@ -10,11 +10,12 @@ ...@@ -10,11 +10,12 @@
#define LIBANGLE_DATA_H_ #define LIBANGLE_DATA_H_
#include "libANGLE/State.h" #include "libANGLE/State.h"
#include "libANGLE/export.h"
namespace gl namespace gl
{ {
struct Data final struct ANGLE_EXPORT Data final
{ {
public: public:
Data(GLint clientVersion, const State &state, const Caps &caps, Data(GLint clientVersion, const State &state, const Caps &caps,
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/Config.h" #include "libANGLE/Config.h"
#include "libANGLE/AttributeMap.h" #include "libANGLE/AttributeMap.h"
#include "libANGLE/export.h"
namespace gl namespace gl
{ {
...@@ -27,7 +28,7 @@ namespace egl ...@@ -27,7 +28,7 @@ namespace egl
{ {
class Surface; class Surface;
class Display class ANGLE_EXPORT Display
{ {
public: public:
~Display(); ~Display();
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#ifndef LIBANGLE_ERROR_H_ #ifndef LIBANGLE_ERROR_H_
#define LIBANGLE_ERROR_H_ #define LIBANGLE_ERROR_H_
#include "libANGLE/export.h"
#include "angle_gl.h" #include "angle_gl.h"
#include <EGL/egl.h> #include <EGL/egl.h>
...@@ -17,7 +19,7 @@ ...@@ -17,7 +19,7 @@
namespace gl namespace gl
{ {
class Error class ANGLE_EXPORT Error
{ {
public: public:
explicit Error(GLenum errorCode); explicit Error(GLenum errorCode);
...@@ -40,7 +42,7 @@ class Error ...@@ -40,7 +42,7 @@ class Error
namespace egl namespace egl
{ {
class Error class ANGLE_EXPORT Error
{ {
public: public:
explicit Error(EGLint errorCode); explicit Error(EGLint errorCode);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/export.h"
#include "common/angleutils.h" #include "common/angleutils.h"
...@@ -24,7 +25,7 @@ class FenceSyncImpl; ...@@ -24,7 +25,7 @@ class FenceSyncImpl;
namespace gl namespace gl
{ {
class FenceNV class ANGLE_EXPORT FenceNV
{ {
public: public:
explicit FenceNV(rx::FenceNVImpl *impl); explicit FenceNV(rx::FenceNVImpl *impl);
...@@ -49,7 +50,7 @@ class FenceNV ...@@ -49,7 +50,7 @@ class FenceNV
GLenum mCondition; GLenum mCondition;
}; };
class FenceSync : public RefCountObject class ANGLE_EXPORT FenceSync : public RefCountObject
{ {
public: public:
explicit FenceSync(rx::FenceSyncImpl *impl, GLuint id); explicit FenceSync(rx::FenceSyncImpl *impl, GLuint id);
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/Constants.h" #include "libANGLE/Constants.h"
#include "libANGLE/export.h"
#include "common/angleutils.h" #include "common/angleutils.h"
...@@ -38,7 +39,7 @@ struct Data; ...@@ -38,7 +39,7 @@ struct Data;
typedef std::vector<FramebufferAttachment *> ColorbufferInfo; typedef std::vector<FramebufferAttachment *> ColorbufferInfo;
class Framebuffer class ANGLE_EXPORT Framebuffer
{ {
public: public:
Framebuffer(GLuint id); Framebuffer(GLuint id);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "libANGLE/Texture.h" #include "libANGLE/Texture.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/export.h"
#include "common/angleutils.h" #include "common/angleutils.h"
...@@ -32,7 +33,7 @@ class Renderbuffer; ...@@ -32,7 +33,7 @@ class Renderbuffer;
// Note: Our old naming scheme used the term "Renderbuffer" for both GL renderbuffers and for // Note: Our old naming scheme used the term "Renderbuffer" for both GL renderbuffers and for
// framebuffer attachments, which confused their usage. // framebuffer attachments, which confused their usage.
class FramebufferAttachment class ANGLE_EXPORT FramebufferAttachment
{ {
public: public:
explicit FramebufferAttachment(GLenum binding); explicit FramebufferAttachment(GLenum binding);
...@@ -76,7 +77,7 @@ class FramebufferAttachment ...@@ -76,7 +77,7 @@ class FramebufferAttachment
GLenum mBinding; GLenum mBinding;
}; };
class TextureAttachment : public FramebufferAttachment class ANGLE_EXPORT TextureAttachment : public FramebufferAttachment
{ {
public: public:
TextureAttachment(GLenum binding, Texture *texture, const ImageIndex &index); TextureAttachment(GLenum binding, Texture *texture, const ImageIndex &index);
...@@ -106,7 +107,7 @@ class TextureAttachment : public FramebufferAttachment ...@@ -106,7 +107,7 @@ class TextureAttachment : public FramebufferAttachment
ImageIndex mIndex; ImageIndex mIndex;
}; };
class RenderbufferAttachment : public FramebufferAttachment class ANGLE_EXPORT RenderbufferAttachment : public FramebufferAttachment
{ {
public: public:
RenderbufferAttachment(GLenum binding, Renderbuffer *renderbuffer); RenderbufferAttachment(GLenum binding, Renderbuffer *renderbuffer);
...@@ -135,7 +136,7 @@ class RenderbufferAttachment : public FramebufferAttachment ...@@ -135,7 +136,7 @@ class RenderbufferAttachment : public FramebufferAttachment
BindingPointer<Renderbuffer> mRenderbuffer; BindingPointer<Renderbuffer> mRenderbuffer;
}; };
class DefaultAttachment : public FramebufferAttachment class ANGLE_EXPORT DefaultAttachment : public FramebufferAttachment
{ {
public: public:
DefaultAttachment(GLenum binding, rx::DefaultAttachmentImpl *impl); DefaultAttachment(GLenum binding, rx::DefaultAttachmentImpl *impl);
......
...@@ -9,13 +9,16 @@ ...@@ -9,13 +9,16 @@
#ifndef LIBANGLE_IMAGE_INDEX_H_ #ifndef LIBANGLE_IMAGE_INDEX_H_
#define LIBANGLE_IMAGE_INDEX_H_ #define LIBANGLE_IMAGE_INDEX_H_
#include "angle_gl.h" #include "libANGLE/export.h"
#include "common/mathutil.h" #include "common/mathutil.h"
#include "angle_gl.h"
namespace gl namespace gl
{ {
struct ImageIndex struct ANGLE_EXPORT ImageIndex
{ {
GLenum type; GLenum type;
GLint mipIndex; GLint mipIndex;
...@@ -36,7 +39,7 @@ struct ImageIndex ...@@ -36,7 +39,7 @@ struct ImageIndex
static const GLint ENTIRE_LEVEL = static_cast<GLint>(-1); static const GLint ENTIRE_LEVEL = static_cast<GLint>(-1);
}; };
class ImageIndexIterator class ANGLE_EXPORT ImageIndexIterator
{ {
public: public:
static ImageIndexIterator Make2D(GLint minMip, GLint maxMip); static ImageIndexIterator Make2D(GLint minMip, GLint maxMip);
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/Constants.h" #include "libANGLE/Constants.h"
#include "libANGLE/ProgramBinary.h" #include "libANGLE/ProgramBinary.h"
#include "libANGLE/export.h"
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
...@@ -48,7 +49,7 @@ class AttributeBindings ...@@ -48,7 +49,7 @@ class AttributeBindings
std::set<std::string> mAttributeBinding[MAX_VERTEX_ATTRIBS]; std::set<std::string> mAttributeBinding[MAX_VERTEX_ATTRIBS];
}; };
class InfoLog class ANGLE_EXPORT InfoLog
{ {
public: public:
InfoLog(); InfoLog();
...@@ -65,7 +66,7 @@ class InfoLog ...@@ -65,7 +66,7 @@ class InfoLog
char *mInfoLog; char *mInfoLog;
}; };
class Program class ANGLE_EXPORT Program
{ {
public: public:
Program(rx::Renderer *renderer, ResourceManager *manager, GLuint handle); Program(rx::Renderer *renderer, ResourceManager *manager, GLuint handle);
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "libANGLE/Constants.h" #include "libANGLE/Constants.h"
#include "libANGLE/renderer/d3d/VertexDataManager.h" #include "libANGLE/renderer/d3d/VertexDataManager.h"
#include "libANGLE/renderer/d3d/DynamicHLSL.h" #include "libANGLE/renderer/d3d/DynamicHLSL.h"
#include "libANGLE/export.h"
#include "angle_gl.h" #include "angle_gl.h"
...@@ -95,7 +96,7 @@ struct LinkResult ...@@ -95,7 +96,7 @@ struct LinkResult
}; };
// This is the result of linking a program. It is the state that would be passed to ProgramBinary. // This is the result of linking a program. It is the state that would be passed to ProgramBinary.
class ProgramBinary : public RefCountObject class ANGLE_EXPORT ProgramBinary : public RefCountObject
{ {
public: public:
explicit ProgramBinary(rx::ProgramImpl *impl); explicit ProgramBinary(rx::ProgramImpl *impl);
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/export.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "angle_gl.h" #include "angle_gl.h"
...@@ -23,7 +25,7 @@ class QueryImpl; ...@@ -23,7 +25,7 @@ class QueryImpl;
namespace gl namespace gl
{ {
class Query : public RefCountObject class ANGLE_EXPORT Query : public RefCountObject
{ {
public: public:
Query(rx::QueryImpl *impl, GLuint id); Query(rx::QueryImpl *impl, GLuint id);
......
...@@ -12,13 +12,15 @@ ...@@ -12,13 +12,15 @@
#ifndef LIBANGLE_REFCOUNTOBJECT_H_ #ifndef LIBANGLE_REFCOUNTOBJECT_H_
#define LIBANGLE_REFCOUNTOBJECT_H_ #define LIBANGLE_REFCOUNTOBJECT_H_
#include "libANGLE/export.h"
#include "common/debug.h" #include "common/debug.h"
#include "angle_gl.h" #include "angle_gl.h"
#include <cstddef> #include <cstddef>
class RefCountObject class ANGLE_EXPORT RefCountObject
{ {
public: public:
explicit RefCountObject(GLuint id); explicit RefCountObject(GLuint id);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/export.h"
#include "common/angleutils.h" #include "common/angleutils.h"
...@@ -32,7 +33,7 @@ class FramebufferAttachment; ...@@ -32,7 +33,7 @@ class FramebufferAttachment;
// FramebufferAttachment and Framebuffer for how they are applied to an FBO via an // FramebufferAttachment and Framebuffer for how they are applied to an FBO via an
// attachment point. // attachment point.
class Renderbuffer : public RefCountObject class ANGLE_EXPORT Renderbuffer : public RefCountObject
{ {
public: public:
Renderbuffer(rx::RenderbufferImpl *impl, GLuint id); Renderbuffer(rx::RenderbufferImpl *impl, GLuint id);
......
...@@ -11,12 +11,13 @@ ...@@ -11,12 +11,13 @@
#define LIBANGLE_SAMPLER_H_ #define LIBANGLE_SAMPLER_H_
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/export.h"
namespace gl namespace gl
{ {
struct SamplerState; struct SamplerState;
class Sampler : public RefCountObject class ANGLE_EXPORT Sampler : public RefCountObject
{ {
public: public:
Sampler(GLuint id); Sampler(GLuint id);
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#ifndef LIBANGLE_SHADER_H_ #ifndef LIBANGLE_SHADER_H_
#define LIBANGLE_SHADER_H_ #define LIBANGLE_SHADER_H_
#include <string> #include <string>
#include <list> #include <list>
#include <vector> #include <vector>
...@@ -22,6 +21,7 @@ ...@@ -22,6 +21,7 @@
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/angletypes.h" #include "libANGLE/angletypes.h"
#include "libANGLE/export.h"
namespace rx namespace rx
{ {
...@@ -53,7 +53,7 @@ struct PackedVarying : public sh::Varying ...@@ -53,7 +53,7 @@ struct PackedVarying : public sh::Varying
} }
}; };
class Shader class ANGLE_EXPORT Shader
{ {
public: public:
Shader(ResourceManager *manager, rx::ShaderImpl *impl, GLenum type, GLuint handle); Shader(ResourceManager *manager, rx::ShaderImpl *impl, GLenum type, GLuint handle);
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "libANGLE/TransformFeedback.h" #include "libANGLE/TransformFeedback.h"
#include "libANGLE/Program.h" #include "libANGLE/Program.h"
#include "libANGLE/Sampler.h" #include "libANGLE/Sampler.h"
#include "libANGLE/export.h"
namespace gl namespace gl
{ {
...@@ -29,7 +30,7 @@ struct Data; ...@@ -29,7 +30,7 @@ struct Data;
typedef std::map< GLenum, BindingPointer<Texture> > TextureMap; typedef std::map< GLenum, BindingPointer<Texture> > TextureMap;
class State class ANGLE_EXPORT State
{ {
public: public:
State(); State();
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/export.h"
#include <EGL/egl.h> #include <EGL/egl.h>
...@@ -31,7 +32,7 @@ namespace egl ...@@ -31,7 +32,7 @@ namespace egl
class Display; class Display;
class Config; class Config;
class Surface final class ANGLE_EXPORT Surface final
{ {
public: public:
Surface(rx::SurfaceImpl *impl); Surface(rx::SurfaceImpl *impl);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "libANGLE/Constants.h" #include "libANGLE/Constants.h"
#include "libANGLE/renderer/TextureImpl.h" #include "libANGLE/renderer/TextureImpl.h"
#include "libANGLE/Caps.h" #include "libANGLE/Caps.h"
#include "libANGLE/export.h"
#include "angle_gl.h" #include "angle_gl.h"
...@@ -41,7 +42,7 @@ struct ImageIndex; ...@@ -41,7 +42,7 @@ struct ImageIndex;
bool IsMipmapFiltered(const gl::SamplerState &samplerState); bool IsMipmapFiltered(const gl::SamplerState &samplerState);
class Texture : public RefCountObject class ANGLE_EXPORT Texture : public RefCountObject
{ {
public: public:
Texture(rx::TextureImpl *impl, GLuint id, GLenum target); Texture(rx::TextureImpl *impl, GLuint id, GLenum target);
...@@ -105,7 +106,7 @@ class Texture : public RefCountObject ...@@ -105,7 +106,7 @@ class Texture : public RefCountObject
DISALLOW_COPY_AND_ASSIGN(Texture); DISALLOW_COPY_AND_ASSIGN(Texture);
}; };
class Texture2D : public Texture class ANGLE_EXPORT Texture2D : public Texture
{ {
public: public:
Texture2D(rx::TextureImpl *impl, GLuint id); Texture2D(rx::TextureImpl *impl, GLuint id);
...@@ -141,7 +142,7 @@ class Texture2D : public Texture ...@@ -141,7 +142,7 @@ class Texture2D : public Texture
egl::Surface *mSurface; egl::Surface *mSurface;
}; };
class TextureCubeMap : public Texture class ANGLE_EXPORT TextureCubeMap : public Texture
{ {
public: public:
TextureCubeMap(rx::TextureImpl *impl, GLuint id); TextureCubeMap(rx::TextureImpl *impl, GLuint id);
...@@ -176,7 +177,7 @@ class TextureCubeMap : public Texture ...@@ -176,7 +177,7 @@ class TextureCubeMap : public Texture
bool isFaceLevelComplete(int faceIndex, int level) const; bool isFaceLevelComplete(int faceIndex, int level) const;
}; };
class Texture3D : public Texture class ANGLE_EXPORT Texture3D : public Texture
{ {
public: public:
Texture3D(rx::TextureImpl *impl, GLuint id); Texture3D(rx::TextureImpl *impl, GLuint id);
...@@ -206,7 +207,7 @@ class Texture3D : public Texture ...@@ -206,7 +207,7 @@ class Texture3D : public Texture
bool isLevelComplete(int level) const; bool isLevelComplete(int level) const;
}; };
class Texture2DArray : public Texture class ANGLE_EXPORT Texture2DArray : public Texture
{ {
public: public:
Texture2DArray(rx::TextureImpl *impl, GLuint id); Texture2DArray(rx::TextureImpl *impl, GLuint id);
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#define LIBANGLE_TRANSFORM_FEEDBACK_H_ #define LIBANGLE_TRANSFORM_FEEDBACK_H_
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/export.h"
#include "common/angleutils.h" #include "common/angleutils.h"
...@@ -21,7 +22,7 @@ class TransformFeedbackImpl; ...@@ -21,7 +22,7 @@ class TransformFeedbackImpl;
namespace gl namespace gl
{ {
class TransformFeedback : public RefCountObject class ANGLE_EXPORT TransformFeedback : public RefCountObject
{ {
public: public:
TransformFeedback(rx::TransformFeedbackImpl* impl, GLuint id); TransformFeedback(rx::TransformFeedbackImpl* impl, GLuint id);
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
#include "libANGLE/Constants.h" #include "libANGLE/Constants.h"
#include "libANGLE/VertexAttribute.h" #include "libANGLE/VertexAttribute.h"
#include "libANGLE/export.h"
#include <vector> #include <vector>
...@@ -28,7 +29,7 @@ namespace gl ...@@ -28,7 +29,7 @@ namespace gl
{ {
class Buffer; class Buffer;
class VertexArray class ANGLE_EXPORT VertexArray
{ {
public: public:
VertexArray(rx::VertexArrayImpl *impl, GLuint id, size_t maxAttribs); VertexArray(rx::VertexArrayImpl *impl, GLuint id, size_t maxAttribs);
......
...@@ -10,11 +10,12 @@ ...@@ -10,11 +10,12 @@
#define LIBANGLE_VERTEXATTRIBUTE_H_ #define LIBANGLE_VERTEXATTRIBUTE_H_
#include "libANGLE/Buffer.h" #include "libANGLE/Buffer.h"
#include "libANGLE/export.h"
namespace gl namespace gl
{ {
struct VertexAttribute struct ANGLE_EXPORT VertexAttribute
{ {
bool enabled; // From glEnable/DisableVertexAttribArray bool enabled; // From glEnable/DisableVertexAttribArray
......
//
// 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 LIBANGLE_EXPORT_H_
#define LIBANGLE_EXPORT_H_
#include "common/platform.h"
#if defined(LIBANGLE_STATIC)
# define ANGLE_EXPORT
#else
# if defined(_WIN32)
# if defined(LIBANGLE_IMPLEMENTATION)
# define ANGLE_EXPORT __declspec(dllexport)
# else
# define ANGLE_EXPORT __declspec(dllimport)
# endif
# elif defined(__GNUC__)
# if defined(LIBANGLE_IMPLEMENTATION)
# define ANGLE_EXPORT __attribute__((visibility ("default")))
# else
# define ANGLE_EXPORT
# endif
# else
# define ANGLE_EXPORT
# endif
#endif
#endif // LIBANGLE_EXPORT_H_
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "libANGLE/Caps.h" #include "libANGLE/Caps.h"
#include "libANGLE/angletypes.h" #include "libANGLE/angletypes.h"
#include "libANGLE/export.h"
#include "angle_gl.h" #include "angle_gl.h"
...@@ -37,25 +38,25 @@ typedef void (*VertexCopyFunction)(const uint8_t *input, size_t stride, size_t c ...@@ -37,25 +38,25 @@ typedef void (*VertexCopyFunction)(const uint8_t *input, size_t stride, size_t c
namespace gl namespace gl
{ {
struct FormatType struct ANGLE_EXPORT FormatType
{ {
FormatType(); FormatType();
GLenum internalFormat; GLenum internalFormat;
ColorWriteFunction colorWriteFunction; ColorWriteFunction colorWriteFunction;
}; };
const FormatType &GetFormatTypeInfo(GLenum format, GLenum type); ANGLE_EXPORT const FormatType &GetFormatTypeInfo(GLenum format, GLenum type);
struct Type struct ANGLE_EXPORT Type
{ {
Type(); Type();
GLuint bytes; GLuint bytes;
bool specialInterpretation; bool specialInterpretation;
}; };
const Type &GetTypeInfo(GLenum type); ANGLE_EXPORT const Type &GetTypeInfo(GLenum type);
struct InternalFormat struct ANGLE_EXPORT InternalFormat
{ {
InternalFormat(); InternalFormat();
...@@ -94,9 +95,9 @@ struct InternalFormat ...@@ -94,9 +95,9 @@ struct InternalFormat
GLuint computeDepthPitch(GLenum type, GLsizei width, GLsizei height, GLint alignment) const; GLuint computeDepthPitch(GLenum type, GLsizei width, GLsizei height, GLint alignment) const;
GLuint computeBlockSize(GLenum type, GLsizei width, GLsizei height) const; GLuint computeBlockSize(GLenum type, GLsizei width, GLsizei height) const;
}; };
const InternalFormat &GetInternalFormatInfo(GLenum internalFormat); ANGLE_EXPORT const InternalFormat &GetInternalFormatInfo(GLenum internalFormat);
GLenum GetSizedInternalFormat(GLenum internalFormat, GLenum type); ANGLE_EXPORT GLenum GetSizedInternalFormat(GLenum internalFormat, GLenum type);
typedef std::set<GLenum> FormatSet; typedef std::set<GLenum> FormatSet;
const FormatSet &GetAllSizedInternalFormats(); const FormatSet &GetAllSizedInternalFormats();
......
...@@ -138,10 +138,10 @@ void CastStateValues(Context *context, GLenum nativeType, GLenum pname, ...@@ -138,10 +138,10 @@ void CastStateValues(Context *context, GLenum nativeType, GLenum pname,
// The calls below will make CastStateValues successfully link with the GL state query types // The calls below will make CastStateValues successfully link with the GL state query types
// The GL state query API types are: bool, int, uint, float, int64 // The GL state query API types are: bool, int, uint, float, int64
template void CastStateValues<GLboolean>(Context *, GLenum, GLenum, unsigned int, GLboolean *); template ANGLE_EXPORT void CastStateValues<GLboolean>(Context *, GLenum, GLenum, unsigned int, GLboolean *);
template void CastStateValues<GLint>(Context *, GLenum, GLenum, unsigned int, GLint *); template ANGLE_EXPORT void CastStateValues<GLint>(Context *, GLenum, GLenum, unsigned int, GLint *);
template void CastStateValues<GLuint>(Context *, GLenum, GLenum, unsigned int, GLuint *); template ANGLE_EXPORT void CastStateValues<GLuint>(Context *, GLenum, GLenum, unsigned int, GLuint *);
template void CastStateValues<GLfloat>(Context *, GLenum, GLenum, unsigned int, GLfloat *); template ANGLE_EXPORT void CastStateValues<GLfloat>(Context *, GLenum, GLenum, unsigned int, GLfloat *);
template void CastStateValues<GLint64>(Context *, GLenum, GLenum, unsigned int, GLint64 *); template ANGLE_EXPORT void CastStateValues<GLint64>(Context *, GLenum, GLenum, unsigned int, GLint64 *);
} }
...@@ -6,12 +6,14 @@ ...@@ -6,12 +6,14 @@
// queryconversions.h: Declaration of state query cast conversions // queryconversions.h: Declaration of state query cast conversions
#include "libANGLE/export.h"
namespace gl namespace gl
{ {
// The GL state query API types are: bool, int, uint, float, int64 // The GL state query API types are: bool, int, uint, float, int64
template <typename QueryT> template <typename QueryT>
void CastStateValues(Context *context, GLenum nativeType, GLenum pname, ANGLE_EXPORT void CastStateValues(Context *context, GLenum nativeType, GLenum pname,
unsigned int numParams, QueryT *outParams); unsigned int numParams, QueryT *outParams);
} }
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/export.h"
namespace egl namespace egl
{ {
...@@ -26,7 +27,8 @@ class Texture2D; ...@@ -26,7 +27,8 @@ class Texture2D;
namespace rx namespace rx
{ {
class SurfaceImpl // TODO: don't export this class, make it a pure interface if possible
class ANGLE_EXPORT SurfaceImpl
{ {
public: public:
SurfaceImpl(egl::Display *display, const egl::Config *config, EGLint width, EGLint height, SurfaceImpl(egl::Display *display, const egl::Config *config, EGLint width, EGLint height,
......
...@@ -12,10 +12,13 @@ ...@@ -12,10 +12,13 @@
#ifndef LIBANGLE_RENDERER_D3D_D3D11_NATIVEWINDOW_H_ #ifndef LIBANGLE_RENDERER_D3D_D3D11_NATIVEWINDOW_H_
#define LIBANGLE_RENDERER_D3D_D3D11_NATIVEWINDOW_H_ #define LIBANGLE_RENDERER_D3D_D3D11_NATIVEWINDOW_H_
#include <EGL/eglplatform.h> #include "libANGLE/export.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/platform.h" #include "common/platform.h"
#include <EGL/eglplatform.h>
// DXGISwapChain and DXGIFactory are typedef'd to specific required // DXGISwapChain and DXGIFactory are typedef'd to specific required
// types. The HWND NativeWindow implementation requires IDXGISwapChain // types. The HWND NativeWindow implementation requires IDXGISwapChain
// and IDXGIFactory and the Windows Store NativeWindow // and IDXGIFactory and the Windows Store NativeWindow
...@@ -44,6 +47,7 @@ typedef IDXGIFactory DXGIFactory; ...@@ -44,6 +47,7 @@ typedef IDXGIFactory DXGIFactory;
namespace rx namespace rx
{ {
class NativeWindow class NativeWindow
{ {
public: public:
...@@ -68,7 +72,8 @@ class NativeWindow ...@@ -68,7 +72,8 @@ class NativeWindow
}; };
bool IsValidEGLNativeWindowType(EGLNativeWindowType window); // TODO: don't export this function.
ANGLE_EXPORT bool IsValidEGLNativeWindowType(EGLNativeWindowType window);
} }
#endif // LIBANGLE_RENDERER_D3D_D3D11_NATIVEWINDOW_H_ #endif // LIBANGLE_RENDERER_D3D_D3D11_NATIVEWINDOW_H_
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#ifndef LIBANGLE_VALIDATION_ES2_H_ #ifndef LIBANGLE_VALIDATION_ES2_H_
#define LIBANGLE_VALIDATION_ES2_H_ #define LIBANGLE_VALIDATION_ES2_H_
#include "libANGLE/export.h"
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
namespace gl namespace gl
...@@ -16,18 +18,18 @@ namespace gl ...@@ -16,18 +18,18 @@ namespace gl
class Context; class Context;
bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level, GLenum internalformat, bool isCompressed, bool isSubImage, ANGLE_EXPORT bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level, GLenum internalformat, bool isCompressed, bool isSubImage,
GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
GLint border, GLenum format, GLenum type, const GLvoid *pixels); GLint border, GLenum format, GLenum type, const GLvoid *pixels);
bool ValidateES2CopyTexImageParameters(Context* context, GLenum target, GLint level, GLenum internalformat, bool isSubImage, ANGLE_EXPORT bool ValidateES2CopyTexImageParameters(Context* context, GLenum target, GLint level, GLenum internalformat, bool isSubImage,
GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height,
GLint border); GLint border);
bool ValidateES2TexStorageParameters(Context *context, GLenum target, GLsizei levels, GLenum internalformat, ANGLE_EXPORT bool ValidateES2TexStorageParameters(Context *context, GLenum target, GLsizei levels, GLenum internalformat,
GLsizei width, GLsizei height); GLsizei width, GLsizei height);
bool ValidES2ReadFormatType(Context *context, GLenum format, GLenum type); ANGLE_EXPORT bool ValidES2ReadFormatType(Context *context, GLenum format, GLenum type);
} }
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#ifndef LIBANGLE_VALIDATION_ES3_H_ #ifndef LIBANGLE_VALIDATION_ES3_H_
#define LIBANGLE_VALIDATION_ES3_H_ #define LIBANGLE_VALIDATION_ES3_H_
#include "libANGLE/export.h"
#include <GLES3/gl3.h> #include <GLES3/gl3.h>
namespace gl namespace gl
...@@ -16,31 +18,31 @@ namespace gl ...@@ -16,31 +18,31 @@ namespace gl
class Context; class Context;
bool ValidateES3TexImageParameters(Context *context, GLenum target, GLint level, GLenum internalformat, bool isCompressed, bool isSubImage, ANGLE_EXPORT bool ValidateES3TexImageParameters(Context *context, GLenum target, GLint level, GLenum internalformat, bool isCompressed, bool isSubImage,
GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
GLint border, GLenum format, GLenum type, const GLvoid *pixels); GLint border, GLenum format, GLenum type, const GLvoid *pixels);
bool ValidateES3CopyTexImageParameters(Context *context, GLenum target, GLint level, GLenum internalformat, ANGLE_EXPORT bool ValidateES3CopyTexImageParameters(Context *context, GLenum target, GLint level, GLenum internalformat,
bool isSubImage, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, bool isSubImage, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y,
GLsizei width, GLsizei height, GLint border); GLsizei width, GLsizei height, GLint border);
bool ValidateES3TexStorageParameters(Context *context, GLenum target, GLsizei levels, GLenum internalformat, ANGLE_EXPORT bool ValidateES3TexStorageParameters(Context *context, GLenum target, GLsizei levels, GLenum internalformat,
GLsizei width, GLsizei height, GLsizei depth); GLsizei width, GLsizei height, GLsizei depth);
bool ValidateFramebufferTextureLayer(Context *context, GLenum target, GLenum attachment, ANGLE_EXPORT bool ValidateFramebufferTextureLayer(Context *context, GLenum target, GLenum attachment,
GLuint texture, GLint level, GLint layer); GLuint texture, GLint level, GLint layer);
bool ValidES3ReadFormatType(Context *context, GLenum internalFormat, GLenum format, GLenum type); ANGLE_EXPORT bool ValidES3ReadFormatType(Context *context, GLenum internalFormat, GLenum format, GLenum type);
bool ValidateES3RenderbufferStorageParameters(Context *context, GLenum target, GLsizei samples, ANGLE_EXPORT bool ValidateES3RenderbufferStorageParameters(Context *context, GLenum target, GLsizei samples,
GLenum internalformat, GLsizei width, GLsizei height); GLenum internalformat, GLsizei width, GLsizei height);
bool ValidateInvalidateFramebufferParameters(Context *context, GLenum target, GLsizei numAttachments, ANGLE_EXPORT bool ValidateInvalidateFramebufferParameters(Context *context, GLenum target, GLsizei numAttachments,
const GLenum* attachments); const GLenum* attachments);
bool ValidateClearBuffer(Context *context); ANGLE_EXPORT bool ValidateClearBuffer(Context *context);
bool ValidateGetUniformuiv(Context *context, GLuint program, GLint location, GLuint* params); ANGLE_EXPORT bool ValidateGetUniformuiv(Context *context, GLuint program, GLint location, GLuint* params);
} }
......
...@@ -26,6 +26,14 @@ ...@@ -26,6 +26,14 @@
], ],
'sources': 'sources':
[ [
'common/angleutils.cpp',
'common/angleutils.h',
'common/debug.cpp',
'common/debug.h',
'common/event_tracer.cpp',
'common/event_tracer.h',
'common/tls.cpp',
'common/tls.h',
'libEGL/libEGL.cpp', 'libEGL/libEGL.cpp',
'libEGL/libEGL.def', 'libEGL/libEGL.def',
'libEGL/libEGL.rc', 'libEGL/libEGL.rc',
...@@ -33,6 +41,10 @@ ...@@ -33,6 +41,10 @@
'libEGL/main.h', 'libEGL/main.h',
'libEGL/resource.h', 'libEGL/resource.h',
], ],
'defines':
[
'LIBEGL_IMPLEMENTATION',
],
'conditions': 'conditions':
[ [
['angle_build_winrt==1', ['angle_build_winrt==1',
......
...@@ -64,30 +64,11 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved ...@@ -64,30 +64,11 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
{ {
#if defined(ANGLE_ENABLE_DEBUG_TRACE)
FILE *debug = fopen(TRACE_OUTPUT_FILE, "rt");
if (debug)
{
fclose(debug);
debug = fopen(TRACE_OUTPUT_FILE, "wt"); // Erase
if (debug)
{
fclose(debug);
}
}
#endif
currentTLS = CreateTLSIndex(); currentTLS = CreateTLSIndex();
if (currentTLS == TLS_OUT_OF_INDEXES) if (currentTLS == TLS_OUT_OF_INDEXES)
{ {
return FALSE; return FALSE;
} }
#ifdef ANGLE_ENABLE_DEBUG_ANNOTATIONS
gl::InitializeDebugAnnotations();
#endif
} }
// Fall through to initialize index // Fall through to initialize index
case DLL_THREAD_ATTACH: case DLL_THREAD_ATTACH:
...@@ -104,10 +85,6 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved ...@@ -104,10 +85,6 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved
{ {
egl::DeallocateCurrent(); egl::DeallocateCurrent();
DestroyTLSIndex(currentTLS); DestroyTLSIndex(currentTLS);
#ifdef ANGLE_ENABLE_DEBUG_ANNOTATIONS
gl::UninitializeDebugAnnotations();
#endif
} }
break; break;
default: default:
......
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
'libANGLE/Display.h', 'libANGLE/Display.h',
'libANGLE/Error.cpp', 'libANGLE/Error.cpp',
'libANGLE/Error.h', 'libANGLE/Error.h',
'libANGLE/features.h',
'libANGLE/Fence.cpp', 'libANGLE/Fence.cpp',
'libANGLE/Fence.h', 'libANGLE/Fence.h',
'libANGLE/Float16ToFloat32.cpp', 'libANGLE/Float16ToFloat32.cpp',
...@@ -105,6 +104,8 @@ ...@@ -105,6 +104,8 @@
'libANGLE/VertexAttribute.h', 'libANGLE/VertexAttribute.h',
'libANGLE/angletypes.cpp', 'libANGLE/angletypes.cpp',
'libANGLE/angletypes.h', 'libANGLE/angletypes.h',
'libANGLE/export.h',
'libANGLE/features.h',
'libANGLE/formatutils.cpp', 'libANGLE/formatutils.cpp',
'libANGLE/formatutils.h', 'libANGLE/formatutils.h',
'libANGLE/queryconversions.cpp', 'libANGLE/queryconversions.cpp',
...@@ -345,6 +346,7 @@ ...@@ -345,6 +346,7 @@
'libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp', 'libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp',
'libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h', 'libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h',
], ],
'libangle_static%': 1,
}, },
# Everything below this is duplicated in the GN build. If you change # Everything below this is duplicated in the GN build. If you change
# anything also change angle/BUILD.gn # anything also change angle/BUILD.gn
...@@ -352,11 +354,8 @@ ...@@ -352,11 +354,8 @@
[ [
{ {
'target_name': 'libANGLE', 'target_name': 'libANGLE',
#TODO(jamdill/geofflang): support shared
'type': 'static_library',
'dependencies': [ 'translator', 'commit_id', ], 'dependencies': [ 'translator', 'commit_id', ],
'includes': [ '../build/common_defines.gypi', ], 'includes': [ '../build/common_defines.gypi', ],
'include_dirs': 'include_dirs':
[ [
'.', '.',
...@@ -375,6 +374,7 @@ ...@@ -375,6 +374,7 @@
'GL_GLEXT_PROTOTYPES=', 'GL_GLEXT_PROTOTYPES=',
'EGLAPI=', 'EGLAPI=',
'ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ "d3dcompiler_47.dll", "d3dcompiler_46.dll", "d3dcompiler_43.dll" }', 'ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ "d3dcompiler_47.dll", "d3dcompiler_46.dll", "d3dcompiler_43.dll" }',
'LIBANGLE_IMPLEMENTATION',
], ],
'direct_dependent_settings': 'direct_dependent_settings':
{ {
...@@ -382,7 +382,6 @@ ...@@ -382,7 +382,6 @@
[ [
'.', '.',
'../include', '../include',
'libANGLE',
], ],
'defines': 'defines':
[ [
...@@ -391,16 +390,6 @@ ...@@ -391,16 +390,6 @@
'EGLAPI=', 'EGLAPI=',
'ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ "d3dcompiler_47.dll", "d3dcompiler_46.dll", "d3dcompiler_43.dll" }', 'ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ "d3dcompiler_47.dll", "d3dcompiler_46.dll", "d3dcompiler_43.dll" }',
], ],
'configurations':
{
'Debug_Base':
{
'defines':
[
'ANGLE_ENABLE_DEBUG_ANNOTATIONS',
],
},
},
'conditions': 'conditions':
[ [
['angle_enable_d3d9==1', ['angle_enable_d3d9==1',
...@@ -421,6 +410,24 @@ ...@@ -421,6 +410,24 @@
}, },
'conditions': 'conditions':
[ [
['libangle_static==1',
{
'defines':
[
'LIBANGLE_STATIC',
],
'direct_dependent_settings':
{
'defines':
[
'LIBANGLE_STATIC',
],
},
'type': 'static_library',
},
{ # 'libangle_static==0'
'type': 'shared_library',
}],
['angle_enable_d3d9==1 or angle_enable_d3d11==1', ['angle_enable_d3d9==1 or angle_enable_d3d11==1',
{ {
'sources': 'sources':
...@@ -565,6 +572,14 @@ ...@@ -565,6 +572,14 @@
'includes': [ '../build/common_defines.gypi', ], 'includes': [ '../build/common_defines.gypi', ],
'sources': 'sources':
[ [
'common/angleutils.cpp',
'common/angleutils.h',
'common/debug.cpp',
'common/debug.h',
'common/event_tracer.cpp',
'common/event_tracer.h',
'common/tls.cpp',
'common/tls.h',
'libGLESv2/libGLESv2.cpp', 'libGLESv2/libGLESv2.cpp',
'libGLESv2/libGLESv2.def', 'libGLESv2/libGLESv2.def',
'libGLESv2/libGLESv2.rc', 'libGLESv2/libGLESv2.rc',
...@@ -572,6 +587,10 @@ ...@@ -572,6 +587,10 @@
'libGLESv2/main.h', 'libGLESv2/main.h',
'libGLESv2/resource.h', 'libGLESv2/resource.h',
], ],
'defines':
[
'LIBGLESV2_IMPLEMENTATION',
],
'conditions': 'conditions':
[ [
['angle_build_winrt==1', ['angle_build_winrt==1',
......
...@@ -92,10 +92,6 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved ...@@ -92,10 +92,6 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved
{ {
return FALSE; return FALSE;
} }
#ifdef ANGLE_ENABLE_DEBUG_ANNOTATIONS
gl::InitializeDebugAnnotations();
#endif
} }
// Fall through to initialize index // Fall through to initialize index
case DLL_THREAD_ATTACH: case DLL_THREAD_ATTACH:
...@@ -112,10 +108,6 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved ...@@ -112,10 +108,6 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved
{ {
gl::DeallocateCurrent(); gl::DeallocateCurrent();
gl::DestroyThreadLocalIndex(); gl::DestroyThreadLocalIndex();
#ifdef ANGLE_ENABLE_DEBUG_ANNOTATIONS
gl::UninitializeDebugAnnotations();
#endif
} }
break; break;
default: default:
......
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