diff options
author | Brian Paul <brianp@vmware.com> | 2009-12-08 09:57:46 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-12-08 10:03:43 -0700 |
commit | 002d88e1a508c23402f082a0eb02f5ba88bd90fa (patch) | |
tree | 5e5d32987591a1d15cc49a53f0aa3d9925291d36 | |
parent | 7fb5daa7870d559b431d9f6eba2f6c3d74dafbbe (diff) |
dsconfig: added equal() method to see if two configs are identical
-rw-r--r-- | src/libs/dsurf/dsconfig.cpp | 60 | ||||
-rw-r--r-- | src/libs/dsurf/dsconfig.h | 2 |
2 files changed, 62 insertions, 0 deletions
diff --git a/src/libs/dsurf/dsconfig.cpp b/src/libs/dsurf/dsconfig.cpp index 2b64de1..0d9e23e 100644 --- a/src/libs/dsurf/dsconfig.cpp +++ b/src/libs/dsurf/dsconfig.cpp @@ -962,4 +962,64 @@ DrawingSurfaceConfig::match(vector<DrawingSurfaceConfig*>& choices) { return best; } // DrawingSurfaceConfig::match +// are two surface configs exactly the same? +bool +DrawingSurfaceConfig::equal(const DrawingSurfaceConfig &config) const +{ + if ( +#if defined(__X11__) + visID == config.visID && +# if defined(GLX_VERSION_1_3) + fbcID == config.fbcID && +# endif +#elif defined(__WIN__) + pfdID == config.pfdID && +#elif defined(__AGL__) + pfID == config.pfID && +#else +# error "what's the config ID?" +#endif + canRGBA == config.canRGBA && + canCI == config.canCI && + bufSize == config.bufSize && + level == config.level && + db == config.db && + stereo == config.stereo && + aux == config.aux && + r == config.r && + g == config.g && + b == config.b && + a == config.a && + z == config.z && + s == config.s && + accR == config.accR && + accG == config.accG && + accB == config.accB && + accA == config.accA && + samples == config.samples && + canWindow == config.canWindow && +#if defined(__X11__) + canPixmap == config.canPixmap && +#if defined(GLX_VERSION_1_3) + canPBuffer == config.canPBuffer && + maxPBufferWidth == config.maxPBufferWidth && + maxPBufferHeight == config.maxPBufferHeight && + maxPBufferPixels == config.maxPBufferPixels && +#endif +#endif + canWinSysRender == config.canWinSysRender && + fast == config.fast && + conformant == config.conformant && + transparent == config.transparent && + transR == config.transR && + transG == config.transG && + transB == config.transB && + transA == config.transA && + transI == config.transI + ) + return true; + else + return false; +} + } // namespace GLEAN diff --git a/src/libs/dsurf/dsconfig.h b/src/libs/dsurf/dsconfig.h index 3a9ff8b..3827662 100644 --- a/src/libs/dsurf/dsconfig.h +++ b/src/libs/dsurf/dsconfig.h @@ -210,6 +210,8 @@ class DrawingSurfaceConfig { // machine may be compared with test results for // configs on another machine. + bool equal(const DrawingSurfaceConfig &config) const; + }; // class DrawingSurfaceConfig } // namespace GLEAN |