From e12ba07322cd61c5cf50c25ed8d1f08f6b1ff879 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 24 Mar 2016 12:38:18 +0100 Subject: Update ANGLE to chromium/2651 Change-Id: I1cd32b780b1a0b913fab870e155ae1f4f9ac40d7 Reviewed-by: Maurice Kalinowski --- src/3rdparty/angle/include/platform/Platform.h | 78 ++++++++++++++++++++++---- 1 file changed, 67 insertions(+), 11 deletions(-) (limited to 'src/3rdparty/angle/include/platform') diff --git a/src/3rdparty/angle/include/platform/Platform.h b/src/3rdparty/angle/include/platform/Platform.h index d915d5c0fd..0e8cdf477f 100644 --- a/src/3rdparty/angle/include/platform/Platform.h +++ b/src/3rdparty/angle/include/platform/Platform.h @@ -11,7 +11,24 @@ #include -#include "../export.h" +#if defined(_WIN32) +# if !defined(LIBANGLE_IMPLEMENTATION) +# define ANGLE_PLATFORM_EXPORT __declspec(dllimport) +# endif +#elif defined(__GNUC__) +# if defined(LIBANGLE_IMPLEMENTATION) +# define ANGLE_PLATFORM_EXPORT __attribute__((visibility ("default"))) +# endif +#endif +#if !defined(ANGLE_PLATFORM_EXPORT) +# define ANGLE_PLATFORM_EXPORT +#endif + +#if defined(_WIN32) +# define ANGLE_APIENTRY __stdcall +#else +# define ANGLE_APIENTRY +#endif namespace angle { @@ -20,8 +37,39 @@ class Platform { public: + // System -------------------------------------------------------------- + + // Wall clock time in seconds since the epoch. + // TODO(jmadill): investigate using an ANGLE internal time library + virtual double currentTime() { return 0; } + + // Monotonically increasing time in seconds from an arbitrary fixed point in the past. + // This function is expected to return at least millisecond-precision values. For this reason, + // it is recommended that the fixed point be no further in the past than the epoch. + virtual double monotonicallyIncreasingTime() { return 0; } + + // Logging ------------------------------------------------------------ + + // Log an error message within the platform implementation. + virtual void logError(const char *errorMessage) {} + + // Log a warning message within the platform implementation. + virtual void logWarning(const char *warningMessage) {} + + // Log an info message within the platform implementation. + virtual void logInfo(const char *infoMessage) {} + // Tracing -------- + // Get a pointer to the enabled state of the given trace category. The + // embedder can dynamically change the enabled state as trace event + // recording is started and stopped by the application. Only long-lived + // literal strings should be given as the category name. The implementation + // expects the returned pointer to be held permanently in a local static. If + // the unsigned char is non-zero, tracing is enabled. If tracing is enabled, + // addTraceEvent is expected to be called by the trace event macros. + virtual const unsigned char *getTraceCategoryEnabledFlag(const char *categoryName) { return 0; } + typedef uint64_t TraceEventHandle; // Add a trace event to the platform tracing system. Depending on the actual @@ -47,6 +95,7 @@ class Platform // - id optionally allows events of the same name to be distinguished from // each other. For example, to trace the consutruction and destruction of // objects, specify the pointer as the id parameter. + // - timestamp should be a time value returned from monotonicallyIncreasingTime. // - numArgs specifies the number of elements in argNames, argTypes, and // argValues. // - argNames is the array of argument names. Use long-lived literal strings @@ -84,15 +133,17 @@ class Platform } // Set the duration field of a COMPLETE trace event. - virtual void updateTraceEventDuration(const unsigned char* categoryEnabledFlag, const char* name, TraceEventHandle) { } + virtual void updateTraceEventDuration(const unsigned char *categoryEnabledFlag, const char *name, TraceEventHandle eventHandle) { } // Callbacks for reporting histogram data. // CustomCounts histogram has exponential bucket sizes, so that min=1, max=1000000, bucketCount=50 would do. - virtual void histogramCustomCounts(const char* name, int sample, int min, int max, int bucketCount) { } + virtual void histogramCustomCounts(const char *name, int sample, int min, int max, int bucketCount) { } // Enumeration histogram buckets are linear, boundaryValue should be larger than any possible sample value. - virtual void histogramEnumeration(const char* name, int sample, int boundaryValue) { } + virtual void histogramEnumeration(const char *name, int sample, int boundaryValue) { } // Unlike enumeration histograms, sparse histograms only allocate memory for non-empty buckets. - virtual void histogramSparse(const char* name, int sample) { } + virtual void histogramSparse(const char *name, int sample) { } + // Boolean histograms track two-state variables. + virtual void histogramBoolean(const char *name, bool sample) { } protected: virtual ~Platform() { } @@ -100,13 +151,18 @@ class Platform } -typedef void(*ANGLEPlatformInitializeFunc)(angle::Platform*); -ANGLE_EXPORT void ANGLEPlatformInitialize(angle::Platform*); +extern "C" +{ + +typedef void (ANGLE_APIENTRY *ANGLEPlatformInitializeFunc)(angle::Platform*); +ANGLE_PLATFORM_EXPORT void ANGLE_APIENTRY ANGLEPlatformInitialize(angle::Platform*); + +typedef void (ANGLE_APIENTRY *ANGLEPlatformShutdownFunc)(); +ANGLE_PLATFORM_EXPORT void ANGLE_APIENTRY ANGLEPlatformShutdown(); -typedef void (*ANGLEPlatformShutdownFunc)(); -ANGLE_EXPORT void ANGLEPlatformShutdown(); +typedef angle::Platform *(ANGLE_APIENTRY *ANGLEPlatformCurrentFunc)(); +ANGLE_PLATFORM_EXPORT angle::Platform *ANGLE_APIENTRY ANGLEPlatformCurrent(); -typedef angle::Platform *(*ANGLEPlatformCurrentFunc)(); -ANGLE_EXPORT angle::Platform *ANGLEPlatformCurrent(); +} #endif // ANGLE_PLATFORM_H -- cgit v1.2.3