OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/ozone/common/egl_util.h" | 5 #include "ui/ozone/common/egl_util.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "ui/gl/egl_util.h" | 8 #include "ui/gl/egl_util.h" |
9 #include "ui/gl/gl_bindings.h" | 9 #include "ui/gl/gl_bindings.h" |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 EGLConfig config; | 80 EGLConfig config; |
81 if (!eglChooseConfig(display, attributes, &config, 1, &num_configs)) { | 81 if (!eglChooseConfig(display, attributes, &config, 1, &num_configs)) { |
82 LOG(ERROR) << "eglChooseConfig failed with error " | 82 LOG(ERROR) << "eglChooseConfig failed with error " |
83 << GetLastEGLErrorString(); | 83 << GetLastEGLErrorString(); |
84 return nullptr; | 84 return nullptr; |
85 } | 85 } |
86 return config; | 86 return config; |
87 } | 87 } |
88 | 88 |
89 void* /* EGLConfig */ ChooseEGLConfig(const EglConfigCallbacks& egl, | |
90 const int32_t* attributes) { | |
91 void* config; | |
92 int32_t num_configs; | |
93 if (!egl.choose_config.Run(attributes, nullptr, 0, &num_configs)) { | |
94 LOG(ERROR) << "eglChooseConfig failed with error " | |
95 << egl.get_last_error_string.Run(); | |
96 return nullptr; | |
97 } | |
98 | |
99 if (num_configs == 0) { | |
100 LOG(ERROR) << "No suitable EGL configs found."; | |
101 return nullptr; | |
102 } | |
103 | |
104 if (!egl.choose_config.Run(attributes, &config, 1, &num_configs)) { | |
105 LOG(ERROR) << "eglChooseConfig failed with error " | |
106 << egl.get_last_error_string.Run(); | |
107 return nullptr; | |
108 } | |
109 return config; | |
110 } | |
111 | |
112 } // namespace ui | 89 } // namespace ui |
OLD | NEW |