Remove eglEnums.hpp includes from framework headers
authorPyry Haulos <phaulos@google.com>
Tue, 3 Feb 2015 19:23:07 +0000 (11:23 -0800)
committerPyry Haulos <phaulos@google.com>
Tue, 3 Feb 2015 20:54:20 +0000 (12:54 -0800)
Platform ports may need to include egl(ext).h, and that will confilict
with defines in eglwEnums.hpp. This change removes eglwEnums.hpp
references from EGL framework headers to allow including actual EGL
headers if necessary.

Change-Id: I4aaa0d40196a7cd041a5a36828f601cdda91d9cc

framework/egl/egluConfigFilter.cpp
framework/egl/egluConfigFilter.hpp
framework/egl/egluUnique.cpp
framework/egl/egluUnique.hpp
modules/egl/teglApiCase.hpp
modules/egl/teglColorClearTests.cpp

index 64bebf8..c6d06ad 100644 (file)
@@ -24,6 +24,7 @@
 #include "egluConfigFilter.hpp"
 #include "egluUtil.hpp"
 #include "egluConfigInfo.hpp"
+#include "eglwEnums.hpp"
 
 #include <algorithm>
 
@@ -57,6 +58,17 @@ int CandidateConfig::get (deUint32 attrib) const
                return getConfigAttribInt(*m_cfg.object.egl, m_cfg.object.display, m_cfg.object.config, attrib);
 }
 
+int                    CandidateConfig::id                             (void) const { return get(EGL_CONFIG_ID);                                       }
+int                    CandidateConfig::redSize                (void) const { return get(EGL_RED_SIZE);                                        }
+int                    CandidateConfig::greenSize              (void) const { return get(EGL_GREEN_SIZE);                                      }
+int                    CandidateConfig::blueSize               (void) const { return get(EGL_BLUE_SIZE);                                       }
+int                    CandidateConfig::alphaSize              (void) const { return get(EGL_ALPHA_SIZE);                                      }
+int                    CandidateConfig::depthSize              (void) const { return get(EGL_DEPTH_SIZE);                                      }
+int                    CandidateConfig::stencilSize    (void) const { return get(EGL_STENCIL_SIZE);                            }
+int                    CandidateConfig::samples                (void) const { return get(EGL_SAMPLES);                                         }
+deUint32       CandidateConfig::renderableType (void) const { return (deUint32)get(EGL_RENDERABLE_TYPE);       }
+deUint32       CandidateConfig::surfaceType    (void) const { return (deUint32)get(EGL_SURFACE_TYPE);          }
+
 FilterList& FilterList::operator<< (ConfigFilter filter)
 {
        m_rules.push_back(filter);
index dcaaa87..2f316fe 100644 (file)
@@ -27,7 +27,6 @@
 #include "tcuRGBA.hpp"
 
 #include "eglwDefs.hpp"
-#include "eglwEnums.hpp"
 
 #include <vector>
 
@@ -49,17 +48,17 @@ public:
 
        int                             get                                     (deUint32 attrib) const;
 
-       int                             id                                      (void) const { return get(EGL_CONFIG_ID);               }
-       int                             redSize                         (void) const { return get(EGL_RED_SIZE);                }
-       int                             greenSize                       (void) const { return get(EGL_GREEN_SIZE);              }
-       int                             blueSize                        (void) const { return get(EGL_BLUE_SIZE);               }
-       int                             alphaSize                       (void) const { return get(EGL_ALPHA_SIZE);              }
-       int                             depthSize                       (void) const { return get(EGL_DEPTH_SIZE);              }
-       int                             stencilSize                     (void) const { return get(EGL_STENCIL_SIZE);    }
-       int                             samples                         (void) const { return get(EGL_SAMPLES);                 }
-
-       deUint32                renderableType          (void) const { return (deUint32)get(EGL_RENDERABLE_TYPE);       }
-       deUint32                surfaceType                     (void) const { return (deUint32)get(EGL_SURFACE_TYPE);          }
+       int                             id                                      (void) const;
+       int                             redSize                         (void) const;
+       int                             greenSize                       (void) const;
+       int                             blueSize                        (void) const;
+       int                             alphaSize                       (void) const;
+       int                             depthSize                       (void) const;
+       int                             stencilSize                     (void) const;
+       int                             samples                         (void) const;
+
+       deUint32                renderableType          (void) const;
+       deUint32                surfaceType                     (void) const;
 
        tcu::RGBA               colorBits                       (void) const { return tcu::RGBA(redSize(), greenSize(), blueSize(), alphaSize());       }
 
index dc61757..da04c1d 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "egluUnique.hpp"
 #include "eglwLibrary.hpp"
+#include "eglwEnums.hpp"
 
 namespace eglu
 {
@@ -41,6 +42,11 @@ UniqueDisplay::~UniqueDisplay (void)
                m_egl.terminate(m_display);
 }
 
+UniqueDisplay::operator bool (void) const
+{
+       return m_display != EGL_NO_DISPLAY;
+}
+
 UniqueSurface::UniqueSurface (const Library& egl, EGLDisplay display, EGLSurface surface)
        : m_egl         (egl)
        , m_display     (display)
@@ -54,6 +60,11 @@ UniqueSurface::~UniqueSurface (void)
                m_egl.destroySurface(m_display, m_surface);
 }
 
