summaryrefslogtreecommitdiff
path: root/include/gui/DisplayEventReceiver.h
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2016-09-29 23:46:31 +0000
committer android-build-merger <android-build-merger@google.com> 2016-09-29 23:46:31 +0000
commit2ef0bdafc104da56a896f9de2ddde6f3d6c918cc (patch)
treef3b129eb04992b13c0f72756fd81e0fb40fcb6dd /include/gui/DisplayEventReceiver.h
parent71b953d0a3c6f231e97222b74ef914143b044426 (diff)
parent3f6292ea8122b964c60292ec57c8fcf8b43fd8c4 (diff)
Merge "Rewrite multicharacter constant using constexpr" am: 991667ba8c
am: 3f6292ea81 Change-Id: I8ccf4b34cb9dc76c91ceac5f928918fa2e0b7ec0
Diffstat (limited to 'include/gui/DisplayEventReceiver.h')
-rw-r--r--include/gui/DisplayEventReceiver.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/gui/DisplayEventReceiver.h b/include/gui/DisplayEventReceiver.h
index a4718b91c6..cb9b373392 100644
--- a/include/gui/DisplayEventReceiver.h
+++ b/include/gui/DisplayEventReceiver.h
@@ -35,13 +35,19 @@ namespace android {
class BitTube;
class IDisplayEventConnection;
-// ----------------------------------------------------------------------------
+static inline constexpr uint32_t fourcc(char c1, char c2, char c3, char c4) {
+ return static_cast<uint32_t>(c1) << 24 |
+ static_cast<uint32_t>(c2) << 16 |
+ static_cast<uint32_t>(c3) << 8 |
+ static_cast<uint32_t>(c4);
+}
+// ----------------------------------------------------------------------------
class DisplayEventReceiver {
public:
enum {
- DISPLAY_EVENT_VSYNC = 'vsyn',
- DISPLAY_EVENT_HOTPLUG = 'plug'
+ DISPLAY_EVENT_VSYNC = fourcc('v', 's', 'y', 'n'),
+ DISPLAY_EVENT_HOTPLUG = fourcc('p', 'l', 'u', 'g'),
};
struct Event {