From aae8678c905fa7e6ac8e95b1f26f2af4f29510c1 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 6 Oct 2014 18:02:43 +0200 Subject: [PATCH] Bug 1076743 - Fixed angle compilation with mingw. (upstream part) --HG-- rename : gfx/angle/src/libGLESv2/constants.h => gfx/angle/src/libGLESv2/Constants.h extra : rebase_source : 3147126bc9ccd9df61f4f27e91efe397a6538943 --- gfx/angle/src/common/debug.h | 2 +- gfx/angle/src/libEGL/Display.cpp | 1 + gfx/angle/src/libGLESv2.gypi | 2 +- .../libGLESv2/{constants.h => Constants.h} | 0 gfx/angle/src/libGLESv2/Context.cpp | 5 +-- gfx/angle/src/libGLESv2/Framebuffer.h | 2 +- gfx/angle/src/libGLESv2/Texture.h | 2 +- gfx/angle/src/libGLESv2/VertexArray.h | 2 +- gfx/angle/src/libGLESv2/angletypes.h | 2 +- .../src/libGLESv2/renderer/copyimage.cpp | 2 +- .../src/libGLESv2/renderer/copyimage.inl | 2 +- .../src/libGLESv2/renderer/d3d/DynamicHLSL.h | 2 +- .../src/libGLESv2/renderer/d3d/TextureD3D.cpp | 4 +-- .../src/libGLESv2/renderer/d3d/TextureD3D.h | 2 +- gfx/angle/src/libGLESv2/validationES.cpp | 2 +- .../src/third_party/trace_event/trace_event.h | 33 +------------------ 16 files changed, 18 insertions(+), 47 deletions(-) rename gfx/angle/src/libGLESv2/{constants.h => Constants.h} (100%) diff --git a/gfx/angle/src/common/debug.h b/gfx/angle/src/common/debug.h index 997ebca6be0d..4834161c728b 100644 --- a/gfx/angle/src/common/debug.h +++ b/gfx/angle/src/common/debug.h @@ -124,7 +124,7 @@ namespace gl #endif // A macro functioning as a compile-time assert to validate constant conditions -#if defined(_MSC_VER) && _MSC_VER >= 1600 +#if (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__GNUC__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3)) #define META_ASSERT_MSG(condition, msg) static_assert(condition, msg) #else #define META_ASSERT_CONCAT(a, b) a ## b diff --git a/gfx/angle/src/libEGL/Display.cpp b/gfx/angle/src/libEGL/Display.cpp index 43d9b2602e5c..8777aae8eb48 100644 --- a/gfx/angle/src/libEGL/Display.cpp +++ b/gfx/angle/src/libEGL/Display.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include "common/debug.h" #include "common/mathutil.h" diff --git a/gfx/angle/src/libGLESv2.gypi b/gfx/angle/src/libGLESv2.gypi index bc0c31067734..e3560d65c823 100644 --- a/gfx/angle/src/libGLESv2.gypi +++ b/gfx/angle/src/libGLESv2.gypi @@ -46,6 +46,7 @@ 'libGLESv2/Buffer.h', 'libGLESv2/Caps.cpp', 'libGLESv2/Caps.h', + 'libGLESv2/Constants.h', 'libGLESv2/Context.cpp', 'libGLESv2/Context.h', 'libGLESv2/Error.cpp', @@ -87,7 +88,6 @@ 'libGLESv2/VertexAttribute.h', 'libGLESv2/angletypes.cpp', 'libGLESv2/angletypes.h', - 'libGLESv2/constants.h', 'libGLESv2/formatutils.cpp', 'libGLESv2/formatutils.h', 'libGLESv2/libGLESv2.cpp', diff --git a/gfx/angle/src/libGLESv2/constants.h b/gfx/angle/src/libGLESv2/Constants.h similarity index 100% rename from gfx/angle/src/libGLESv2/constants.h rename to gfx/angle/src/libGLESv2/Constants.h diff --git a/gfx/angle/src/libGLESv2/Context.cpp b/gfx/angle/src/libGLESv2/Context.cpp index 5569bd01760e..9f249991872c 100644 --- a/gfx/angle/src/libGLESv2/Context.cpp +++ b/gfx/angle/src/libGLESv2/Context.cpp @@ -33,6 +33,7 @@ #include "libEGL/Surface.h" #include +#include namespace gl { @@ -341,7 +342,7 @@ void Context::deleteFenceSync(GLsync fenceSync) // wait commands finish. However, since the name becomes invalid, we cannot query the fence, // and since our API is currently designed for being called from a single thread, we can delete // the fence immediately. - mResourceManager->deleteFenceSync(reinterpret_cast(fenceSync)); + mResourceManager->deleteFenceSync(reinterpret_cast(fenceSync)); } void Context::deleteVertexArray(GLuint vertexArray) @@ -447,7 +448,7 @@ Renderbuffer *Context::getRenderbuffer(GLuint handle) FenceSync *Context::getFenceSync(GLsync handle) const { - return mResourceManager->getFenceSync(reinterpret_cast(handle)); + return mResourceManager->getFenceSync(reinterpret_cast(handle)); } VertexArray *Context::getVertexArray(GLuint handle) const diff --git a/gfx/angle/src/libGLESv2/Framebuffer.h b/gfx/angle/src/libGLESv2/Framebuffer.h index de84fbfe5a84..3d9ea611d2d7 100644 --- a/gfx/angle/src/libGLESv2/Framebuffer.h +++ b/gfx/angle/src/libGLESv2/Framebuffer.h @@ -12,7 +12,7 @@ #include "common/angleutils.h" #include "common/RefCountObject.h" -#include "constants.h" +#include "Constants.h" namespace rx { diff --git a/gfx/angle/src/libGLESv2/Texture.h b/gfx/angle/src/libGLESv2/Texture.h index 3008a8488407..79b3be3979db 100644 --- a/gfx/angle/src/libGLESv2/Texture.h +++ b/gfx/angle/src/libGLESv2/Texture.h @@ -14,7 +14,7 @@ #include "common/debug.h" #include "common/RefCountObject.h" #include "libGLESv2/angletypes.h" -#include "libGLESv2/constants.h" +#include "libGLESv2/Constants.h" #include "libGLESv2/renderer/TextureImpl.h" #include "libGLESv2/Caps.h" diff --git a/gfx/angle/src/libGLESv2/VertexArray.h b/gfx/angle/src/libGLESv2/VertexArray.h index 993ba042cfd4..965187a77155 100644 --- a/gfx/angle/src/libGLESv2/VertexArray.h +++ b/gfx/angle/src/libGLESv2/VertexArray.h @@ -14,7 +14,7 @@ #define LIBGLESV2_VERTEXARRAY_H_ #include "common/RefCountObject.h" -#include "libGLESv2/constants.h" +#include "libGLESv2/Constants.h" #include "libGLESv2/VertexAttribute.h" #include diff --git a/gfx/angle/src/libGLESv2/angletypes.h b/gfx/angle/src/libGLESv2/angletypes.h index 79ad810e9e43..214673442491 100644 --- a/gfx/angle/src/libGLESv2/angletypes.h +++ b/gfx/angle/src/libGLESv2/angletypes.h @@ -9,7 +9,7 @@ #ifndef LIBGLESV2_ANGLETYPES_H_ #define LIBGLESV2_ANGLETYPES_H_ -#include "libGLESv2/constants.h" +#include "libGLESv2/Constants.h" #include "common/RefCountObject.h" namespace gl diff --git a/gfx/angle/src/libGLESv2/renderer/copyimage.cpp b/gfx/angle/src/libGLESv2/renderer/copyimage.cpp index 004223d70f88..aabc9f04e9b6 100644 --- a/gfx/angle/src/libGLESv2/renderer/copyimage.cpp +++ b/gfx/angle/src/libGLESv2/renderer/copyimage.cpp @@ -6,7 +6,7 @@ // copyimage.cpp: Defines image copying functions -#include "libGLESv2/renderer/copyImage.h" +#include "libGLESv2/renderer/copyimage.h" namespace rx { diff --git a/gfx/angle/src/libGLESv2/renderer/copyimage.inl b/gfx/angle/src/libGLESv2/renderer/copyimage.inl index ea6970cef359..0498cf7750a0 100644 --- a/gfx/angle/src/libGLESv2/renderer/copyimage.inl +++ b/gfx/angle/src/libGLESv2/renderer/copyimage.inl @@ -24,7 +24,7 @@ inline void WriteColor(const uint8_t *source, uint8_t *dest) template inline void CopyPixel(const uint8_t *source, uint8_t *dest) { - colorType temp; + colorDataType temp; ReadColor(source, &temp); WriteColor(&temp, dest); } diff --git a/gfx/angle/src/libGLESv2/renderer/d3d/DynamicHLSL.h b/gfx/angle/src/libGLESv2/renderer/d3d/DynamicHLSL.h index 6ee7b11cf28b..14f637e20847 100644 --- a/gfx/angle/src/libGLESv2/renderer/d3d/DynamicHLSL.h +++ b/gfx/angle/src/libGLESv2/renderer/d3d/DynamicHLSL.h @@ -10,7 +10,7 @@ #define LIBGLESV2_RENDERER_DYNAMIC_HLSL_H_ #include "common/angleutils.h" -#include "libGLESv2/constants.h" +#include "libGLESv2/Constants.h" #include "angle_gl.h" diff --git a/gfx/angle/src/libGLESv2/renderer/d3d/TextureD3D.cpp b/gfx/angle/src/libGLESv2/renderer/d3d/TextureD3D.cpp index 5e29e4b45be7..917b64c435d8 100644 --- a/gfx/angle/src/libGLESv2/renderer/d3d/TextureD3D.cpp +++ b/gfx/angle/src/libGLESv2/renderer/d3d/TextureD3D.cpp @@ -129,7 +129,7 @@ bool TextureD3D::subImage(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei w if (unpack.pixelBuffer.id() != 0) { gl::Buffer *pixelBuffer = unpack.pixelBuffer.get(); - unsigned int offset = reinterpret_cast(pixels); + uintptr_t offset = reinterpret_cast(pixels); // TODO: setImage/subImage is the only place outside of renderer that asks for a buffers raw data. // This functionality should be moved into renderer and the getData method of BufferImpl removed. const void *bufferData = pixelBuffer->getImplementation()->getData(); @@ -183,7 +183,7 @@ bool TextureD3D::fastUnpackPixels(const gl::PixelUnpackState &unpack, const void // to create a render target. ASSERT(mRenderer->supportsFastCopyBufferToTexture(sizedInternalFormat)); - unsigned int offset = reinterpret_cast(pixels); + uintptr_t offset = reinterpret_cast(pixels); return mRenderer->fastCopyBufferToTexture(unpack, offset, destRenderTarget, sizedInternalFormat, type, destArea); } diff --git a/gfx/angle/src/libGLESv2/renderer/d3d/TextureD3D.h b/gfx/angle/src/libGLESv2/renderer/d3d/TextureD3D.h index 7f2163077b12..ec47ee23b3b7 100644 --- a/gfx/angle/src/libGLESv2/renderer/d3d/TextureD3D.h +++ b/gfx/angle/src/libGLESv2/renderer/d3d/TextureD3D.h @@ -11,7 +11,7 @@ #include "libGLESv2/renderer/TextureImpl.h" #include "libGLESv2/angletypes.h" -#include "libGLESv2/constants.h" +#include "libGLESv2/Constants.h" namespace gl { diff --git a/gfx/angle/src/libGLESv2/validationES.cpp b/gfx/angle/src/libGLESv2/validationES.cpp index 8016dfbf90ea..0a5065900824 100644 --- a/gfx/angle/src/libGLESv2/validationES.cpp +++ b/gfx/angle/src/libGLESv2/validationES.cpp @@ -1646,7 +1646,7 @@ bool ValidateDrawElements(Context *context, GLenum mode, GLsizei count, GLenum t // TODO: also disable index checking on back-ends that are robust to out-of-range accesses. if (elementArrayBuffer) { - unsigned int offset = reinterpret_cast(indices); + uintptr_t offset = reinterpret_cast(indices); if (!elementArrayBuffer->getIndexRangeCache()->findRange(type, offset, count, indexRangeOut, NULL)) { const void *dataPointer = elementArrayBuffer->getImplementation()->getData(); diff --git a/gfx/angle/src/third_party/trace_event/trace_event.h b/gfx/angle/src/third_party/trace_event/trace_event.h index 188005631b50..af59dcfcc3a3 100644 --- a/gfx/angle/src/third_party/trace_event/trace_event.h +++ b/gfx/angle/src/third_party/trace_event/trace_event.h @@ -587,7 +587,7 @@ const unsigned long long noEventId = 0; class TraceID { public: explicit TraceID(const void* id, unsigned char* flags) : - m_data(static_cast(reinterpret_cast(id))) + m_data(static_cast(reinterpret_cast(id))) { *flags |= TRACE_EVENT_FLAG_MANGLE_ID; } @@ -788,37 +788,6 @@ private: Data m_data; }; -// TraceEventSamplingStateScope records the current sampling state -// and sets a new sampling state. When the scope exists, it restores -// the sampling state having recorded. -template -class SamplingStateScope { -public: - SamplingStateScope(const char* categoryAndName) - { - m_previousState = SamplingStateScope::current(); - SamplingStateScope::set(categoryAndName); - } - - ~SamplingStateScope() - { - SamplingStateScope::set(m_previousState); - } - - // FIXME: Make load/store to traceSamplingState[] thread-safe and atomic. - static inline const char* current() - { - return reinterpret_cast(*gl::traceSamplingState[BucketNumber]); - } - static inline void set(const char* categoryAndName) - { - *gl::traceSamplingState[BucketNumber] = reinterpret_cast(const_cast(categoryAndName)); - } - -private: - const char* m_previousState; -}; - } // namespace TraceEvent } // namespace gl