+UniqueSurface::operator bool (void) const
+{
+       return m_surface != EGL_NO_SURFACE;
+}
+
 UniqueContext::UniqueContext (const Library& egl, EGLDisplay display, EGLContext context)
        : m_egl         (egl)
        , m_display     (display)
@@ -67,6 +78,11 @@ UniqueContext::~UniqueContext (void)
                m_egl.destroyContext(m_display, m_context);
 }
 
+UniqueContext::operator bool (void) const
+{
+       return m_context != EGL_NO_CONTEXT;
+}
+
 ScopedCurrentContext::ScopedCurrentContext (const Library& egl, EGLDisplay display, EGLSurface draw, EGLSurface read, EGLContext context)
        : m_egl         (egl)
        , m_display (display)
@@ -92,4 +108,9 @@ UniqueImage::~UniqueImage (void)
                m_egl.destroyImageKHR(m_display, m_image);
 }
 
+UniqueImage::operator bool (void) const
+{
+       return m_image != EGL_NO_IMAGE;
+}
+
 } // eglu
index f8964e7..aa24f5a 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "egluDefs.hpp"
 #include "eglwDefs.hpp"
-#include "eglwEnums.hpp"
 
 namespace eglw
 {
@@ -42,7 +41,7 @@ public:
                                                        ~UniqueDisplay  (void);
 
        eglw::EGLDisplay                operator*               (void) const { return m_display; }
-       operator                                bool                    (void) const { return m_display != EGL_NO_DISPLAY; }
+       operator                                bool                    (void) const;
 
 private:
        const eglw::Library&    m_egl;
@@ -60,7 +59,7 @@ public:
                                                        ~UniqueSurface  (void);
 
        eglw::EGLSurface                operator*               (void) const { return m_surface; }
-       operator                                bool                    (void) const { return m_surface != EGL_NO_SURFACE; }
+       operator                                bool                    (void) const;
 
 private:
        const eglw::Library&    m_egl;
@@ -79,7 +78,7 @@ public:
                                                        ~UniqueContext  (void);
 
        eglw::EGLContext                operator*               (void) const { return m_context; }
-       operator                                bool                    (void) const { return m_context != EGL_NO_CONTEXT; }
+       operator                                bool                    (void) const;
 
 private:
        const eglw::Library&    m_egl;
@@ -109,7 +108,7 @@ public:
                                                        ~UniqueImage    (void);
 
        eglw::EGLImage                  operator*               (void) const { return m_image; }
-       operator                                bool                    (void) const { return m_image != EGL_NO_IMAGE_KHR; }
+       operator                                bool                    (void) const;
 
 private:
        const eglw::Library&    m_egl;
index f13007b..445a0c0 100644 (file)
@@ -27,6 +27,7 @@
 #include "teglTestCase.hpp"
 #include "egluCallLogWrapper.hpp"
 #include "egluConfigFilter.hpp"
+#include "eglwEnums.hpp"
 
 #include <vector>
 
index 9f24d2f..c79063c 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "teglColorClearTests.hpp"
 #include "teglColorClearCase.hpp"
+#include "eglwEnums.hpp"
 
 using std::string;
 using std::vector;