Commit a5521de2 by Jacek Caban Committed by Shannon Woods

Fixed mingw compilation.

Change-Id: I8ae33c752feb19e291e4a3b128d21a0ced883c90 Reviewed-on: https://chromium-review.googlesource.com/220761Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Tested-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent ac7556f6
...@@ -81,6 +81,7 @@ Turbulenz ...@@ -81,6 +81,7 @@ Turbulenz
Ulrik Persson (ddefrostt) Ulrik Persson (ddefrostt)
Mark Banner (standard8mbp) Mark Banner (standard8mbp)
David Kilzer David Kilzer
Jacek Caban
Microsoft Open Technologies, Inc. Microsoft Open Technologies, Inc.
Cooper Partin Cooper Partin
......
...@@ -128,7 +128,7 @@ namespace gl ...@@ -128,7 +128,7 @@ namespace gl
#endif #endif
// A macro functioning as a compile-time assert to validate constant conditions // 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) #define META_ASSERT_MSG(condition, msg) static_assert(condition, msg)
#else #else
#define META_ASSERT_CONCAT(a, b) a ## b #define META_ASSERT_CONCAT(a, b) a ## b
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <map> #include <map>
#include <vector> #include <vector>
#include <sstream> #include <sstream>
#include <iterator>
#include "common/debug.h" #include "common/debug.h"
#include "common/mathutil.h" #include "common/mathutil.h"
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
'libGLESv2/Buffer.h', 'libGLESv2/Buffer.h',
'libGLESv2/Caps.cpp', 'libGLESv2/Caps.cpp',
'libGLESv2/Caps.h', 'libGLESv2/Caps.h',
'libGLESv2/Constants.h',
'libGLESv2/Context.cpp', 'libGLESv2/Context.cpp',
'libGLESv2/Context.h', 'libGLESv2/Context.h',
'libGLESv2/Error.cpp', 'libGLESv2/Error.cpp',
...@@ -91,7 +92,6 @@ ...@@ -91,7 +92,6 @@
'libGLESv2/VertexAttribute.h', 'libGLESv2/VertexAttribute.h',
'libGLESv2/angletypes.cpp', 'libGLESv2/angletypes.cpp',
'libGLESv2/angletypes.h', 'libGLESv2/angletypes.h',
'libGLESv2/constants.h',
'libGLESv2/formatutils.cpp', 'libGLESv2/formatutils.cpp',
'libGLESv2/formatutils.h', 'libGLESv2/formatutils.h',
'libGLESv2/main.cpp', 'libGLESv2/main.cpp',
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "libEGL/Surface.h" #include "libEGL/Surface.h"
#include <sstream> #include <sstream>
#include <iterator>
namespace gl namespace gl
{ {
...@@ -354,7 +355,7 @@ void Context::deleteFenceSync(GLsync fenceSync) ...@@ -354,7 +355,7 @@ void Context::deleteFenceSync(GLsync fenceSync)
// wait commands finish. However, since the name becomes invalid, we cannot query the fence, // 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 // and since our API is currently designed for being called from a single thread, we can delete
// the fence immediately. // the fence immediately.
mResourceManager->deleteFenceSync(reinterpret_cast<GLuint>(fenceSync)); mResourceManager->deleteFenceSync(reinterpret_cast<uintptr_t>(fenceSync));
} }
void Context::deleteVertexArray(GLuint vertexArray) void Context::deleteVertexArray(GLuint vertexArray)
...@@ -460,7 +461,7 @@ Renderbuffer *Context::getRenderbuffer(GLuint handle) ...@@ -460,7 +461,7 @@ Renderbuffer *Context::getRenderbuffer(GLuint handle)
FenceSync *Context::getFenceSync(GLsync handle) const FenceSync *Context::getFenceSync(GLsync handle) const
{ {
return mResourceManager->getFenceSync(reinterpret_cast<GLuint>(handle)); return mResourceManager->getFenceSync(reinterpret_cast<uintptr_t>(handle));
} }
VertexArray *Context::getVertexArray(GLuint handle) const VertexArray *Context::getVertexArray(GLuint handle) const
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "common/angleutils.h" #include "common/angleutils.h"
#include "common/RefCountObject.h" #include "common/RefCountObject.h"
#include "constants.h" #include "Constants.h"
namespace rx namespace rx
{ {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "common/debug.h" #include "common/debug.h"
#include "common/RefCountObject.h" #include "common/RefCountObject.h"
#include "libGLESv2/angletypes.h" #include "libGLESv2/angletypes.h"
#include "libGLESv2/constants.h" #include "libGLESv2/Constants.h"
#include "libGLESv2/renderer/TextureImpl.h" #include "libGLESv2/renderer/TextureImpl.h"
#include "libGLESv2/Caps.h" #include "libGLESv2/Caps.h"
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define LIBGLESV2_VERTEXARRAY_H_ #define LIBGLESV2_VERTEXARRAY_H_
#include "common/RefCountObject.h" #include "common/RefCountObject.h"
#include "libGLESv2/constants.h" #include "libGLESv2/Constants.h"
#include "libGLESv2/VertexAttribute.h" #include "libGLESv2/VertexAttribute.h"
#include <vector> #include <vector>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#ifndef LIBGLESV2_ANGLETYPES_H_ #ifndef LIBGLESV2_ANGLETYPES_H_
#define LIBGLESV2_ANGLETYPES_H_ #define LIBGLESV2_ANGLETYPES_H_
#include "libGLESv2/constants.h" #include "libGLESv2/Constants.h"
#include "common/RefCountObject.h" #include "common/RefCountObject.h"
namespace gl namespace gl
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// copyimage.cpp: Defines image copying functions // copyimage.cpp: Defines image copying functions
#include "libGLESv2/renderer/copyImage.h" #include "libGLESv2/renderer/copyimage.h"
namespace rx namespace rx
{ {
......
...@@ -24,7 +24,7 @@ inline void WriteColor(const uint8_t *source, uint8_t *dest) ...@@ -24,7 +24,7 @@ inline void WriteColor(const uint8_t *source, uint8_t *dest)
template <typename sourceType, typename destType, typename colorDataType> template <typename sourceType, typename destType, typename colorDataType>
inline void CopyPixel(const uint8_t *source, uint8_t *dest) inline void CopyPixel(const uint8_t *source, uint8_t *dest)
{ {
colorType temp; colorDataType temp;
ReadColor<sourceType, colorDataType>(source, &temp); ReadColor<sourceType, colorDataType>(source, &temp);
WriteColor<destType, colorDataType>(&temp, dest); WriteColor<destType, colorDataType>(&temp, dest);
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#define LIBGLESV2_RENDERER_DYNAMIC_HLSL_H_ #define LIBGLESV2_RENDERER_DYNAMIC_HLSL_H_
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libGLESv2/constants.h" #include "libGLESv2/Constants.h"
#include "angle_gl.h" #include "angle_gl.h"
......
...@@ -136,7 +136,7 @@ gl::Error TextureD3D::subImage(GLint xoffset, GLint yoffset, GLint zoffset, GLsi ...@@ -136,7 +136,7 @@ gl::Error TextureD3D::subImage(GLint xoffset, GLint yoffset, GLint zoffset, GLsi
if (unpack.pixelBuffer.id() != 0) if (unpack.pixelBuffer.id() != 0)
{ {
gl::Buffer *pixelBuffer = unpack.pixelBuffer.get(); gl::Buffer *pixelBuffer = unpack.pixelBuffer.get();
unsigned int offset = reinterpret_cast<unsigned int>(pixels); uintptr_t offset = reinterpret_cast<uintptr_t>(pixels);
// TODO: setImage/subImage is the only place outside of renderer that asks for a buffers raw data. // 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. // This functionality should be moved into renderer and the getData method of BufferImpl removed.
const void *bufferData = pixelBuffer->getImplementation()->getData(); const void *bufferData = pixelBuffer->getImplementation()->getData();
...@@ -212,7 +212,7 @@ gl::Error TextureD3D::fastUnpackPixels(const gl::PixelUnpackState &unpack, const ...@@ -212,7 +212,7 @@ gl::Error TextureD3D::fastUnpackPixels(const gl::PixelUnpackState &unpack, const
// to create a render target. // to create a render target.
ASSERT(mRenderer->supportsFastCopyBufferToTexture(sizedInternalFormat)); ASSERT(mRenderer->supportsFastCopyBufferToTexture(sizedInternalFormat));
unsigned int offset = reinterpret_cast<unsigned int>(pixels); uintptr_t offset = reinterpret_cast<uintptr_t>(pixels);
gl::Error error = mRenderer->fastCopyBufferToTexture(unpack, offset, destRenderTarget, sizedInternalFormat, type, destArea); gl::Error error = mRenderer->fastCopyBufferToTexture(unpack, offset, destRenderTarget, sizedInternalFormat, type, destArea);
if (error.isError()) if (error.isError())
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "libGLESv2/renderer/TextureImpl.h" #include "libGLESv2/renderer/TextureImpl.h"
#include "libGLESv2/angletypes.h" #include "libGLESv2/angletypes.h"
#include "libGLESv2/constants.h" #include "libGLESv2/Constants.h"
namespace gl namespace gl
{ {
......
...@@ -1667,7 +1667,7 @@ bool ValidateDrawElements(Context *context, GLenum mode, GLsizei count, GLenum t ...@@ -1667,7 +1667,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. // TODO: also disable index checking on back-ends that are robust to out-of-range accesses.
if (elementArrayBuffer) if (elementArrayBuffer)
{ {
unsigned int offset = reinterpret_cast<unsigned int>(indices); uintptr_t offset = reinterpret_cast<uintptr_t>(indices);
if (!elementArrayBuffer->getIndexRangeCache()->findRange(type, offset, count, indexRangeOut, NULL)) if (!elementArrayBuffer->getIndexRangeCache()->findRange(type, offset, count, indexRangeOut, NULL))
{ {
const void *dataPointer = elementArrayBuffer->getImplementation()->getData(); const void *dataPointer = elementArrayBuffer->getImplementation()->getData();
......
...@@ -587,7 +587,7 @@ const unsigned long long noEventId = 0; ...@@ -587,7 +587,7 @@ const unsigned long long noEventId = 0;
class TraceID { class TraceID {
public: public:
explicit TraceID(const void* id, unsigned char* flags) : explicit TraceID(const void* id, unsigned char* flags) :
m_data(static_cast<unsigned long long>(reinterpret_cast<unsigned long>(id))) m_data(static_cast<unsigned long long>(reinterpret_cast<uintptr_t>(id)))
{ {
*flags |= TRACE_EVENT_FLAG_MANGLE_ID; *flags |= TRACE_EVENT_FLAG_MANGLE_ID;
} }
...@@ -788,37 +788,6 @@ private: ...@@ -788,37 +788,6 @@ private:
Data m_data; 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<size_t BucketNumber>
class SamplingStateScope {
public:
SamplingStateScope(const char* categoryAndName)
{
m_previousState = SamplingStateScope<BucketNumber>::current();
SamplingStateScope<BucketNumber>::set(categoryAndName);
}
~SamplingStateScope()
{
SamplingStateScope<BucketNumber>::set(m_previousState);
}
// FIXME: Make load/store to traceSamplingState[] thread-safe and atomic.
static inline const char* current()
{
return reinterpret_cast<const char*>(*gl::traceSamplingState[BucketNumber]);
}
static inline void set(const char* categoryAndName)
{
*gl::traceSamplingState[BucketNumber] = reinterpret_cast<long>(const_cast<char*>(categoryAndName));
}
private:
const char* m_previousState;
};
} // namespace TraceEvent } // namespace TraceEvent
} // namespace gl } // namespace gl
......
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