Correctly track texture cleared state for sharing
[chromium-blink-merge.git] / ui / display / chromeos / x11 / display_util_x11.cc
blob560edd08e29b4b3fa0f39592f68bf655dea68743
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/display/chromeos/x11/display_util_x11.h"
7 #include "base/macros.h"
9 namespace ui {
11 namespace {
13 struct DisplayConnectionTypeMapping {
14 // Prefix of output name.
15 const char* name;
16 DisplayConnectionType type;
19 const DisplayConnectionTypeMapping kDisplayConnectionTypeMapping[] = {
20 {"LVDS", DISPLAY_CONNECTION_TYPE_INTERNAL},
21 {"eDP", DISPLAY_CONNECTION_TYPE_INTERNAL},
22 {"DSI", DISPLAY_CONNECTION_TYPE_INTERNAL},
23 {"VGA", DISPLAY_CONNECTION_TYPE_VGA},
24 {"HDMI", DISPLAY_CONNECTION_TYPE_HDMI},
25 {"DVI", DISPLAY_CONNECTION_TYPE_DVI},
26 {"DP", DISPLAY_CONNECTION_TYPE_DISPLAYPORT}};
28 } // namespace
30 DisplayConnectionType GetDisplayConnectionTypeFromName(
31 const std::string& name) {
32 for (unsigned int i = 0; i < arraysize(kDisplayConnectionTypeMapping); ++i) {
33 if (name.find(kDisplayConnectionTypeMapping[i].name) == 0) {
34 return kDisplayConnectionTypeMapping[i].type;
38 return DISPLAY_CONNECTION_TYPE_UNKNOWN;
41 } // namespace ui