Commit cd1db9e6 by Jamie Madill

Avoid using std::unordered_map on OSX.

This c++11 standard library class isn't available on Chromium/OSX. For now we can replace it with std::map. BUG=angle:773 Change-Id: I0b8ab0de5192a23408755d03df2b9f738f28d762 Reviewed-on: https://chromium-review.googlesource.com/238445Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent b78b42dd
...@@ -8,11 +8,12 @@ ...@@ -8,11 +8,12 @@
#define LIBANGLE_CAPS_H_ #define LIBANGLE_CAPS_H_
#include "angle_gl.h" #include "angle_gl.h"
#include "libANGLE/angletypes.h"
#include <map>
#include <set> #include <set>
#include <unordered_map>
#include <vector>
#include <string> #include <string>
#include <vector>
namespace gl namespace gl
{ {
...@@ -45,7 +46,7 @@ struct TextureCaps ...@@ -45,7 +46,7 @@ struct TextureCaps
class TextureCapsMap class TextureCapsMap
{ {
public: public:
typedef std::unordered_map<GLenum, TextureCaps>::const_iterator const_iterator; typedef std::map<GLenum, TextureCaps>::const_iterator const_iterator;
void insert(GLenum internalFormat, const TextureCaps &caps); void insert(GLenum internalFormat, const TextureCaps &caps);
void remove(GLenum internalFormat); void remove(GLenum internalFormat);
...@@ -58,7 +59,7 @@ class TextureCapsMap ...@@ -58,7 +59,7 @@ class TextureCapsMap
size_t size() const; size_t size() const;
private: private:
typedef std::unordered_map<GLenum, TextureCaps> InternalFormatToCapsMap; typedef std::map<GLenum, TextureCaps> InternalFormatToCapsMap;
InternalFormatToCapsMap mCapsMap; InternalFormatToCapsMap mCapsMap;
}; };
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include <string> #include <string>
#include <set> #include <set>
#include <map> #include <map>
#include <unordered_map>
#include <array>
namespace rx namespace rx
{ {
...@@ -237,24 +235,24 @@ class Context ...@@ -237,24 +235,24 @@ class Context
TextureMap mZeroTextures; TextureMap mZeroTextures;
typedef std::unordered_map<GLuint, Framebuffer*> FramebufferMap; typedef std::map<GLuint, Framebuffer*> FramebufferMap;
FramebufferMap mFramebufferMap; FramebufferMap mFramebufferMap;
HandleAllocator mFramebufferHandleAllocator; HandleAllocator mFramebufferHandleAllocator;
typedef std::unordered_map<GLuint, FenceNV*> FenceNVMap; typedef std::map<GLuint, FenceNV*> FenceNVMap;
FenceNVMap mFenceNVMap; FenceNVMap mFenceNVMap;
HandleAllocator mFenceNVHandleAllocator; HandleAllocator mFenceNVHandleAllocator;
typedef std::unordered_map<GLuint, Query*> QueryMap; typedef std::map<GLuint, Query*> QueryMap;
QueryMap mQueryMap; QueryMap mQueryMap;
HandleAllocator mQueryHandleAllocator; HandleAllocator mQueryHandleAllocator;
typedef std::unordered_map<GLuint, VertexArray*> VertexArrayMap; typedef std::map<GLuint, VertexArray*> VertexArrayMap;
VertexArrayMap mVertexArrayMap; VertexArrayMap mVertexArrayMap;
HandleAllocator mVertexArrayHandleAllocator; HandleAllocator mVertexArrayHandleAllocator;
BindingPointer<TransformFeedback> mTransformFeedbackZero; BindingPointer<TransformFeedback> mTransformFeedbackZero;
typedef std::unordered_map<GLuint, TransformFeedback*> TransformFeedbackMap; typedef std::map<GLuint, TransformFeedback*> TransformFeedbackMap;
TransformFeedbackMap mTransformFeedbackMap; TransformFeedbackMap mTransformFeedbackMap;
HandleAllocator mTransformFeedbackAllocator; HandleAllocator mTransformFeedbackAllocator;
......
...@@ -10,13 +10,12 @@ ...@@ -10,13 +10,12 @@
#ifndef LIBANGLE_RESOURCEMANAGER_H_ #ifndef LIBANGLE_RESOURCEMANAGER_H_
#define LIBANGLE_RESOURCEMANAGER_H_ #define LIBANGLE_RESOURCEMANAGER_H_
#include "angle_gl.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/angletypes.h" #include "libANGLE/angletypes.h"
#include "libANGLE/HandleAllocator.h" #include "libANGLE/HandleAllocator.h"
#include "angle_gl.h" #include <map>
#include <unordered_map>
namespace rx namespace rx
{ {
...@@ -82,30 +81,30 @@ class ResourceManager ...@@ -82,30 +81,30 @@ class ResourceManager
rx::Renderer *mRenderer; rx::Renderer *mRenderer;
std::size_t mRefCount; std::size_t mRefCount;
typedef std::unordered_map<GLuint, Buffer*> BufferMap; typedef std::map<GLuint, Buffer*> BufferMap;
BufferMap mBufferMap; BufferMap mBufferMap;
HandleAllocator mBufferHandleAllocator; HandleAllocator mBufferHandleAllocator;
typedef std::unordered_map<GLuint, Shader*> ShaderMap; typedef std::map<GLuint, Shader*> ShaderMap;
ShaderMap mShaderMap; ShaderMap mShaderMap;
typedef std::unordered_map<GLuint, Program*> ProgramMap; typedef std::map<GLuint, Program*> ProgramMap;
ProgramMap mProgramMap; ProgramMap mProgramMap;
HandleAllocator mProgramShaderHandleAllocator; HandleAllocator mProgramShaderHandleAllocator;
typedef std::unordered_map<GLuint, Texture*> TextureMap; typedef std::map<GLuint, Texture*> TextureMap;
TextureMap mTextureMap; TextureMap mTextureMap;
HandleAllocator mTextureHandleAllocator; HandleAllocator mTextureHandleAllocator;
typedef std::unordered_map<GLuint, Renderbuffer*> RenderbufferMap; typedef std::map<GLuint, Renderbuffer*> RenderbufferMap;
RenderbufferMap mRenderbufferMap; RenderbufferMap mRenderbufferMap;
HandleAllocator mRenderbufferHandleAllocator; HandleAllocator mRenderbufferHandleAllocator;
typedef std::unordered_map<GLuint, Sampler*> SamplerMap; typedef std::map<GLuint, Sampler*> SamplerMap;
SamplerMap mSamplerMap; SamplerMap mSamplerMap;
HandleAllocator mSamplerHandleAllocator; HandleAllocator mSamplerHandleAllocator;
typedef std::unordered_map<GLuint, FenceSync*> FenceMap; typedef std::map<GLuint, FenceSync*> FenceMap;
FenceMap mFenceSyncMap; FenceMap mFenceSyncMap;
HandleAllocator mFenceSyncHandleAllocator; HandleAllocator mFenceSyncHandleAllocator;
}; };
......
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