summaryrefslogtreecommitdiff
path: root/opengl/tests/hwc/hwcTestLib.cpp
diff options
context:
space:
mode:
authorLouis Huemiller <lhuemill@google.com>2011-01-09 10:59:31 -0800
committerLouis Huemiller <lhuemill@google.com>2011-01-09 10:59:31 -0800
commit585cd4f78c6cf141f307f3cb2659ef08ed2003cc (patch)
treef3e7cac57d9aaa32b1f93d5de460ac8ae3c5c2f0 /opengl/tests/hwc/hwcTestLib.cpp
parentb0512c372587f366f0b0bd859b22a344a5d5a520 (diff)
Hardware Composer Commit Points Benchmark
Change-Id: Ie997d13559c0e4e9dc3babfe92ca1acacef2a549
Diffstat (limited to 'opengl/tests/hwc/hwcTestLib.cpp')
-rw-r--r--opengl/tests/hwc/hwcTestLib.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/opengl/tests/hwc/hwcTestLib.cpp b/opengl/tests/hwc/hwcTestLib.cpp
index 575af8993cd3..b790c513d0c8 100644
--- a/opengl/tests/hwc/hwcTestLib.cpp
+++ b/opengl/tests/hwc/hwcTestLib.cpp
@@ -174,6 +174,19 @@ HwcTestDim::operator string()
return out.str();
}
+// Dimension class to hwc_rect conversion
+HwcTestDim::operator hwc_rect() const
+{
+ hwc_rect rect;
+
+ rect.left = rect.top = 0;
+
+ rect.right = this->_w;
+ rect.bottom = this->_h;
+
+ return rect;
+}
+
// Hardware Composer rectangle to string conversion
string hwcTestRect2str(const struct hwc_rect& rect)
{
@@ -349,6 +362,21 @@ const struct hwcTestGraphicFormat *hwcTestGraphicFormatLookup(const char *desc)
return NULL;
}
+// Look up and return pointer to structure with the characteristics
+// of the graphic format specified by the id parameter. Search failure
+// indicated by the return of NULL.
+const struct hwcTestGraphicFormat *hwcTestGraphicFormatLookup(uint32_t id)
+{
+ for (unsigned int n1 = 0; n1 < NUMA(hwcTestGraphicFormat); n1++) {
+ if (id == hwcTestGraphicFormat[n1].format) {
+ return &hwcTestGraphicFormat[n1];
+ }
+ }
+
+ return NULL;
+}
+
+
// Given the integer ID of a graphic format, return a pointer to
// a string that describes the format.
const char *hwcTestGraphicFormat2str(uint32_t format)